PageSourceSearch

https://www.divephotoguide.com/js/unserialize.js

js divephotoguide.com collected 2026-09-24 08:40:04 UTC 2,316 bytes, 90 lines download raw bytes

1function unserialize(str)
2{
3	function readVar()
4	{
5		var r, t, tmp, k, v, l = 0;
6		
7		switch(read(2))
8		{
9			case "N;":
10				r = null;
11				break;
12			case "b:":
13				if(t = read(";").match(/^(\d);$/)) r = parseInt(t[1]) == 1;
14				break;
15			case "i:":
16				if(t = read(";").match(/^(\d+);$/)) r = parseInt(t[1]);
17				break;
18			case "d:":
19				if(t = read(";").match(/^(\d+\.\d+);$/)) r = parseFloat(t[1]);
20				break;
21			case "s:":
22				if(t = read('"').match(/^(\d+):"$/))
23				{
24					l = parseInt(t[1]);
25					if((t = read(l+2)) && t.substr(l) == '";') r = t.substr(0, l);
26				}
27				break;
28			case "a:":
29				if(t = read("{").match(/^(\d+):\{$/))
30				{
31					tmp = new Array();
32					while(l < t[1])
33					{
34						k = readVar();
35						v = readVar();
36						if(((typeof k != "number" || k != parseInt(k)) && typeof k != "string") || typeof v == "undefined") break;
37						tmp[k] = v;
38						l++;
39					}
40					if(l == t[1] && read(1) == "}") r = tmp;
41				}
42				break;
43			case "O:":
44				if((t = read("{").match(/^(\d+):"([A-Za-z\d_]+)":(\d+):\{$/)) && t[1] == t[2].length)
45				{
46					tmp = new Object();
47					while(l < t[3])
48					{
49						k = readVar();
50						v = readVar();
51						if(typeof k != "string" || typeof v == "undefined") break;
52						eval("tmp."+k+" = v;");
53						l++;
54					}
55					if(l == t[3] && read(1) == "}") r = tmp;
56				}
57				break;
58		}
59		return r;
60	}//readVar
61	
62	var position = 0;
63	function read(l)
64	{
65		var c = "";
66		if(typeof l == "number")
67		{
68			c = position + l <= str.length ? str.substr(position, l) : "";
69			position += l;
70		}
71		else
72		{
73			while(c.substring(c.length-1) != l) c += read(1);
74		}
75		return c;
76	}//read
77	
78	return readVar();
79}//unserialize
80
81function print_r(o,m){
82var c="";function p(o,l){var c="";
82if(!l)l=0;if(o&&(o.constructor==Array||o.constructor==Object))
83{c+=(o.constructor==Array?"Array":"Object")+"\n"+w(l*2)+"(\n";
84for(var i in o)if(typeof o[i]!="function")c+=w(l*2+1)+"["+i+"] => "+p(o[i],l+1);c+=w(l*2)+")\n\n";}
85else c+=o+"\n";return c;}function w(n){var c="";for(var i=0;i<n*4;i++)c+=" ";return c;}
86c=p(o);if(!m)c=document.write(c);return c;}
87
88function _test(v){alert(print_r(v,1));}
89
90function stripslashes(s){return String(s).replace(/\\\\/g,'\\').replace(/\\\'/g,'\'').replace(/\\\"/g,'"');}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.