CVE-2014-125107 (published 2023-12-19T03:15Z)

A vulnerability was found in Corveda PHPSandbox 1.3.4 and classified as critical. Affected by this issue is some unknown functionality of the component String Handler. The manipulation leads to protection mechanism failure. The attack may be launched remotely. Upgrading to version 1.3.5 is able to address this issue. The patch is identified as 48fde5ffa4d76014bad260a3cbab7ada3744a4cc. It is recommended to upgrade the affected component. VDB-248270 is the identifier assigned to this vulnerability.

CVSS v3 base score: 5.3, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N)

Weakness information:
cwe_id: CWE-693
cwe_name: Protection Mechanism Failure
description: The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
extended_description: This weakness covers three distinct situations. A "missing" protection mechanism occurs when the application does not define any mechanism against a certain class of attack. An "insufficient" protection mechanism might provide some defenses - for example, against the most common attacks - but it does not protect against everything that is intended. Finally, an "ignored" mechanism occurs when a mechanism is available and in active use within the product, but the developer has not applied it in some code path.
         

Fix information:
repo_url: https://github.com/Corveda/PHPSandbox
commit_details: repo_url: https://github.com/Corveda/PHPSandbox
author: Elijah Horton
author_date: 2014-03-10 17:10:27-04:00
msg: - Addressed potential vulnerabilities related to SandboxedStrings where sandboxed code could manipulate the strings in a way that could defeat their protection
- Solved errors from casting sandboxed strings to int
- Overwrote some internal PHP functions to further mask SandboxedStrings from the sandboxed code and prevent type-checking errors
- Added more tests related to SandboxedStrings
- Made some minor tweaks to PHPSandbox Toolkit
repository: repo_url: https://github.com/Corveda/PHPSandbox
repo_name: Corveda/PHPSandbox
description: A PHP-based sandboxing library with a full suite of configuration and validation options.
repo_language: PHP
owner: Corveda
file_changes: filename: CHANGELOG.md
change_type: ModificationType.MODIFY
diff: @@ -1,5 +1,12 @@
 #CHANGELOG
 
+##03/10/2014
+- Addressed potential vulnerabilities related to SandboxedStrings where sandboxed code could manipulate the strings in a way that could defeat their protection
+- Solved errors from casting sandboxed strings to int
+- Overwrote some internal PHP functions to further mask SandboxedStrings from the sandboxed code and prevent type-checking errors
+- Added more tests related to SandboxedStrings
+- Made some minor tweaks to PHPSandbox Toolkit
+
 ##03/05/2014
 - Corrected an issue where the sandbox variable could be accessed from within the sandbox in PHP 5.4+
 

programming_language: Markdown
filename: LICENSE
change_type: ModificationType.MODIFY
diff: @@ -1,4 +1,4 @@
-Copyright (c) 2013 by Elijah Horton (fieryprophet [at] yahoo.com)
+Copyright (c) 2013-2014 by Elijah Horton (fieryprophet [at] yahoo.com)
 
 Some rights reserved.
 

programming_language: Markdown
filename: MANUAL.html
change_type: ModificationType.MODIFY
diff: @@ -34,7 +34,7 @@
                 </a>
                 <br/>
                 <h1 style="margin: 0;">
-                    PHPSandbox Toolkit 1.3.1
+                    PHPSandbox Toolkit 1.3.3
                 </h1>
                 <br/>
                 <strong>Developed by: </strong> <a href="http://www.fieryprophet.com" target="_blank">Elijah Horton</a>

programming_language: HTML
filename: README.md
change_type: ModificationType.MODIFY
diff: @@ -8,11 +8,7 @@ It also utilizes [FunctionParser](https://github.com/jeremeamia/FunctionParser)
 
 **Online API Documentation:** [http://fieryprophet.com/phpsandbox-docs/](http://fieryprophet.com/phpsandbox-docs/)
 
-[![Build Status](https://travis-ci.org/fieryprophet/php-sandbox.png?branch=master)](https://travis-ci.org/fieryprophet/php-sandbox)
-
-[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/quality-score.png?s=4f2d82525b9e2c6bae18e26cf643ca3fd09333fc)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/)
-
-[![Code Coverage](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/coverage.png?s=d6cef7d18a66d2ac39b76410b76c89fa15d84b8c)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/)
+[![Build Status](https://travis-ci.org/fieryprophet/php-sandbox.png?branch=master)](https://travis-ci.org/fieryprophet/php-sandbox) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/quality-score.png?s=4f2d82525b9e2c6bae18e26cf643ca3fd09333fc)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/) [![Code Coverage](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/coverage.png?s=d6cef7d18a66d2ac39b76410b76c89fa15d84b8c)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/) [![Latest Stable Version](https://poser.pugx.org/fieryprophet/php-sandbox/v/stable.png)](https://packagist.org/packages/fieryprophet/php-sandbox) [![Total Downloads](https://poser.pugx.org/fieryprophet/php-sandbox/downloads.png)](https://packagist.org/packages/fieryprophet/php-sandbox) [![Latest Unstable Version](https://poser.pugx.org/fieryprophet/php-sandbox/v/unstable.png)](https://packagist.org/packages/fieryprophet/php-sandbox) [![License](https://poser.pugx.org/fieryprophet/php-sandbox/license.png)](https://packagist.org/packages/fieryprophet/php-sandbox)
 
 ##Features:
 

programming_language: Markdown
filename: PHPSandbox.Error.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-553992218"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2138946611"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-553992218" class="accordion-body collapse in">
+            <div id="namespace-2138946611" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2135081389"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-288135741"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-2135081389" class="accordion-body collapse ">
+            <div id="namespace-288135741" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -2448,7 +2448,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: PHPSandbox.PHPSandbox.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-148348232"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1578178908"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-148348232" class="accordion-body collapse in">
+            <div id="namespace-1578178908" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1647787725"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-736098440"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-1647787725" class="accordion-body collapse ">
+            <div id="namespace-736098440" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -295,12 +295,21 @@ only has to create a PHPSandbox instance, configure its options, and run their c
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method__get_declared_classes" class="">_get_declared_classes()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method__get_declared_interfaces" class="">_get_declared_interfaces()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method__get_declared_traits" class="">_get_declared_traits()</a><br />
-                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_dump" class="">_var_dump()</a><br />
-                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__print_r" class="">_print_r()</a><br />
-                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_export" class="">_var_export()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method__func_get_args" class="">_func_get_args()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method__func_get_arg" class="">_func_get_arg()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method__func_num_args" class="">_func_num_args()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__wrap" class="">_wrap()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_dump" class="">_var_dump()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__print_r" class="">_print_r()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_export" class="">_var_export()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__intval" class="">_intval()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__floatval" class="">_floatval()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__arrayval" class="">_arrayval()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__objectval" class="">_objectval()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_string" class="">_is_string()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_object" class="">_is_object()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_scalar" class="">_is_scalar()</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_callable" class="">_is_callable()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method_call_func" class="">call_func()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method_define" class="">define()</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#method_undefine" class="">undefine()</a><br />
@@ -549,8 +558,8 @@ only has to create a PHPSandbox instance, configure its options, and run their c
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_superglobals" class="">$superglobals</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_magic_constants" class="">$magic_constants</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_defined_funcs" class="">$defined_funcs</a><br />
-                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_var_funcs" class="">$var_funcs</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_arg_funcs" class="">$arg_funcs</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_sandboxed_string_funcs" class="">$sandboxed_string_funcs</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_name" class="">$name</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_error_level" class="">$error_level</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_restore_error_level" class="">$restore_error_level</a><br />
@@ -564,8 +573,8 @@ only has to create a PHPSandbox instance, configure its options, and run their c
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_auto_whitelist_traits" class="">$auto_whitelist_traits</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_auto_define_vars" class="">$auto_define_vars</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_overwrite_defined_funcs" class="">$overwrite_defined_funcs</a><br />
-                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_overwrite_var_funcs" class="">$overwrite_var_funcs</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_overwrite_func_get_args" class="">$overwrite_func_get_args</a><br />
+                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_overwrite_sandboxed_string_funcs" class="">$overwrite_sandboxed_string_funcs</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_overwrite_superglobals" class="">$overwrite_superglobals</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_allow_functions" class="">$allow_functions</a><br />
                                                                     <a href="../classes/PHPSandbox.PHPSandbox.html#property_allow_closures" class="">$allow_closures</a><br />
@@ -985,17 +994,17 @@ only has to create a PHPSandbox instance, configure its options, and run their c
 
                                     <div class="row-fluid">
         <div class="span8 content class">
-            <a id="property_var_funcs" name="property_var_funcs" class="anchor"></a>
+            <a id="property_arg_funcs" name="property_arg_funcs" class="anchor"></a>
             <article class="property">
-                <h3 class="public ">$var_funcs</h3>
-                <pre class="signature">$var_funcs : array</pre>
+                <h3 class="public ">$arg_funcs</h3>
+                <pre class="signature">$arg_funcs : array</pre>
                 <p><em></em></p>
                 
 
 
                                 <h4>Type</h4>
                 array
-                &mdash; A static array of var_dump, print_r and var_export for redefining those functions                            </article>
+                &mdash; A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions                            </article>
         </div>
         <aside class="span4 detailsbar">
             <h1><i class="icon-arrow-down"></i></h1>
@@ -1010,17 +1019,18 @@ only has to create a PHPSandbox instance, configure its options, and run their c
 
                                     <div class="row-fluid">
         <div class="span8 content class">
-            <a id="property_arg_funcs" name="property_arg_funcs" class="anchor"></a>
+            <a id="property_sandboxed_string_funcs" name="property_sandboxed_string_funcs" class="anchor"></a>
             <article class="property">
-                <h3 class="public ">$arg_funcs</h3>
-                <pre class="signature">$arg_funcs : array</pre>
+                <h3 class="public ">$sandboxed_string_funcs</h3>
+                <pre class="signature">$sandboxed_string_funcs : array</pre>
                 <p><em></em></p>
                 
 
 
                                 <h4>Type</h4>
                 array
-                &mdash; A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions                            </article>
+                &mdash; A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object,
+                         is_scalar and is_callable for redefining those functions                            </article>
         </div>
         <aside class="span4 detailsbar">
             <h1><i class="icon-arrow-down"></i></h1>
@@ -1456,17 +1466,17 @@ only has to create a PHPSandbox instance, configure its options, and run their c
 
                                     <div class="row-fluid">
         <div class="span8 content class">
-            <a id="property_overwrite_var_funcs" name="property_overwrite_var_funcs" class="anchor"></a>
+            <a id="property_overwrite_func_get_args" name="property_overwrite_func_get_args" class="anchor"></a>
             <article class="property">
-                <h3 class="public ">$overwrite_var_funcs</h3>
-                <pre class="signature">$overwrite_var_funcs : bool</pre>
+                <h3 class="public ">$overwrite_func_get_args</h3>
+                <pre class="signature">$overwrite_func_get_args : bool</pre>
                 <p><em></em></p>
                 
 
 
                                 <h4>Type</h4>
                 bool
-                &mdash; Should PHPSandbox overwrite var_dump, print_r, and var_export?                            </article>
+                &mdash; Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?                            </article>
         </div>
         <aside class="span4 detailsbar">
             <h1><i class="icon-arrow-down"></i></h1>
@@ -1489,17 +1499,17 @@ only has to create a PHPSandbox instance, configure its options, and run their c
 
                                     <div class="row-fluid">
         <div class="span8 content class">
-            <a id="property_overwrite_func_get_args" name="property_overwrite_func_get_args" class="anchor"></a>
+            <a id="property_overwrite_sandboxed_string_funcs" name="property_overwrite_sandboxed_string_funcs" class="anchor"></a>
             <article class="property">
-                <h3 class="public ">$overwrite_func_get_args</h3>
-                <pre class="signature">$overwrite_func_get_args : bool</pre>
+                <h3 class="public ">$overwrite_sandboxed_string_funcs</h3>
+                <pre class="signature">$overwrite_sandboxed_string_funcs : bool</pre>
                 <p><em></em></p>
                 
 
 
                                 <h4>Type</h4>
                 bool
-                &mdash; Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?                            </article>
+                &mdash; Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays.                            </article>
         </div>
         <aside class="span4 detailsbar">
             <h1><i class="icon-arrow-down"></i></h1>
@@ -1532,7 +1542,7 @@ only has to create a PHPSandbox instance, configure its options, and run their c
 
                                 <h4>Type</h4>
                 bool
-                &mdash; Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays.                            </article>
+                &mdash; Should PHPSandbox overwrite functions to help hide SandboxedStrings?                            </article>
         </div>
         <aside class="span4 detailsbar">
             <h1><i class="icon-arrow-down"></i></h1>
@@ -6287,6 +6297,168 @@ and the PHPSandbox instance</p>
 
                                     <div class="row-fluid">
         <div class="span8 content class">
+            <a id="method__func_get_args" name="method__func_get_args" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_func_get_args()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_func_get_args(array <span class="argument">$arguments</span>) : array</pre>
+                <p><em>Get PHPSandbox redefined function arguments array</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>array</td>
+                                <td>$arguments</td>
+                                <td><p>Array result from func_get_args() is passed here</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    array
+                                            &mdash; <p>Returns the redefined arguments array</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__func_get_arg" name="method__func_get_arg" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_func_get_arg()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_func_get_arg(array <span class="argument">$arguments</span>, int <span class="argument">$index</span>) : array</pre>
+                <p><em>Get PHPSandbox redefined function argument</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>array</td>
+                                <td>$arguments</td>
+                                <td><p>Array result from func_get_args() is passed here</p>
+</td>
+                            </tr>
+                                                    <tr>
+                                <td>int</td>
+                                <td>$index</td>
+                                <td><p>Requested func_get_arg index is passed here</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    array
+                                            &mdash; <p>Returns the redefined argument</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__func_num_args" name="method__func_num_args" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_func_num_args()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_func_num_args(array <span class="argument">$arguments</span>) : int</pre>
+                <p><em>Get PHPSandbox redefined number of function arguments</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>array</td>
+                                <td>$arguments</td>
+                                <td><p>Array result from func_get_args() is passed here</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    int
+                                            &mdash; <p>Returns the redefined number of function arguments</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__wrap" name="method__wrap" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_wrap()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_wrap(mixed <span class="argument">$value</span>) : mixed|\PHPSandbox\SandboxedString</pre>
+                <p><em>Wrap output value in SandboxString</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to wrap</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    mixed|<a href="../classes/PHPSandbox.SandboxedString.html">\PHPSandbox\SandboxedString</a>
+                                            &mdash; <p>Returns the wrapped value</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
             <a id="method__var_dump" name="method__var_dump" class="anchor"></a>
             <article class="method">
                 <h3 class="public ">_var_dump()</h3>
@@ -6377,29 +6549,29 @@ and the PHPSandbox instance</p>
 
                                     <div class="row-fluid">
         <div class="span8 content class">
-            <a id="method__func_get_args" name="method__func_get_args" class="anchor"></a>
+            <a id="method__intval" name="method__intval" class="anchor"></a>
             <article class="method">
-                <h3 class="public ">_func_get_args()</h3>
+                <h3 class="public ">_intval()</h3>
                 <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
-                <pre class="signature" style="margin-right: 54px;">_func_get_args(array <span class="argument">$arguments</span>) : array</pre>
-                <p><em>Get PHPSandbox redefined function arguments array</em></p>
+                <pre class="signature" style="margin-right: 54px;">_intval(mixed <span class="argument">$value</span>) : int</pre>
+                <p><em>Return integer value of SandboxedString or mixed value</em></p>
                 
 
 
                                     <h4>Parameters</h4>
                     <table class="table table-condensed table-hover">
                                                     <tr>
-                                <td>array</td>
-                                <td>$arguments</td>
-                                <td><p>Array result from func_get_args() is passed here</p>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to return as integer</p>
 </td>
                             </tr>
                                             </table>
                 
                 
                                     <h4>Returns</h4>
-                    array
-                                            &mdash; <p>Returns the redefined arguments array</p>
+                    int
+                                            &mdash; <p>Returns the integer value</p>
 
                                                 </article>
         </div>
@@ -6416,27 +6588,60 @@ and the PHPSandbox instance</p>
 
                                     <div class="row-fluid">
         <div class="span8 content class">
-            <a id="method__func_get_arg" name="method__func_get_arg" class="anchor"></a>
+            <a id="method__floatval" name="method__floatval" class="anchor"></a>
             <article class="method">
-                <h3 class="public ">_func_get_arg()</h3>
+                <h3 class="public ">_floatval()</h3>
                 <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
-                <pre class="signature" style="margin-right: 54px;">_func_get_arg(array <span class="argument">$arguments</span>, int <span class="argument">$index</span>) : array</pre>
-                <p><em>Get PHPSandbox redefined function argument</em></p>
+                <pre class="signature" style="margin-right: 54px;">_floatval(mixed <span class="argument">$value</span>) : float</pre>
+                <p><em>Return float value of SandboxedString or mixed value</em></p>
                 
 
 
                                     <h4>Parameters</h4>
                     <table class="table table-condensed table-hover">
                                                     <tr>
-                                <td>array</td>
-                                <td>$arguments</td>
-                                <td><p>Array result from func_get_args() is passed here</p>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to return as float</p>
 </td>
                             </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    float
+                                            &mdash; <p>Returns the float value</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__arrayval" name="method__arrayval" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_arrayval()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_arrayval(mixed <span class="argument">$value</span>) : array</pre>
+                <p><em>Return array value of SandboxedString or mixed value</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
                                                     <tr>
-                                <td>int</td>
-                                <td>$index</td>
-                                <td><p>Requested func_get_arg index is passed here</p>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to return as array</p>
 </td>
                             </tr>
                                             </table>
@@ -6444,7 +6649,7 @@ and the PHPSandbox instance</p>
                 
                                     <h4>Returns</h4>
                     array
-                                            &mdash; <p>Returns the redefined argument</p>
+                                            &mdash; <p>Returns the array value</p>
 
                                                 </article>
         </div>
@@ -6461,29 +6666,185 @@ and the PHPSandbox instance</p>
 
                                     <div class="row-fluid">
         <div class="span8 content class">
-            <a id="method__func_num_args" name="method__func_num_args" class="anchor"></a>
+            <a id="method__objectval" name="method__objectval" class="anchor"></a>
             <article class="method">
-                <h3 class="public ">_func_num_args()</h3>
+                <h3 class="public ">_objectval()</h3>
                 <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
-                <pre class="signature" style="margin-right: 54px;">_func_num_args(array <span class="argument">$arguments</span>) : int</pre>
-                <p><em>Get PHPSandbox redefined number of function arguments</em></p>
+                <pre class="signature" style="margin-right: 54px;">_objectval(mixed <span class="argument">$value</span>) : object</pre>
+                <p><em>Return object value of SandboxedString or mixed value</em></p>
                 
 
 
                                     <h4>Parameters</h4>
                     <table class="table table-condensed table-hover">
                                                     <tr>
-                                <td>array</td>
-                                <td>$arguments</td>
-                                <td><p>Array result from func_get_args() is passed here</p>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to return as object</p>
 </td>
                             </tr>
                                             </table>
                 
                 
                                     <h4>Returns</h4>
-                    int
-                                            &mdash; <p>Returns the redefined number of function arguments</p>
+                    object
+                                            &mdash; <p>Returns the object value</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__is_string" name="method__is_string" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_is_string()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_is_string(mixed <span class="argument">$value</span>) : bool</pre>
+                <p><em>Return is_string value of SandboxedString or mixed value</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to check if is_string</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    bool
+                                            &mdash; <p>Returns the is_string value</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__is_object" name="method__is_object" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_is_object()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_is_object(mixed <span class="argument">$value</span>) : bool</pre>
+                <p><em>Return is_object value of SandboxedString or mixed value</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to check if is_object</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    bool
+                                            &mdash; <p>Returns the is_object value</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__is_scalar" name="method__is_scalar" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_is_scalar()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_is_scalar(mixed <span class="argument">$value</span>) : bool</pre>
+                <p><em>Return is_scalar value of SandboxedString or mixed value</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to check if is_scalar</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    bool
+                                            &mdash; <p>Returns the is_scalar value</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method__is_callable" name="method__is_callable" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">_is_callable()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">_is_callable(mixed <span class="argument">$value</span>) : bool</pre>
+                <p><em>Return is_callable value of SandboxedString or mixed value</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to check if is_callable</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    bool
+                                            &mdash; <p>Returns the is_callable value</p>
 
                                                 </article>
         </div>
@@ -18938,7 +19299,7 @@ become compromised!</p>
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: PHPSandbox.SandboxWhitelistVisitor.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-174531007"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-872821338"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-174531007" class="accordion-body collapse in">
+            <div id="namespace-872821338" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1263837536"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2118974906"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-1263837536" class="accordion-body collapse ">
+            <div id="namespace-2118974906" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -455,7 +455,7 @@ autmatically whitelist sandboxed code functions, classes, etc. if the appropriat
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: PHPSandbox.SandboxedString.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-298168079"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2041490650"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-298168079" class="accordion-body collapse in">
+            <div id="namespace-2041490650" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-171292534"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2075822163"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-171292534" class="accordion-body collapse ">
+            <div id="namespace-2075822163" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -210,6 +210,11 @@
                                                                     <a href="../classes/PHPSandbox.SandboxedString.html#method___construct" class="">__construct()</a><br />
                                                                     <a href="../classes/PHPSandbox.SandboxedString.html#method___toString" class="">__toString()</a><br />
                                                                     <a href="../classes/PHPSandbox.SandboxedString.html#method___invoke" class="">__invoke()</a><br />
+                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetSet" class="">offsetSet()</a><br />
+                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetGet" class="">offsetGet()</a><br />
+                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetExists" class="">offsetExists()</a><br />
+                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetUnset" class="">offsetUnset()</a><br />
+                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_getIterator" class="">getIterator()</a><br />
                                                             </section>
                             <section class="span4">
                                                                     <em>No public properties found</em>
@@ -456,6 +461,190 @@
         </aside>
     </div>
 
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method_offsetSet" name="method_offsetSet" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">offsetSet()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">offsetSet(mixed <span class="argument">$offset</span>, mixed <span class="argument">$value</span>)</pre>
+                <p><em>Set string value at specified offset</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$offset</td>
+                                <td><p>Offset to set value</p>
+</td>
+                            </tr>
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$value</td>
+                                <td><p>Value to set</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                            </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method_offsetGet" name="method_offsetGet" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">offsetGet()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">offsetGet(mixed <span class="argument">$offset</span>) : string</pre>
+                <p><em>Get string value at specified offset</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$offset</td>
+                                <td><p>Offset to get value</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    string
+                                            &mdash; <p>Value to return</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method_offsetExists" name="method_offsetExists" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">offsetExists()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">offsetExists(mixed <span class="argument">$offset</span>) : bool</pre>
+                <p><em>Check if specified offset exists in string value</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$offset</td>
+                                <td><p>Offset to check</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                                    <h4>Returns</h4>
+                    bool
+                                            &mdash; <p>Return true if offset exists, false otherwise</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method_offsetUnset" name="method_offsetUnset" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">offsetUnset()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">offsetUnset(mixed <span class="argument">$offset</span>)</pre>
+                <p><em>Unset string value at specified offset</em></p>
+                
+
+
+                                    <h4>Parameters</h4>
+                    <table class="table table-condensed table-hover">
+                                                    <tr>
+                                <td>mixed</td>
+                                <td>$offset</td>
+                                <td><p>Offset to unset</p>
+</td>
+                            </tr>
+                                            </table>
+                
+                
+                            </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
+                                    <div class="row-fluid">
+        <div class="span8 content class">
+            <a id="method_getIterator" name="method_getIterator" class="anchor"></a>
+            <article class="method">
+                <h3 class="public ">getIterator()</h3>
+                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
+                <pre class="signature" style="margin-right: 54px;">getIterator() : \ArrayIterator</pre>
+                <p><em>Return iterator for string value</em></p>
+                
+
+
+                
+                
+                                    <h4>Returns</h4>
+                    \ArrayIterator
+                                            &mdash; <p>Array iterator to return</p>
+
+                                                </article>
+        </div>
+        <aside class="span4 detailsbar">
+            <h1><i class="icon-arrow-down"></i></h1>
+                                                            <dl>
+                                                                            </dl>
+            <h2>Tags</h2>
+            <table class="table table-condensed">
+                                    <tr><td colspan="2"><em>None found</em></td></tr>
+                            </table>
+        </aside>
+    </div>
+
                                                                     </div>
     </section>
 
@@ -506,7 +695,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: PHPSandbox.ValidatorVisitor.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-190716146"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-761076047"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-190716146" class="accordion-body collapse in">
+            <div id="namespace-761076047" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1067596443"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1291512294"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-1067596443" class="accordion-body collapse ">
+            <div id="namespace-1291512294" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -556,12 +556,6 @@ configuration for errors, and throws exceptions if they are found</p>
                             </tr>
                                             </table>
                 
-                                    <h4>Throws</h4>
-                    <dl>
-                                                    <dt>\PHPSandbox\Error</dt>
-                            <dd><p>Throws exception if $node attempts to cast when $allow_casting is false in the PHPSandbox configuration</p>
-</dd>
-                                                                    </dl>
                 
                                     <h4>Returns</h4>
                     string|null
@@ -630,7 +624,7 @@ configuration for errors, and throws exceptions if they are found</p>
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: PHPSandbox.WhitelistVisitor.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1971830681"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2090806726"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-1971830681" class="accordion-body collapse in">
+            <div id="namespace-2090806726" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-868130616"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-185668004"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-868130616" class="accordion-body collapse ">
+            <div id="namespace-185668004" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -459,7 +459,7 @@ autmatically whitelist trusted code functions, classes, etc. if the appropriate
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: Error.php.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1697921261"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-174432776"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-1697921261" class="accordion-body collapse in">
+            <div id="namespace-174432776" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-130381843"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-7998099"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-130381843" class="accordion-body collapse ">
+            <div id="namespace-7998099" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -269,7 +269,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: Error.php.txt
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class Error extends \Exception {
         /* START ERROR CODES */

programming_language: PHP
filename: PHPSandbox.php.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-555703967"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-101492745"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-555703967" class="accordion-body collapse in">
+            <div id="namespace-101492745" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2138167363"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-288228325"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-2138167363" class="accordion-body collapse ">
+            <div id="namespace-288228325" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -269,7 +269,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: PHPSandbox.php.txt
change_type: ModificationType.MODIFY
diff: @@ -14,7 +14,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class PHPSandbox {
         /**
@@ -87,14 +87,6 @@
             'get_declared_interfaces',
             'get_declared_traits'
         );
-        /**
-         * @var    array          A static array of var_dump, print_r and var_export for redefining those functions
-         */
-        public static $var_funcs = array(
-            'var_dump',
-            'print_r',
-            'var_export'
-        );
         /**
          * @var    array          A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions
          */
@@ -103,6 +95,21 @@
             'func_get_arg',
             'func_num_args'
         );
+        /**
+         * @var    array          A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object,
+         *                          is_scalar and is_callable for redefining those functions
+         */
+        public static $sandboxed_string_funcs = array(
+            'var_dump',
+            'print_r',
+            'var_export',
+            'intval',
+            'floatval',
+            'is_string',
+            'is_object',
+            'is_scalar',
+            'is_callable'
+        );
         /**
          * @var    string       The randomly generated name of the PHPSandbox variable passed to the generated closure
          */
@@ -253,11 +260,6 @@
          * @default true
          */
         public $overwrite_defined_funcs     = true;
-        /**
-         * @var    bool       Should PHPSandbox overwrite var_dump, print_r, and var_export?
-         * @default true
-         */
-        public $overwrite_var_funcs         = true;
         /**
          * @var    bool       Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?
          * @default true
@@ -267,6 +269,11 @@
          * @var    bool       Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays.
          * @default true
          */
+        public $overwrite_sandboxed_string_funcs         = true;
+        /**
+         * @var    bool       Should PHPSandbox overwrite functions to help hide SandboxedStrings?
+         * @default true
+         */
         public $overwrite_superglobals      = true;
         /**
          * @var    bool       Should PHPSandbox allow sandboxed code to declare functions?
@@ -1920,6 +1927,58 @@
             }
             return array_values($traits);
         }
+        /** Get PHPSandbox redefined function arguments array
+         *
+         * @param   array           $arguments      Array result from func_get_args() is passed here
+         *
+         * @return  array           Returns the redefined arguments array
+         */
+        public function _func_get_args(array $arguments = array()){
+            foreach($arguments as $index => $value){
+                if($value instanceof self){
+                    unset($arguments[$index]); //hide PHPSandbox variable
+                }
+            }
+            return $arguments;
+        }
+        /** Get PHPSandbox redefined function argument
+         *
+         * @param   array           $arguments      Array result from func_get_args() is passed here
+         *
+         * @param   int             $index          Requested func_get_arg index is passed here
+         *
+         * @return  array           Returns the redefined argument
+         */
+        public function _func_get_arg(array $arguments = array(), $index = 0){
+            if($arguments[$index] instanceof self){
+                $index++;   //get next argument instead
+            }
+            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
+        }
+        /** Get PHPSandbox redefined number of function arguments
+         *
+         * @param   array           $arguments      Array result from func_get_args() is passed here
+         *
+         * @return  int             Returns the redefined number of function arguments
+         */
+        public function _func_num_args(array $arguments = array()){
+            $count = count($arguments);
+            foreach($arguments as $argument){
+                if($argument instanceof self){
+                    $count--;
+                }
+            }
+            return $count > 0 ? $count : 0;
+        }
+        /** Wrap output value in SandboxString
+         *
+         * @param   mixed                   $value      Value to wrap
+         *
+         * @return  mixed|SandboxedString   Returns the wrapped value
+         */
+        public function _wrap($value){
+            return is_string($value) ? new SandboxedString($value, $this) : $value;
+        }
         /** Get PHPSandbox redefined var_dump
          *
          * @return  array           Returns the redefined var_dump
@@ -1965,48 +2024,86 @@
             }
             return call_user_func_array('var_export', $arguments);
         }
-        /** Get PHPSandbox redefined function arguments array
+        /** Return integer value of SandboxedString or mixed value
          *
-         * @param   array           $arguments      Array result from func_get_args() is passed here
+         * @param   mixed           $value      Value to return as integer
          *
-         * @return  array           Returns the redefined arguments array
+         * @return  int             Returns the integer value
          */
-        public function _func_get_args(array $arguments = array()){
-            foreach($arguments as $index => $value){
-                if($value instanceof self){
-                    unset($arguments[$index]); //hide PHPSandbox variable
-                }
-            }
-            return $arguments;
+        public function _intval($value){
+            return intval($value instanceof SandboxedString ? strval($value): $value);
         }
-        /** Get PHPSandbox redefined function argument
+        /** Return float value of SandboxedString or mixed value
          *
-         * @param   array           $arguments      Array result from func_get_args() is passed here
+         * @param   mixed           $value      Value to return as float
          *
-         * @param   int             $index          Requested func_get_arg index is passed here
+         * @return  float           Returns the float value
+         */
+        public function _floatval($value){
+            return floatval($value instanceof SandboxedString ? strval($value): $value);
+        }
+        /** Return array value of SandboxedString or mixed value
          *
-         * @return  array           Returns the redefined argument
+         * @param   mixed           $value      Value to return as array
+         *
+         * @return  array           Returns the array value
          */
-        public function _func_get_arg(array $arguments = array(), $index = 0){
-            if($arguments[$index] instanceof self){
-                $index++;   //get next argument instead
+        public function _arrayval($value){
+            if($value instanceof SandboxedString){
+                return (array)strval($value);
             }
-            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
+            return is_array($value) ? $value : (array)$value;
         }
-        /** Get PHPSandbox redefined number of function arguments
+        /** Return object value of SandboxedString or mixed value
          *
-         * @param   array           $arguments      Array result from func_get_args() is passed here
+         * @param   mixed           $value      Value to return as object
          *
-         * @return  int             Returns the redefined number of function arguments
+         * @return  object          Returns the object value
          */
-        public function _func_num_args(array $arguments = array()){
-            $count = count($arguments);
-            foreach($arguments as $argument){
-                if($argument instanceof self){
-                    $count--;
-                }
+        public function _objectval($value){
+            if($value instanceof SandboxedString){
+                return (object)strval($value);
             }
-            return $count > 0 ? $count : 0;
+            return is_object($value) ? $value : (object)$value;
+        }
+        /** Return is_string value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_string
+         *
+         * @return  bool            Returns the is_string value
+         */
+        public function _is_string($value){
+            return ($value instanceof SandboxedString) ? true : is_string($value);
+        }
+        /** Return is_object value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_object
+         *
+         * @return  bool            Returns the is_object value
+         */
+        public function _is_object($value){
+            return ($value instanceof SandboxedString) ? false : is_object($value);
+        }
+        /** Return is_scalar value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_scalar
+         *
+         * @return  bool            Returns the is_scalar value
+         */
+        public function _is_scalar($value){
+            return ($value instanceof SandboxedString) ? true : is_scalar($value);
+        }
+        /** Return is_callable value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_callable
+         *
+         * @return  bool            Returns the is_callable value
+         */
+        public function _is_callable($value){
+            if($value instanceof SandboxedString){
+                $value = strval($value);
+            }
+            return is_callable($value);
         }
         /** Get PHPSandbox redefined function. This is an internal PHPSandbox function but requires public access to work.
          *
@@ -5720,6 +5817,8 @@
                     $this->error("Sandboxed code attempted to call closure!", Error::CLOSURE_ERROR);
                 }
                 return true;
+            } else if($name instanceof SandboxedString){
+                $name = strval($name);
             }
             if(!$name || !is_string($name)){
                 $this->error("Sandboxed code attempted to call unnamed function!", Error::VALID_FUNC_ERROR, null, '');
@@ -5751,6 +5850,9 @@
          */
         public function check_var($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed variable!", Error::VALID_VAR_ERROR, null, '');
             }
@@ -5780,6 +5882,9 @@
          */
         public function check_global($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed global!", Error::VALID_GLOBAL_ERROR, null, '');
             }
@@ -5807,6 +5912,9 @@
          */
         public function check_superglobal($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed superglobal!", Error::VALID_SUPERGLOBAL_ERROR, null, '');
             }
@@ -5837,6 +5945,9 @@
          */
         public function check_const($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed constant!", Error::VALID_CONST_ERROR, null, '');
             }
@@ -5872,6 +5983,9 @@
          */
         public function check_magic_const($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed magic constant!", Error::VALID_MAGIC_CONST_ERROR, null, '');
             }
@@ -5902,6 +6016,9 @@
          */
         public function check_namespace($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed namespace!", Error::VALID_NAMESPACE_ERROR, null, '');
             }
@@ -5932,6 +6049,9 @@
          */
         public function check_alias($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed alias!", Error::VALID_ALIAS_ERROR, null, '');
             }
@@ -5973,6 +6093,9 @@
          */
         public function check_class($name, $extends = false){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             $action = $extends ? 'extend' : 'call';
             if(!$name){
                 $this->error("Sandboxed code attempted to $action unnamed class!", Error::VALID_CLASS_ERROR, null, '');
@@ -6007,6 +6130,9 @@
          */
         public function check_interface($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed interface!", Error::VALID_INTERFACE_ERROR, null, '');
             }
@@ -6037,6 +6163,9 @@
          */
         public function check_trait($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed trait!", Error::VALID_TRAIT_ERROR, null, '');
             }
@@ -6067,6 +6196,9 @@
          */
         public function check_keyword($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed keyword!", Error::VALID_KEYWORD_ERROR, null, '');
             }
@@ -6093,6 +6225,9 @@
          */
         public function check_operator($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed operator!", Error::VALID_OPERATOR_ERROR, null, '');
             }
@@ -6119,6 +6254,9 @@
          */
         public function check_primitive($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed primitive!", Error::VALID_PRIMITIVE_ERROR, null, '');
             }
@@ -6145,6 +6283,9 @@
          */
         public function check_type($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed type!", Error::VALID_TYPE_ERROR, null, '');
             }
@@ -6484,7 +6625,7 @@
                 $this->prepared_code .
                 $this->appended_code .
                 "\r\n" . '};' .
-                "\r\n" . 'if( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION > 3){ $closure = $closure->bindTo(null); }' .
+                "\r\n" . 'if(method_exists($closure, "bindTo")){ $closure = $closure->bindTo(null); }' .
                 "\r\n" . 'return $closure();';
 
             usleep(1); //guarantee at least some time passes

programming_language: PHP
filename: SandboxWhitelistVisitor.php.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-891059786"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2011979904"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-891059786" class="accordion-body collapse in">
+            <div id="namespace-2011979904" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-337296115"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1143894290"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-337296115" class="accordion-body collapse ">
+            <div id="namespace-1143894290" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -269,7 +269,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: SandboxWhitelistVisitor.php.txt
change_type: ModificationType.MODIFY
diff: @@ -13,7 +13,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class SandboxWhitelistVisitor extends \PHPParser_NodeVisitorAbstract {
         /** The PHPSandbox instance to check against

programming_language: PHP
filename: SandboxedString.php.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1040308460"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1701606012"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-1040308460" class="accordion-body collapse in">
+            <div id="namespace-1701606012" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-418048951"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1646168305"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-418048951" class="accordion-body collapse ">
+            <div id="namespace-1646168305" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -269,7 +269,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: SandboxedString.php.txt
change_type: ModificationType.MODIFY
diff: @@ -11,9 +11,9 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
-    class SandboxedString {
+    class SandboxedString implements \ArrayAccess, \IteratorAggregate {
         /**
          * @var string
          */
@@ -23,8 +23,8 @@
          */
         private $sandbox;
         /** Constructs the SandboxedString
-         * @param   string      $value      Original string value
-         * @param   PHPSandbox  $sandbox    The current sandbox instance to test against
+         * @param   string      $value          Original string value
+         * @param   PHPSandbox  $sandbox        The current sandbox instance to test against
          */
         public function __construct($value, PHPSandbox $sandbox){
             $this->value = $value;
@@ -43,12 +43,51 @@
             if($this->sandbox->check_func($this->value)){
                 $name = strtolower($this->value);
                 if((in_array($name, PHPSandbox::$defined_funcs) && $this->sandbox->overwrite_defined_funcs)
-                    || (in_array($name, PHPSandbox::$var_funcs) && $this->sandbox->overwrite_var_funcs)
+                    || (in_array($name, PHPSandbox::$sandboxed_string_funcs) && $this->sandbox->overwrite_sandboxed_string_funcs)
                     || (in_array($name, PHPSandbox::$arg_funcs) && $this->sandbox->overwrite_func_get_args)){
                     return call_user_func_array(array($this->sandbox, '_' . $this->value), func_get_args());
                 }
                 return call_user_func_array($name, func_get_args());
             }
-            return null;
+            return '';
+        }
+        /** Set string value at specified offset
+         * @param   mixed       $offset            Offset to set value
+         * @param   mixed       $value             Value to set
+         */
+        public function offsetSet($offset, $value){
+            if($offset === null){
+                $this->value .= $value;
+            } else {
+                $this->value[$offset] = $value;
+            }
+        }
+        /** Get string value at specified offset
+         * @param   mixed       $offset            Offset to get value
+         *
+         * @return  string      Value to return
+         */
+        public function offsetGet($offset){
+            return $this->value[$offset];
+        }
+        /** Check if specified offset exists in string value
+         * @param   mixed       $offset            Offset to check
+         *
+         * @return  bool        Return true if offset exists, false otherwise
+         */
+        public function offsetExists($offset){
+            return isset($this->value[$offset]);
+        }
+        /** Unset string value at specified offset
+         * @param   mixed       $offset            Offset to unset
+         */
+        public function offsetUnset($offset){
+            unset($this->value[$offset]);
+        }
+        /** Return iterator for string value
+         * @return  \ArrayIterator      Array iterator to return
+         */
+        public function getIterator(){
+            return new \ArrayIterator(str_split(strval($this->value)));
         }
     }

programming_language: PHP
filename: ValidatorVisitor.php.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-907988671"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-999918227"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-907988671" class="accordion-body collapse in">
+            <div id="namespace-999918227" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-194642397"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-226640883"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-194642397" class="accordion-body collapse ">
+            <div id="namespace-226640883" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -269,7 +269,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: ValidatorVisitor.php.txt
change_type: ModificationType.MODIFY
diff: @@ -13,7 +13,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class ValidatorVisitor extends \PHPParser_NodeVisitorAbstract {
         /** The PHPSandbox instance to check against
@@ -42,10 +42,21 @@
                 if(!$this->sandbox->allow_escaping){
                     $this->sandbox->error("Sandboxed code attempted to escape to HTML!", Error::ESCAPE_ERROR, $node);
                 }
+            } else if($node instanceof \PHPParser_Node_Expr_Cast_String){
+                return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node->expr), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
             } else if($node instanceof \PHPParser_Node_Expr_Cast){
                 if(!$this->sandbox->allow_casting){
                     $this->sandbox->error("Sandboxed code attempted to cast!", Error::CAST_ERROR, $node);
                 }
+                if($node instanceof \PHPParser_Node_Expr_Cast_Int){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_intval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                } else if($node instanceof \PHPParser_Node_Expr_Cast_Double){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_floatval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                } else if($node instanceof \PHPParser_Node_Expr_Cast_Array){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_arrayval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                } else if($node instanceof \PHPParser_Node_Expr_Cast_Object){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_objectval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                }
             } else if($node instanceof \PHPParser_Node_Expr_FuncCall){
                 if($node->name instanceof \PHPParser_Node_Name){
                     $name = strtolower($node->name->toString());
@@ -60,7 +71,7 @@
                     if($this->sandbox->overwrite_defined_funcs && in_array($name, PHPSandbox::$defined_funcs)){
                         return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_' . $name, array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_FuncCall(new \PHPParser_Node_Name(array($name))))), $node->getAttributes());
                     }
-                    if($this->sandbox->overwrite_var_funcs && in_array($name, PHPSandbox::$var_funcs)){
+                    if($this->sandbox->overwrite_sandboxed_string_funcs && in_array($name, PHPSandbox::$sandboxed_string_funcs)){
                         $args = $node->args;
                         return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_' . $name, $args, $node->getAttributes());
                     }
@@ -74,6 +85,7 @@
                         }
                         return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_' . $name, array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_FuncCall(new \PHPParser_Node_Name(array('func_get_args'))))), $node->getAttributes());
                     }
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_wrap', array(new \PHPParser_Node_Arg($node)), $node->getAttributes());
                 } else {
                     return new \PHPParser_Node_Expr_Ternary(
                         new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), 'check_func', array(new \PHPParser_Node_Arg($node->name)), $node->getAttributes()),
@@ -371,6 +383,11 @@
                 if(!$this->sandbox->check_operator($name)){
                     $this->sandbox->error("Operator failed custom validation!", Error::VALID_OPERATOR_ERROR, $node, $name);
                 }
+                if($node instanceof \PHPParser_Node_Expr_Concat){
+                    return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
+                } else if($node instanceof \PHPParser_Node_Expr_AssignConcat){
+                    return new \PHPParser_Node_Expr_Assign($node->var, new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_Concat($node->var, $node->expr)), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name)))))));
+                }
             } else if($name = $this->is_primitive($node)){
                 if(!$this->sandbox->check_primitive($name)){
                     $this->sandbox->error("Primitive failed custom validation!", Error::VALID_PRIMITIVE_ERROR, $node, $name);
@@ -580,24 +597,9 @@
          *
          * @param   \PHPParser_Node   $node          The sandboxed $node to test
          *
-         * @throws  Error             Throws exception if $node attempts to cast when $allow_casting is false in the PHPSandbox configuration
-         *
          * @return  string|null       Return string name of node, or null if it is not a primitive
          */
         protected function is_primitive(\PHPParser_Node $node){
-            switch($node->getType()){
-                case 'Expr_Cast_Array':
-                case 'Expr_Cast_Bool':
-                case 'Expr_Cast_Double':
-                case 'Expr_Cast_Int':
-                case 'Expr_Cast_String':
-                case 'Expr_Cast_Object':
-                case 'Expr_Cast_Unset':
-                    if(!$this->sandbox->allow_casting){
-                        $this->sandbox->error("Sandboxed code attempted to cast!", Error::CAST_ERROR, $node);
-                    }
-                    break;
-            }
             switch($node->getType()){
                 case 'Expr_Cast_Array':
                 case 'Expr_Array':

programming_language: PHP
filename: WhitelistVisitor.php.html
change_type: ModificationType.MODIFY
diff: @@ -139,19 +139,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-854772276"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1453035608"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-854772276" class="accordion-body collapse in">
+            <div id="namespace-1453035608" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1662890078"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-91137763"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-1662890078" class="accordion-body collapse ">
+            <div id="namespace-91137763" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -269,7 +269,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: WhitelistVisitor.php.txt
change_type: ModificationType.MODIFY
diff: @@ -13,7 +13,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class WhitelistVisitor extends \PHPParser_NodeVisitorAbstract {
         /** The PHPSandbox instance to check against

programming_language: PHP
filename: class.html
change_type: ModificationType.MODIFY
diff: @@ -156,7 +156,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: index.html
change_type: ModificationType.MODIFY
diff: @@ -91,19 +91,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1624839564"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-751769504"></a>
                                 <a href="namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-1624839564" class="accordion-body collapse in">
+            <div id="namespace-751769504" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1810365709"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1827995365"></a>
                                 <a href="namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-1810365709" class="accordion-body collapse ">
+            <div id="namespace-1827995365" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -202,7 +202,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: PHPSandbox.html
change_type: ModificationType.MODIFY
diff: @@ -91,19 +91,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-25397207"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2043401959"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-25397207" class="accordion-body collapse in">
+            <div id="namespace-2043401959" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-134930522"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-158188391"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-134930522" class="accordion-body collapse ">
+            <div id="namespace-158188391" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -225,7 +225,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: default.html
change_type: ModificationType.MODIFY
diff: @@ -91,19 +91,19 @@
                                 <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-170220695"></a>
+                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2146406286"></a>
                                 <a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
             </div>
-            <div id="namespace-170220695" class="accordion-body collapse in">
+            <div id="namespace-2146406286" class="accordion-body collapse in">
                 <div class="accordion-inner">
 
                                                     <div class="accordion" style="margin-bottom: 0">
         <div class="accordion-group">
             <div class="accordion-heading">
-                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1814876905"></a>
+                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-44708510"></a>
                                 <a href="../namespaces/PHPSandbox.html" style="margin-left: 30px; padding-left: 0">PHPSandbox</a>
             </div>
-            <div id="namespace-1814876905" class="accordion-body collapse ">
+            <div id="namespace-44708510" class="accordion-body collapse ">
                 <div class="accordion-inner">
 
                     
@@ -202,7 +202,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: deprecated.html
change_type: ModificationType.MODIFY
diff: @@ -143,7 +143,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: errors.html
change_type: ModificationType.MODIFY
diff: @@ -110,7 +110,7 @@
                         <h3>
                             <i class="icon-file"></i>
                             PHPSandbox.php
-                            <small style="float: right;padding-right: 10px;">1</small>
+                            <small style="float: right;padding-right: 10px;">2</small>
                         </h3>
                         <div>
                             <table class="table markers table-bordered">
@@ -124,7 +124,12 @@
                                 <tbody>
                                                                     <tr>
                                         <td>error</td>
-                                        <td>6607</td>
+                                        <td>6748</td>
+                                        <td>Argument $name is missing from the Docblock of getSandbox()</td>
+                                    </tr>
+                                                                    <tr>
+                                        <td>error</td>
+                                        <td>6748</td>
                                         <td>No summary for method getSandbox()</td>
                                     </tr>
                                                             </tbody>
@@ -208,7 +213,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: markers.html
change_type: ModificationType.MODIFY
diff: @@ -144,7 +144,7 @@
                 <section class="span10 offset1">
                     <hr />
                     Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
-                    on March 5th, 2014 at 04:43.
+                    on March 10th, 2014 at 20:56.
                 </section>
             </section>
         </section>

programming_language: HTML
filename: Error.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class Error extends \Exception {
         /* START ERROR CODES */

programming_language: PHP
filename: PHPSandbox.php
change_type: ModificationType.MODIFY
diff: @@ -14,7 +14,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class PHPSandbox {
         /**
@@ -87,14 +87,6 @@
             'get_declared_interfaces',
             'get_declared_traits'
         );
-        /**
-         * @var    array          A static array of var_dump, print_r and var_export for redefining those functions
-         */
-        public static $var_funcs = array(
-            'var_dump',
-            'print_r',
-            'var_export'
-        );
         /**
          * @var    array          A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions
          */
@@ -103,6 +95,21 @@
             'func_get_arg',
             'func_num_args'
         );
+        /**
+         * @var    array          A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object,
+         *                          is_scalar and is_callable for redefining those functions
+         */
+        public static $sandboxed_string_funcs = array(
+            'var_dump',
+            'print_r',
+            'var_export',
+            'intval',
+            'floatval',
+            'is_string',
+            'is_object',
+            'is_scalar',
+            'is_callable'
+        );
         /**
          * @var    string       The randomly generated name of the PHPSandbox variable passed to the generated closure
          */
@@ -253,11 +260,6 @@
          * @default true
          */
         public $overwrite_defined_funcs     = true;
-        /**
-         * @var    bool       Should PHPSandbox overwrite var_dump, print_r, and var_export?
-         * @default true
-         */
-        public $overwrite_var_funcs         = true;
         /**
          * @var    bool       Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?
          * @default true
@@ -267,6 +269,11 @@
          * @var    bool       Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays.
          * @default true
          */
+        public $overwrite_sandboxed_string_funcs         = true;
+        /**
+         * @var    bool       Should PHPSandbox overwrite functions to help hide SandboxedStrings?
+         * @default true
+         */
         public $overwrite_superglobals      = true;
         /**
          * @var    bool       Should PHPSandbox allow sandboxed code to declare functions?
@@ -1920,6 +1927,58 @@
             }
             return array_values($traits);
         }
+        /** Get PHPSandbox redefined function arguments array
+         *
+         * @param   array           $arguments      Array result from func_get_args() is passed here
+         *
+         * @return  array           Returns the redefined arguments array
+         */
+        public function _func_get_args(array $arguments = array()){
+            foreach($arguments as $index => $value){
+                if($value instanceof self){
+                    unset($arguments[$index]); //hide PHPSandbox variable
+                }
+            }
+            return $arguments;
+        }
+        /** Get PHPSandbox redefined function argument
+         *
+         * @param   array           $arguments      Array result from func_get_args() is passed here
+         *
+         * @param   int             $index          Requested func_get_arg index is passed here
+         *
+         * @return  array           Returns the redefined argument
+         */
+        public function _func_get_arg(array $arguments = array(), $index = 0){
+            if($arguments[$index] instanceof self){
+                $index++;   //get next argument instead
+            }
+            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
+        }
+        /** Get PHPSandbox redefined number of function arguments
+         *
+         * @param   array           $arguments      Array result from func_get_args() is passed here
+         *
+         * @return  int             Returns the redefined number of function arguments
+         */
+        public function _func_num_args(array $arguments = array()){
+            $count = count($arguments);
+            foreach($arguments as $argument){
+                if($argument instanceof self){
+                    $count--;
+                }
+            }
+            return $count > 0 ? $count : 0;
+        }
+        /** Wrap output value in SandboxString
+         *
+         * @param   mixed                   $value      Value to wrap
+         *
+         * @return  mixed|SandboxedString   Returns the wrapped value
+         */
+        public function _wrap($value){
+            return is_string($value) ? new SandboxedString($value, $this) : $value;
+        }
         /** Get PHPSandbox redefined var_dump
          *
          * @return  array           Returns the redefined var_dump
@@ -1965,48 +2024,86 @@
             }
             return call_user_func_array('var_export', $arguments);
         }
-        /** Get PHPSandbox redefined function arguments array
+        /** Return integer value of SandboxedString or mixed value
          *
-         * @param   array           $arguments      Array result from func_get_args() is passed here
+         * @param   mixed           $value      Value to return as integer
          *
-         * @return  array           Returns the redefined arguments array
+         * @return  int             Returns the integer value
          */
-        public function _func_get_args(array $arguments = array()){
-            foreach($arguments as $index => $value){
-                if($value instanceof self){
-                    unset($arguments[$index]); //hide PHPSandbox variable
-                }
-            }
-            return $arguments;
+        public function _intval($value){
+            return intval($value instanceof SandboxedString ? strval($value): $value);
         }
-        /** Get PHPSandbox redefined function argument
+        /** Return float value of SandboxedString or mixed value
          *
-         * @param   array           $arguments      Array result from func_get_args() is passed here
+         * @param   mixed           $value      Value to return as float
          *
-         * @param   int             $index          Requested func_get_arg index is passed here
+         * @return  float           Returns the float value
+         */
+        public function _floatval($value){
+            return floatval($value instanceof SandboxedString ? strval($value): $value);
+        }
+        /** Return array value of SandboxedString or mixed value
          *
-         * @return  array           Returns the redefined argument
+         * @param   mixed           $value      Value to return as array
+         *
+         * @return  array           Returns the array value
          */
-        public function _func_get_arg(array $arguments = array(), $index = 0){
-            if($arguments[$index] instanceof self){
-                $index++;   //get next argument instead
+        public function _arrayval($value){
+            if($value instanceof SandboxedString){
+                return (array)strval($value);
             }
-            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
+            return is_array($value) ? $value : (array)$value;
         }
-        /** Get PHPSandbox redefined number of function arguments
+        /** Return object value of SandboxedString or mixed value
          *
-         * @param   array           $arguments      Array result from func_get_args() is passed here
+         * @param   mixed           $value      Value to return as object
          *
-         * @return  int             Returns the redefined number of function arguments
+         * @return  object          Returns the object value
          */
-        public function _func_num_args(array $arguments = array()){
-            $count = count($arguments);
-            foreach($arguments as $argument){
-                if($argument instanceof self){
-                    $count--;
-                }
+        public function _objectval($value){
+            if($value instanceof SandboxedString){
+                return (object)strval($value);
             }
-            return $count > 0 ? $count : 0;
+            return is_object($value) ? $value : (object)$value;
+        }
+        /** Return is_string value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_string
+         *
+         * @return  bool            Returns the is_string value
+         */
+        public function _is_string($value){
+            return ($value instanceof SandboxedString) ? true : is_string($value);
+        }
+        /** Return is_object value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_object
+         *
+         * @return  bool            Returns the is_object value
+         */
+        public function _is_object($value){
+            return ($value instanceof SandboxedString) ? false : is_object($value);
+        }
+        /** Return is_scalar value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_scalar
+         *
+         * @return  bool            Returns the is_scalar value
+         */
+        public function _is_scalar($value){
+            return ($value instanceof SandboxedString) ? true : is_scalar($value);
+        }
+        /** Return is_callable value of SandboxedString or mixed value
+         *
+         * @param   mixed           $value      Value to check if is_callable
+         *
+         * @return  bool            Returns the is_callable value
+         */
+        public function _is_callable($value){
+            if($value instanceof SandboxedString){
+                $value = strval($value);
+            }
+            return is_callable($value);
         }
         /** Get PHPSandbox redefined function. This is an internal PHPSandbox function but requires public access to work.
          *
@@ -5720,6 +5817,8 @@
                     $this->error("Sandboxed code attempted to call closure!", Error::CLOSURE_ERROR);
                 }
                 return true;
+            } else if($name instanceof SandboxedString){
+                $name = strval($name);
             }
             if(!$name || !is_string($name)){
                 $this->error("Sandboxed code attempted to call unnamed function!", Error::VALID_FUNC_ERROR, null, '');
@@ -5751,6 +5850,9 @@
          */
         public function check_var($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed variable!", Error::VALID_VAR_ERROR, null, '');
             }
@@ -5780,6 +5882,9 @@
          */
         public function check_global($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed global!", Error::VALID_GLOBAL_ERROR, null, '');
             }
@@ -5807,6 +5912,9 @@
          */
         public function check_superglobal($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed superglobal!", Error::VALID_SUPERGLOBAL_ERROR, null, '');
             }
@@ -5837,6 +5945,9 @@
          */
         public function check_const($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed constant!", Error::VALID_CONST_ERROR, null, '');
             }
@@ -5872,6 +5983,9 @@
          */
         public function check_magic_const($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed magic constant!", Error::VALID_MAGIC_CONST_ERROR, null, '');
             }
@@ -5902,6 +6016,9 @@
          */
         public function check_namespace($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed namespace!", Error::VALID_NAMESPACE_ERROR, null, '');
             }
@@ -5932,6 +6049,9 @@
          */
         public function check_alias($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed alias!", Error::VALID_ALIAS_ERROR, null, '');
             }
@@ -5973,6 +6093,9 @@
          */
         public function check_class($name, $extends = false){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             $action = $extends ? 'extend' : 'call';
             if(!$name){
                 $this->error("Sandboxed code attempted to $action unnamed class!", Error::VALID_CLASS_ERROR, null, '');
@@ -6007,6 +6130,9 @@
          */
         public function check_interface($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed interface!", Error::VALID_INTERFACE_ERROR, null, '');
             }
@@ -6037,6 +6163,9 @@
          */
         public function check_trait($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed trait!", Error::VALID_TRAIT_ERROR, null, '');
             }
@@ -6067,6 +6196,9 @@
          */
         public function check_keyword($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed keyword!", Error::VALID_KEYWORD_ERROR, null, '');
             }
@@ -6093,6 +6225,9 @@
          */
         public function check_operator($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed operator!", Error::VALID_OPERATOR_ERROR, null, '');
             }
@@ -6119,6 +6254,9 @@
          */
         public function check_primitive($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed primitive!", Error::VALID_PRIMITIVE_ERROR, null, '');
             }
@@ -6145,6 +6283,9 @@
          */
         public function check_type($name){
             $original_name = $name;
+            if($name instanceof SandboxedString){
+                $name = strval($name);
+            }
             if(!$name){
                 $this->error("Sandboxed code attempted to call unnamed type!", Error::VALID_TYPE_ERROR, null, '');
             }
@@ -6484,7 +6625,7 @@
                 $this->prepared_code .
                 $this->appended_code .
                 "\r\n" . '};' .
-                "\r\n" . 'if( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION > 3){ $closure = $closure->bindTo(null); }' .
+                "\r\n" . 'if(method_exists($closure, "bindTo")){ $closure = $closure->bindTo(null); }' .
                 "\r\n" . 'return $closure();';
 
             usleep(1); //guarantee at least some time passes

programming_language: PHP
filename: SandboxWhitelistVisitor.php
change_type: ModificationType.MODIFY
diff: @@ -13,7 +13,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class SandboxWhitelistVisitor extends \PHPParser_NodeVisitorAbstract {
         /** The PHPSandbox instance to check against

programming_language: PHP
filename: SandboxedString.php
change_type: ModificationType.MODIFY
diff: @@ -11,9 +11,9 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
-    class SandboxedString {
+    class SandboxedString implements \ArrayAccess, \IteratorAggregate {
         /**
          * @var string
          */
@@ -23,8 +23,8 @@
          */
         private $sandbox;
         /** Constructs the SandboxedString
-         * @param   string      $value      Original string value
-         * @param   PHPSandbox  $sandbox    The current sandbox instance to test against
+         * @param   string      $value          Original string value
+         * @param   PHPSandbox  $sandbox        The current sandbox instance to test against
          */
         public function __construct($value, PHPSandbox $sandbox){
             $this->value = $value;
@@ -43,12 +43,51 @@
             if($this->sandbox->check_func($this->value)){
                 $name = strtolower($this->value);
                 if((in_array($name, PHPSandbox::$defined_funcs) && $this->sandbox->overwrite_defined_funcs)
-                    || (in_array($name, PHPSandbox::$var_funcs) && $this->sandbox->overwrite_var_funcs)
+                    || (in_array($name, PHPSandbox::$sandboxed_string_funcs) && $this->sandbox->overwrite_sandboxed_string_funcs)
                     || (in_array($name, PHPSandbox::$arg_funcs) && $this->sandbox->overwrite_func_get_args)){
                     return call_user_func_array(array($this->sandbox, '_' . $this->value), func_get_args());
                 }
                 return call_user_func_array($name, func_get_args());
             }
-            return null;
+            return '';
+        }
+        /** Set string value at specified offset
+         * @param   mixed       $offset            Offset to set value
+         * @param   mixed       $value             Value to set
+         */
+        public function offsetSet($offset, $value){
+            if($offset === null){
+                $this->value .= $value;
+            } else {
+                $this->value[$offset] = $value;
+            }
+        }
+        /** Get string value at specified offset
+         * @param   mixed       $offset            Offset to get value
+         *
+         * @return  string      Value to return
+         */
+        public function offsetGet($offset){
+            return $this->value[$offset];
+        }
+        /** Check if specified offset exists in string value
+         * @param   mixed       $offset            Offset to check
+         *
+         * @return  bool        Return true if offset exists, false otherwise
+         */
+        public function offsetExists($offset){
+            return isset($this->value[$offset]);
+        }
+        /** Unset string value at specified offset
+         * @param   mixed       $offset            Offset to unset
+         */
+        public function offsetUnset($offset){
+            unset($this->value[$offset]);
+        }
+        /** Return iterator for string value
+         * @return  \ArrayIterator      Array iterator to return
+         */
+        public function getIterator(){
+            return new \ArrayIterator(str_split(strval($this->value)));
         }
     }
\ No newline at end of file

programming_language: PHP
filename: ValidatorVisitor.php
change_type: ModificationType.MODIFY
diff: @@ -13,7 +13,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class ValidatorVisitor extends \PHPParser_NodeVisitorAbstract {
         /** The PHPSandbox instance to check against
@@ -42,10 +42,21 @@
                 if(!$this->sandbox->allow_escaping){
                     $this->sandbox->error("Sandboxed code attempted to escape to HTML!", Error::ESCAPE_ERROR, $node);
                 }
+            } else if($node instanceof \PHPParser_Node_Expr_Cast_String){
+                return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node->expr), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
             } else if($node instanceof \PHPParser_Node_Expr_Cast){
                 if(!$this->sandbox->allow_casting){
                     $this->sandbox->error("Sandboxed code attempted to cast!", Error::CAST_ERROR, $node);
                 }
+                if($node instanceof \PHPParser_Node_Expr_Cast_Int){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_intval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                } else if($node instanceof \PHPParser_Node_Expr_Cast_Double){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_floatval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                } else if($node instanceof \PHPParser_Node_Expr_Cast_Array){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_arrayval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                } else if($node instanceof \PHPParser_Node_Expr_Cast_Object){
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_objectval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
+                }
             } else if($node instanceof \PHPParser_Node_Expr_FuncCall){
                 if($node->name instanceof \PHPParser_Node_Name){
                     $name = strtolower($node->name->toString());
@@ -60,7 +71,7 @@
                     if($this->sandbox->overwrite_defined_funcs && in_array($name, PHPSandbox::$defined_funcs)){
                         return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_' . $name, array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_FuncCall(new \PHPParser_Node_Name(array($name))))), $node->getAttributes());
                     }
-                    if($this->sandbox->overwrite_var_funcs && in_array($name, PHPSandbox::$var_funcs)){
+                    if($this->sandbox->overwrite_sandboxed_string_funcs && in_array($name, PHPSandbox::$sandboxed_string_funcs)){
                         $args = $node->args;
                         return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_' . $name, $args, $node->getAttributes());
                     }
@@ -74,6 +85,7 @@
                         }
                         return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_' . $name, array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_FuncCall(new \PHPParser_Node_Name(array('func_get_args'))))), $node->getAttributes());
                     }
+                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_wrap', array(new \PHPParser_Node_Arg($node)), $node->getAttributes());
                 } else {
                     return new \PHPParser_Node_Expr_Ternary(
                         new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), 'check_func', array(new \PHPParser_Node_Arg($node->name)), $node->getAttributes()),
@@ -371,6 +383,11 @@
                 if(!$this->sandbox->check_operator($name)){
                     $this->sandbox->error("Operator failed custom validation!", Error::VALID_OPERATOR_ERROR, $node, $name);
                 }
+                if($node instanceof \PHPParser_Node_Expr_Concat){
+                    return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
+                } else if($node instanceof \PHPParser_Node_Expr_AssignConcat){
+                    return new \PHPParser_Node_Expr_Assign($node->var, new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_Concat($node->var, $node->expr)), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name)))))));
+                }
             } else if($name = $this->is_primitive($node)){
                 if(!$this->sandbox->check_primitive($name)){
                     $this->sandbox->error("Primitive failed custom validation!", Error::VALID_PRIMITIVE_ERROR, $node, $name);
@@ -580,24 +597,9 @@
          *
          * @param   \PHPParser_Node   $node          The sandboxed $node to test
          *
-         * @throws  Error             Throws exception if $node attempts to cast when $allow_casting is false in the PHPSandbox configuration
-         *
          * @return  string|null       Return string name of node, or null if it is not a primitive
          */
         protected function is_primitive(\PHPParser_Node $node){
-            switch($node->getType()){
-                case 'Expr_Cast_Array':
-                case 'Expr_Cast_Bool':
-                case 'Expr_Cast_Double':
-                case 'Expr_Cast_Int':
-                case 'Expr_Cast_String':
-                case 'Expr_Cast_Object':
-                case 'Expr_Cast_Unset':
-                    if(!$this->sandbox->allow_casting){
-                        $this->sandbox->error("Sandboxed code attempted to cast!", Error::CAST_ERROR, $node);
-                    }
-                    break;
-            }
             switch($node->getType()){
                 case 'Expr_Cast_Array':
                 case 'Expr_Array':

programming_language: PHP
filename: WhitelistVisitor.php
change_type: ModificationType.MODIFY
diff: @@ -13,7 +13,7 @@
      * @namespace PHPSandbox
      *
      * @author  Elijah Horton <fieryprophet@yahoo.com>
-     * @version 1.3.2
+     * @version 1.3.3
      */
     class WhitelistVisitor extends \PHPParser_NodeVisitorAbstract {
         /** The PHPSandbox instance to check against

programming_language: PHP
filename: DefaultConfigTest.php
change_type: ModificationType.MODIFY
diff: @@ -310,4 +310,34 @@
             $this->setExpectedException('PHPSandbox\Error');
             $this->sandbox->execute(function(){ array_filter(array("1"), "var_dump"); });
         }
+
+        /**
+         * Test whether sandbox disallows violating callbacks even with manipulated sandboxed strings
+         */
+        public function testCallbackViolationsWithStringManipulation(){
+            $this->setExpectedException('PHPSandbox\Error');
+            $this->sandbox->execute(function(){ $x = substr("var_dump2", 0, -1); array_filter(array("1"), $x); });
+        }
+
+        /**
+         * Test whether sandboxed strings do not cause conflicts with intval
+         */
+        public function testSandboxedStringsSatisfyIntval(){
+            $this->sandbox->whitelist_func('intval');
+            $this->assertEquals(1, $this->sandbox->execute(function(){ return intval("1"); }));
+        }
+
+        /**
+         * Test whether sandboxed strings do not cause conflicts with is_string, is_object, or is_scalar
+         */
+        public function testSandboxedStringsMimicStrings(){
+            $this->sandbox->whitelist_func(array(
+                'is_string',
+                'is_object',
+                'is_scalar'
+            ));
+            $this->assertEquals(true, $this->sandbox->execute(function(){ return is_string("1"); }));
+            $this->assertEquals(false, $this->sandbox->execute(function(){ return is_object("1"); }));
+            $this->assertEquals(true, $this->sandbox->execute(function(){ return is_scalar("1"); }));
+        }
     }
\ No newline at end of file

programming_language: PHP
filename: index.php
change_type: ModificationType.MODIFY
diff: @@ -119,7 +119,7 @@
             'blacklist' => $blacklist,
             'definitions' => $definitions
         ));
-        $sandbox->set_error_handler(function(\PHPSandbox\Error $e){ echo '<h2 style="color: red;">' . $e->getMessage() . '</h2>'; });
+        $sandbox->set_error_handler(function(\PHPSandbox\Error $e){ die('<h2 style="color: red;">' . $e->getMessage() . '</h2>'); });
         try {
             ob_start();
             if($setup_code){
@@ -137,7 +137,7 @@
             ob_end_clean();
             die('<pre>' . $buffer . '</pre>');
         } catch(\PHPSandbox\Error $e){
-            echo '<h2 style="color: red;">' . $e->getMessage() . '</h2>';
+            die('<h2 style="color: red;">' . $e->getMessage() . '</h2>');
         }
     }
 
@@ -313,6 +313,7 @@
             <a href="javascript:;" class="help">Help</a>
         </strong>
     </p>
+    <div align="center" style="font-size: 8px; font-weight: bold;">&copy; Copyright 2013 - <?php echo date("Y"); ?> Elijah Horton. - Some Rights Reserved.<br/>See <a href="../LICENSE" target="_blank">LICENSE</a> for details.</div>
     <hr class="hr"/>
     <h3 style="margin: 0;">Choose Template:</h3>
     <br/>
@@ -558,6 +559,7 @@
     <br/>
     <br/>
     <input type="button" value="Run Code In Sandbox" id="run" style="width: 100%;"/>
+    <br/>
 </div>
 <div id="output_container">
     <h2>Output</h2>

programming_language: PHP
filename: 002 - Evil Function.json
change_type: ModificationType.MODIFY
diff: @@ -1 +1 @@
-{"code":"\/*\n    This template demonstrates how an eval is blocked\n    if the eval function is not allowed\n*\/\n\neval('echo \"This should not work if eval is disallowed.\"');","options":{"allow_variables":"0"},"blacklist":null,"whitelist":null}
\ No newline at end of file
+{"code":"\/*\n    This template demonstrates how an eval is blocked\n    if the eval function is not allowed\n*\/\n\neval('echo \"This should not work if eval is disallowed.\";');","options":{"allow_variables":"0"},"blacklist":null,"whitelist":null}
\ No newline at end of file

programming_language: SQL