From 6f06e93237712fa409d92820c45c58e55dfe81d1 Mon Sep 17 00:00:00 2001 From: Rolland Santimano Date: Thu, 29 Sep 2005 09:33:38 +0000 Subject: [PATCH] - Updated addslashes(): add codepoints directly rather than with zend_codepoint_to_uchar() --- ext/standard/string.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); -- 2.50.1