36
36
</div>
37
37
<div id="navbar" class="collapse navbar-collapse">
38
38
<ul class="nav navbar-nav">
39
+ <li class="active"><a href="./">Browser</a></li>
40
+ <li><a href="instructions.php">Instructions</a></li>
41
+ <li><a href="credits.php">Credits</a></li>
39
42
</ul>
40
43
</div><!--/.nav-collapse -->
41
44
</div>
44
47
<main class="container">
45
48
<?php
46
49
50
+ if (is_file ('includes.php ' ) && is_readable ('includes.php ' )) {
51
+ require_once 'includes.php ' ;
52
+ echo '<div class="alert alert-info"><i class="fa fa-info-circle"></i> Class definitions from includes.php loaded.</div> ' ;
53
+ }
54
+
47
55
define ('RECURSION_SANITY_LIMIT ' ,25 );
48
56
define ('BASE_URL ' , str_replace ('index.php ' , '' , full_url ($ _SERVER )));
49
57
error_reporting (E_ALL & ~E_NOTICE );
66
74
}
67
75
}
68
76
else {
69
- echo '<div class="alert alert-danger"><strong>Warning:</strong> This app can be used to run arbitrary code. Do not install it on an unprotected, public server.</div>
70
- <div id="form-container">
77
+ echo '<div id="form-container">
71
78
<form action="index.php" method="post">
72
- <h5 >PHP Object To Inspect:</h5 >
79
+ <h3 >PHP Object To Inspect:</h3 >
73
80
<p id="data-container"><textarea class="form-control" name="data" id="data" placeholder="Copy/paste serialized PHP code here"></textarea></p>
74
81
<p id="submit-container"><input class="btn btn-primary" type="submit" value="Let \'s Do This..."></p>
75
82
</form>
76
83
</div>
77
- <h5 class="top-buffer">Example serialized code:</h5>
78
- <pre>O:8:"stdClass":2:{s:4:"name";s:16:"This is a string";s:4:"data";a:2:{s:4:"size";i:50;s:5:"color";s:5:"green";}}</pre>
79
84
' ;
80
85
}
81
86
@@ -142,7 +147,7 @@ function recurse_var($varname, &$value, $path = '/', $level = 0)
142
147
143
148
$ methods = get_class_methods ($ value );
144
149
foreach ($ methods as $ method ) {
145
- echo "<li><strong> $ method</strong> (Function) \n" ;
150
+ echo "<li data-jstree='{ \" icon \" : \"" . BASE_URL . " assets/images/function.png \" }' ><strong>$ method</strong> (Function) \n" ;
146
151
}
147
152
148
153
echo "</ul></li> \n" ;
@@ -166,11 +171,16 @@ function recurse_var($varname, &$value, $path = '/', $level = 0)
166
171
echo "<li data-jstree='{ \"icon \": \"" .BASE_URL ."assets/images/ $ icon \"}'><strong> $ varname</strong> = " . (is_string ($ value ) ? '" ' . htmlentities ($ value ) . '" ' : $ value ) . "</li> \n" ;
167
172
}
168
173
169
- // if (!array_key_exists($cache_key,$PARSED_OBJS))
174
+ // if (!array_key_exists($cache_key,$PARSED_OBJS)) // this sometimes makes things even more weird
170
175
$ PARSED_OBJS [$ cache_key ] = $ path ;
171
176
172
177
}
173
178
179
+ /**
180
+ * @param array $_SERVER
181
+ * @param bool $use_forwarded_host may need to be set to true if behind a load balancer
182
+ * @return string
183
+ */
174
184
function url_origin ($ s , $ use_forwarded_host =false )
175
185
{
176
186
$ ssl = (!empty ($ s ['HTTPS ' ]) && $ s ['HTTPS ' ] == 'on ' ) ? true :false ;
@@ -182,16 +192,27 @@ function url_origin($s, $use_forwarded_host=false)
182
192
$ host = isset ($ host ) ? $ host : $ s ['SERVER_NAME ' ] . $ port ;
183
193
return $ protocol . ':// ' . $ host ;
184
194
}
195
+
196
+ /**
197
+ * @param array $_SERVER
198
+ * @param bool $use_forwarded_host may need to be set to true if behind a load balancer
199
+ * @return string
200
+ */
185
201
function full_url ($ s , $ use_forwarded_host =false )
186
202
{
187
203
return url_origin ($ s , $ use_forwarded_host ) . $ s ['REQUEST_URI ' ];
188
204
}
205
+
189
206
?>
207
+
208
+ <p class="top-buffer text-danger"><strong><i class="fa fa-exclamation-triangle"></i> Warning:</strong> This utility may possibly be used to
209
+ run untrusted code. Do not leave it installed on an unprotected public server.
210
+ <a href="http://php.net/manual/en/function.unserialize.php">More info...</a></p>
190
211
</main>
191
212
192
213
<footer class="footer">
193
214
<div class="container">
194
- <div class="text-muted">Created out of spite by <a href="http://verysimple.com/">Jason Hinkle</a> - <a href="credits.php">Credits</a> </div>
215
+ <div class="text-muted">Created out of spite by <a href="http://verysimple.com/">Jason Hinkle</a></div>
195
216
</div>
196
217
</footer>
197
218
0 commit comments