com php-src: Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport: ext/iconv /iconv.c ext/mbstring/mbstring.c
ext/mysqli/mysqli_ap i.c ext/mysqlnd/mysqlnd.c ext/oci8/oci8.c ext/o ci8/oci8_interface.c ext/standard/html.c
| From: | Anatol Belski | Date: | Thu, 20 Mar 2014 07:47:51 +0000 |
| Subject: | com php-src: Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport: ext/iconv /iconv.c ext/mbstring/mbstring.c ext/mysqli/mysqli_ap i.c ext/mysqlnd/mysqlnd.c ext/oci8/oci8.c ext/o ci8/oci8_interface.c ext/standard/html.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76548@lists.php.net to get a copy of this message | ||
Commit: 10248d3b5abd74d55d4cb01b5714e76188debeb4
Author: Anatol Belski <ab@php.net> Thu, 20 Mar 2014 08:47:51 +0100
Parents: fa6ba0ecdb3260b76e4a19aa34c82e7ba350c176 e1fe76f28ae4d93306c53477968311924f83bb79
Branches: str_size_and_int64_56_backport
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=10248d3b5abd74d55d4cb01b5714e76188debeb4
Log:
Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
Add default_charset handling
Updated UPGRADING to add three changes
OCI8: fix prototypes for oci_field_*(). They can take a column index or name.
Change test package name ARRAYBINDPKG1 to a per-file unique name to aid parallel testing
fix compilation error
fix typo
Fix problem with mysqli_commt()/mysqli_rollback()
Restore NEWS and UPGRADING for hash_equals().
5.5.11RC1 preparation
Fixed typo
Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding
Conflicts:
ext/mysqli/mysqli_api.c
ext/mysqlnd/mysqlnd.c
ext/standard/html.c
Changed paths:
MM ext/iconv/iconv.c
MM ext/mbstring/mbstring.c
MM ext/mysqli/mysqli_api.c
MM ext/mysqlnd/mysqlnd.c
MM ext/oci8/oci8.c
MM ext/oci8/oci8_interface.c
MM ext/standard/html.c
Diff:
diff --cc ext/standard/html.c
index be7cd1d,ad2f38f..3afd3c96
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@@ -1432,10 -1445,10 +1445,10 @@@ encode_amp
*/
static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
{
- char *str, *hint_charset = PHP_DEFAULT_CHARSET;
- php_size_t str_len, hint_charset_len = sizeof(PHP_DEFAULT_CHARSET)-1;
+ char *str, *hint_charset = "";
- int str_len, hint_charset_len = 0;
++ php_size_t str_len, hint_charset_len = 0;
size_t new_len;
- long flags = ENT_COMPAT;
+ php_int_t flags = ENT_COMPAT;
char *replaced;
zend_bool double_encode = 1;
@@@ -1504,20 -1524,27 +1524,27 @@@ PHP_FUNCTION(htmlspecialchars_decode
Convert all HTML entities to their applicable characters */
PHP_FUNCTION(html_entity_decode)
{
- char *str, *hint_charset = PHP_DEFAULT_CHARSET;
- php_size_t str_len, hint_charset_len = sizeof(PHP_DEFAULT_CHARSET)-1;
- php_size_t new_len = 0;
+ char *str, *hint_charset = "";
- int str_len, hint_charset_len = 0;
++ php_size_t str_len, hint_charset_len = 0;
+ size_t new_len = 0;
- long quote_style = ENT_COMPAT;
+ php_int_t quote_style = ENT_COMPAT;
char *replaced;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|iS", &str, &str_len,
"e_style, &hint_charset, &hint_charset_len) == FAILURE) {
return;
}
- replaced = php_unescape_html_entities(str, str_len, &new_len, 1 /*all*/, quote_style,
hint_charset TSRMLS_CC);
+ if (hint_charset_len) {
+ replaced = php_unescape_html_entities(str, str_len, &new_len, 1 /*all*/, quote_style,
hint_charset TSRMLS_CC);
+ } else {
+ get_charset(&hint_charset, &hint_charset_len TSRMLS_CC);
+ replaced = php_unescape_html_entities(str, str_len, &new_len, 1 /*all*/, quote_style,
hint_charset TSRMLS_CC);
+ efree(hint_charset);
+ }
+
if (replaced) {
- RETURN_STRINGL(replaced, (int)new_len, 0);
+ RETURN_STRINGL(replaced, new_len, 0);
}
RETURN_FALSE;
}