nlopess         Sun May 27 15:57:11 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       html.c 
    /php-src/ext/standard/tests/strings htmlentities18.phpt 
  Log:
  fix handling of && by htmlentities 'no-double-encode'
  expand the test cases
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.111.2.2.2.13&r2=1.111.2.2.2.14&diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.111.2.2.2.13 
php-src/ext/standard/html.c:1.111.2.2.2.14
--- php-src/ext/standard/html.c:1.111.2.2.2.13  Sun May 27 15:45:18 2007
+++ php-src/ext/standard/html.c Sun May 27 15:57:11 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: html.c,v 1.111.2.2.2.13 2007/05/27 15:45:18 nlopess Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.14 2007/05/27 15:57:11 nlopess Exp $ */
 
 /*
  * HTML entity resources:
@@ -1154,7 +1154,7 @@
                                        len += sizeof("&") - 1;
                                } else {
                                        char *e = memchr(old + i, ';', oldlen - 
i);
-                                       char *s = old + i + 1;
+                                       char *s = old + i;
 
                                        if (!e || (e - s) > 10) { /* minor 
optimization to avoid "entities" over 10 chars in length */
                                                goto encode_amp;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities18.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/standard/tests/strings/htmlentities18.phpt
diff -u php-src/ext/standard/tests/strings/htmlentities18.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/htmlentities18.phpt:1.1.2.2
--- php-src/ext/standard/tests/strings/htmlentities18.phpt:1.1.2.1      Tue May 
22 12:37:00 2007
+++ php-src/ext/standard/tests/strings/htmlentities18.phpt      Sun May 27 
15:57:11 2007
@@ -9,6 +9,9 @@
        "&; &amp &#a; &9;",
        "&kffjadfdhsjfhjasdhffasdfas;",
        "&#8787978789",
+       "&",
+       "&&&",
+       "&ab&&",
 );
 
 foreach ($tests as $test) {
@@ -23,9 +26,15 @@
 string(13) "abc&sfdsa"
 string(33) "test+s & some more D"
 string(33) "test+s & some more D"
-string(20) "&; &amp &#a; &9;"
-string(20) "&; &amp &#a; &9;"
+string(24) "&; &amp &#a; &9;"
+string(24) "&; &amp &#a; &9;"
 string(32) "&kffjadfdhsjfhjasdhffasdfas;"
 string(32) "&kffjadfdhsjfhjasdhffasdfas;"
 string(16) "&#8787978789"
 string(16) "&#8787978789"
+string(5) "&"
+string(5) "&"
+string(15) "&&&"
+string(15) "&&&"
+string(17) "&ab&&"
+string(17) "&ab&&"

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to