From: Rolland Santimano Date: Thu, 29 Sep 2005 09:33:38 +0000 (+0000) Subject: - Updated addslashes(): add codepoints directly rather than with zend_codepoint_to_uc... X-Git-Tag: RELEASE_0_9_0~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f06e93237712fa409d92820c45c58e55dfe81d1;p=php - Updated addslashes(): add codepoints directly rather than with zend_codepoint_to_uchar() --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 4cc0573126..ab6dd8f209 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3817,12 +3817,12 @@ PHPAPI UChar *php_u_addslashes_ex(UChar *str, int32_t length, int32_t *new_lengt 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 @@ PHPAPI UChar *php_u_addslashes_ex(UChar *str, int32_t length, int32_t *new_lengt 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);