com php-src: Remove addslashes_str: ext/mysqli/mysqli.c ext/pcre/php_pcre.c ext/standard/php_string.h ex t/standard/string.c
| From: | Xinchen Hui | Date: | Tue, 20 Jan 2015 02:11:48 +0000 |
| Subject: | com php-src: Remove addslashes_str: ext/mysqli/mysqli.c ext/pcre/php_pcre.c ext/standard/php_string.h ex t/standard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84191@lists.php.net to get a copy of this message | ||
Commit: 020610ee40fcabacf0330243dd4af1a2b599ce6b
Author: Xinchen Hui <laruence@php.net> Tue, 20 Jan 2015 10:11:48 +0800
Parents: 1ee7845f5712a2d8fb7419bd1e93e49c95be5d8d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=020610ee40fcabacf0330243dd4af1a2b599ce6b
Log:
Remove addslashes_str
Changed paths:
M ext/mysqli/mysqli.c
M ext/pcre/php_pcre.c
M ext/standard/php_string.h
M ext/standard/string.c
Diff:
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 4fa6783..2debf25 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1200,16 +1200,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result,
zend
#endif
{
-#if PHP_API_VERSION < 20100412
- /* check if we need magic quotes */
- if (PG(magic_quotes_runtime)) {
- ZVAL_STR(&res, php_addslashes(row[i], field_len[i], 0));
- } else {
-#endif
- ZVAL_STRINGL(&res, row[i], field_len[i]);
-#if PHP_API_VERSION < 20100412
- }
-#endif
+ ZVAL_STRINGL(&res, row[i], field_len[i]);
}
if (fetchtype & MYSQLI_NUM) {
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 1b3bd8f..3e5d96e 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1026,7 +1026,7 @@ static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char
*subject
match = subject + offsets[backref<<1];
match_len = offsets[(backref<<1)+1] - offsets[backref<<1];
if (match_len) {
- esc_match = php_addslashes_str(match, match_len, 0);
+ esc_match = php_addslashes(zend_string_init(match, match_len, 0), 1);
} else {
esc_match = zend_string_init(match, match_len, 0);
}
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index 0e0120e..1cca143 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -124,7 +124,6 @@ PHPAPI zend_string *php_string_toupper(zend_string *s);
PHPAPI zend_string *php_string_tolower(zend_string *s);
PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size_t trlen);
PHPAPI zend_string *php_addslashes(zend_string *str, int should_free);
-PHPAPI zend_string *php_addslashes_str(const char *str, size_t length, int should_free);
PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t
wlength);
PHPAPI void php_stripslashes(char *str, size_t *len);
PHPAPI void php_stripcslashes(char *str, size_t *len);
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 6848081..78c7a25 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -3910,7 +3910,11 @@ PHPAPI zend_string *php_addslashes(zend_string *str, int should_free)
}
}
- return zend_string_copy(str);
+ if (!should_free) {
+ return zend_string_copy(str);
+ }
+
+ return str;
do_escape:
offset = source - (char *)str->val;
@@ -3952,14 +3956,6 @@ do_escape:
}
/* }}} */
-/* {{{ php_addslashes_str
- */
-PHPAPI zend_string *php_addslashes_str(const char *str, size_t length, int should_free)
-{
- return php_addslashes(zend_string_init(str, length, 0), 1);
-}
-/* }}} */
-
#define _HEB_BLOCK_TYPE_ENG 1
#define _HEB_BLOCK_TYPE_HEB 2
#define isheb(c) (((((unsigned char) c) >= 224) && (((unsigned char) c) <= 250))
? 1 : 0)