diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-12-23 04:29:41 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-12-23 04:29:41 +0300 |
commit | 6ec5ab77df816a66e480f2d3dcf4f917c4390833 (patch) | |
tree | 12af36d9602e9a6080276b228911bb38e43fd210 /ext/mbstring/mbstring.c | |
parent | dedf44bacce095737c3cd9457da218033f61b39a (diff) | |
download | php-git-6ec5ab77df816a66e480f2d3dcf4f917c4390833.tar.gz |
Improved trim/ltrim/rtrim functions.
Now php_trim() operates on zend_string and returns zend_string (it may return the same zend_string).
Diffstat (limited to 'ext/mbstring/mbstring.c')
-rw-r--r-- | ext/mbstring/mbstring.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 1e7cb5bd73..d816ee52e7 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1437,17 +1437,17 @@ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation) /* {{{ static PHP_INI_MH(OnUpdate_mbstring_http_output_conv_mimetypes */ static PHP_INI_MH(OnUpdate_mbstring_http_output_conv_mimetypes) { - zval tmp; + zend_string *tmp; void *re = NULL; if (!new_value) { new_value = entry->orig_value; } - php_trim(new_value->val, new_value->len, NULL, 0, &tmp, 3); + tmp = php_trim(new_value, NULL, 0, 3); - if (Z_STRLEN(tmp) > 0) { - if (!(re = _php_mb_compile_regex(Z_STRVAL(tmp)))) { - zval_dtor(&tmp); + if (tmp->len > 0) { + if (!(re = _php_mb_compile_regex(tmp->val))) { + zend_string_release(tmp); return FAILURE; } } @@ -1458,7 +1458,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output_conv_mimetypes) MBSTRG(http_output_conv_mimetypes) = re; - zval_dtor(&tmp); + zend_string_release(tmp); return SUCCESS; } /* }}} */ |