Skip to content

Commit

Permalink
- Fixed bug xdebug#684: xdebug_var_dump - IE does not support &.
Browse files Browse the repository at this point in the history
SVN Rev: 3439
  • Loading branch information
derickr committed May 2, 2011
1 parent aca6222 commit 622c5ff
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/bug00421.phpt
Expand Up @@ -42,7 +42,7 @@ dbgpRun( str_replace( 'FILE', "\"$file\"", $data ), $commands );

-> context_get -i 5 -c 0
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="5" context="0"><property name="currentPageXML" fullname="$currentPageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$currentPageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$currentPageXML-&gt;@attributes[&apos;name&apos;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$currentPageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$currentPageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property><property name="1" fullname="$currentPageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property></property></property><property name="iterator" fullname="$iterator" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="page" fullname="$iterator-&gt;page" facet="public" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$iterator-&gt;page-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$iterator-&gt;page-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property></property><property name="name" fullname="$name" type="uninitialized"></property><property name="pageXML" fullname="$pageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$pageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$pageXML-&gt;@attributes[&apos;name&apos;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$pageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$pageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property><property name="1" fullname="$pageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property></property></property><property name="projectsIterator" fullname="$projectsIterator" address="" type="array" children="1" numchildren="3" page="0" pagesize="32"><property name="0" fullname="$projectsIterator[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[0]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$projectsIterator[0]-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property><property name="1" fullname="$projectsIterator[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[1]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property><property name="2" fullname="$projectsIterator[2]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[2]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property></property><property name="siteXMLString" fullname="$siteXMLString" address="" type="string" size="161" encoding="base64"><![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHNpdGU+CiAgICA8cGFnZSBuYW1lPSJwcm9qZWN0cyI+CiAgICAgICAgPHBhZ2UgbmFtZT0iUHJvamVjdCAxIiAvPgogICAgICAgIDxwYWdlIG5hbWU9IlByb2plY3QgMiIgLz4KICAgIDwvcGFnZT4KPC9zaXRlPgo=]]></property></response>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="5" context="0"><property name="currentPageXML" fullname="$currentPageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$currentPageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$currentPageXML-&gt;@attributes[&#39;name&#39;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$currentPageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$currentPageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property><property name="1" fullname="$currentPageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property></property></property><property name="iterator" fullname="$iterator" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="page" fullname="$iterator-&gt;page" facet="public" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$iterator-&gt;page-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$iterator-&gt;page-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property></property><property name="name" fullname="$name" type="uninitialized"></property><property name="pageXML" fullname="$pageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$pageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$pageXML-&gt;@attributes[&#39;name&#39;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$pageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$pageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property><property name="1" fullname="$pageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property></property></property><property name="projectsIterator" fullname="$projectsIterator" address="" type="array" children="1" numchildren="3" page="0" pagesize="32"><property name="0" fullname="$projectsIterator[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[0]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$projectsIterator[0]-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property><property name="1" fullname="$projectsIterator[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[1]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property><property name="2" fullname="$projectsIterator[2]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[2]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property></property><property name="siteXMLString" fullname="$siteXMLString" address="" type="string" size="161" encoding="base64"><![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHNpdGU+CiAgICA8cGFnZSBuYW1lPSJwcm9qZWN0cyI+CiAgICAgICAgPHBhZ2UgbmFtZT0iUHJvamVjdCAxIiAvPgogICAgICAgIDxwYWdlIG5hbWU9IlByb2plY3QgMiIgLz4KICAgIDwvcGFnZT4KPC9zaXRlPgo=]]></property></response>

-> detach -i 6
<?xml version="1.0" encoding="iso-8859-1"?>
Expand Down
2 changes: 1 addition & 1 deletion tests/bug00475.phpt
Expand Up @@ -37,7 +37,7 @@ dbgpRun( $data, $commands );

-> property_get -i 4 -n a
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="4"><property name="a" fullname="$a" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="example&#0;key" fullname="$a[&apos;example&#0;key&apos;]" address="" type="string" size="5" encoding="base64"><![CDATA[VmFsdWU=]]></property><property name="example" fullname="$a[&apos;example&apos;]" address="" type="string" size="9" encoding="base64"><![CDATA[dmFsdWUAa2V5]]></property></property></response>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="4"><property name="a" fullname="$a" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="example&#0;key" fullname="$a[&#39;example&#0;key&#39;]" address="" type="string" size="5" encoding="base64"><![CDATA[VmFsdWU=]]></property><property name="example" fullname="$a[&#39;example&#39;]" address="" type="string" size="9" encoding="base64"><![CDATA[dmFsdWUAa2V5]]></property></property></response>

-> detach -i 5
<?xml version="1.0" encoding="iso-8859-1"?>
Expand Down
11 changes: 11 additions & 0 deletions tests/bug00684.phpt
@@ -0,0 +1,11 @@
--TEST--
Test for bug #684: xdebug_var_dump - IE does not support &amp;
--INI--
html_errors=1
--FILE--
<?php
xdebug_var_dump('Testing isn\'t fun');
?>
--EXPECT--
<pre class='xdebug-var-dump' dir='ltr'><small>string</small> <font color='#cc0000'>'Testing isn&#39;t fun'</font> <i>(length=17)</i>
</pre>
2 changes: 1 addition & 1 deletion tests/stacktrace_html_2.phpt
Expand Up @@ -40,5 +40,5 @@ foo( $a );
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/%s/stacktrace_html_2.php' bgcolor='#eeeeec'>../stacktrace_html_2.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span title='array (42 =&gt; FALSE, &apos;foo&apos; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))'><font color='#ce5c00'>array(5)</font></span> )</td><td title='/%s/stacktrace_html_2.php' bgcolor='#eeeeec'>../stacktrace_html_2.php<b>:</b>14</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span title='array (42 =&gt; FALSE, &#39;foo&#39; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))'><font color='#ce5c00'>array(5)</font></span> )</td><td title='/%s/stacktrace_html_2.php' bgcolor='#eeeeec'>../stacktrace_html_2.php<b>:</b>14</td></tr>
</table></font>
2 changes: 1 addition & 1 deletion tests/stacktrace_html_3.phpt
Expand Up @@ -40,5 +40,5 @@ foo( $a );
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/%s/stacktrace_html_3.php' bgcolor='#eeeeec'>../stacktrace_html_3.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span>array (42 =&gt; FALSE, &apos;foo&apos; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))</span> )</td><td title='/%s/stacktrace_html_3.php' bgcolor='#eeeeec'>../stacktrace_html_3.php<b>:</b>14</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span>array (42 =&gt; FALSE, &#39;foo&#39; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))</span> )</td><td title='/%s/stacktrace_html_3.php' bgcolor='#eeeeec'>../stacktrace_html_3.php<b>:</b>14</td></tr>
</table></font>
2 changes: 1 addition & 1 deletion tests/stacktrace_html_4.phpt
Expand Up @@ -40,5 +40,5 @@ foo( $a );
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/%s/stacktrace_html_4.php' bgcolor='#eeeeec'>../stacktrace_html_4.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span>$a = </span><span>array (42 =&gt; FALSE, &apos;foo&apos; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))</span> )</td><td title='/%s/stacktrace_html_4.php' bgcolor='#eeeeec'>../stacktrace_html_4.php<b>:</b>14</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span>$a = </span><span>array (42 =&gt; FALSE, &#39;foo&#39; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))</span> )</td><td title='/%s/stacktrace_html_4.php' bgcolor='#eeeeec'>../stacktrace_html_4.php<b>:</b>14</td></tr>
</table></font>
2 changes: 1 addition & 1 deletion tests/stacktrace_html_4_novar.phpt
Expand Up @@ -40,5 +40,5 @@ foo( $a );
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/%s/stacktrace_html_4_novar.php' bgcolor='#eeeeec'>../stacktrace_html_4_novar.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span>$a = </span><span>array (42 =&gt; FALSE, &apos;foo&apos; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))</span> )</td><td title='/%s/stacktrace_html_4_novar.php' bgcolor='#eeeeec'>../stacktrace_html_4_novar.php<b>:</b>14</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>foo( <span>$a = </span><span>array (42 =&gt; FALSE, &#39;foo&#39; =&gt; 912124, 43 =&gt; class stdClass { public $bar = 100 }, 44 =&gt; class stdClass { }, 45 =&gt; resource(5) of type (stream))</span> )</td><td title='/%s/stacktrace_html_4_novar.php' bgcolor='#eeeeec'>../stacktrace_html_4_novar.php<b>:</b>14</td></tr>
</table></font>
2 changes: 1 addition & 1 deletion xdebug_var.c
Expand Up @@ -1065,7 +1065,7 @@ char* xdebug_xmlize(char *string, int len, int *newlen)
tmp2 = php_str_to_str(tmp, len, "\"", 1, "&quot;", 6, &len);
efree(tmp);

tmp = php_str_to_str(tmp2, len, "'", 1, "&apos;", 6, &len);
tmp = php_str_to_str(tmp2, len, "'", 1, "&#39;", 5, &len);
efree(tmp2);

tmp2 = php_str_to_str(tmp, len, "\n", 1, "&#10;", 5, &len);
Expand Down

0 comments on commit 622c5ff

Please sign in to comment.