rolland         Thu Sep 29 05:33:41 2005 EDT

  Modified files:              
    /php-src/ext/standard       string.c 
  Log:
  - Updated addslashes(): add codepoints directly rather than with 
zend_codepoint_to_uchar()
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.486&r2=1.487&ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.486 php-src/ext/standard/string.c:1.487
--- php-src/ext/standard/string.c:1.486 Wed Sep 28 18:31:29 2005
+++ php-src/ext/standard/string.c       Thu Sep 29 05:33:38 2005
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.486 2005/09/28 22:31:29 iliaa Exp $ */
+/* $Id: string.c,v 1.487 2005/09/29 09:33:38 rolland Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3817,12 +3817,12 @@
                        U16_NEXT(str, i, length, ch);
                        switch (ch) {
                        case '\0':
-                               buf_len += zend_codepoint_to_uchar('\\', 
buf+buf_len);
-                               buf_len += zend_codepoint_to_uchar('0', 
buf+buf_len);
+                               *(buf+buf_len) = (UChar)0x5C; buf_len++; /* \ */
+                               *(buf+buf_len) = (UChar)0x30; buf_len++; /* 0 */
                                break;
                        case '\'':
-                               buf_len += zend_codepoint_to_uchar('\'', 
buf+buf_len);
-                               buf_len += zend_codepoint_to_uchar('\'', 
buf+buf_len);
+                               *(buf+buf_len) = (UChar)0x27; buf_len++; /* ' */
+                               *(buf+buf_len) = (UChar)0x27; buf_len++; /* ' */
                                break;
                        default:
                                buf_len += zend_codepoint_to_uchar(ch, 
buf+buf_len);
@@ -3834,13 +3834,13 @@
                        U16_NEXT(str, i, length, ch);
                        switch (ch) {
                        case '\0':
-                               buf_len += zend_codepoint_to_uchar('\\', 
buf+buf_len);
-                               buf_len += zend_codepoint_to_uchar('0', 
buf+buf_len);
+                               *(buf+buf_len) = (UChar)0x5C; buf_len++; /* \ */
+                               *(buf+buf_len) = (UChar)0x30; buf_len++; /* 0 */
                                break;
                        case '\'':
                        case '\"':
                        case '\\':
-                               buf_len += zend_codepoint_to_uchar('\\', 
buf+buf_len);
+                               *(buf+buf_len) = (UChar)0x5C; buf_len++; /* \ */
                                /* break is missing *intentionally* */
                        default:
                                buf_len += zend_codepoint_to_uchar(ch, 
buf+buf_len);

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

Reply via email to