com php-src: apply a patch: ext/standard/basic_functions.c ext/standard/html.c ext/standard/tests/strings/bug61 116.phpt
| From: | Stanislav Malyshev | Date: | Tue, 14 Apr 2015 12:17:08 +0000 |
| Subject: | com php-src: apply a patch: ext/standard/basic_functions.c ext/standard/html.c ext/standard/tests/strings/bug61 116.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86384@lists.php.net to get a copy of this message | ||
Commit: 8d219f53079c0bc48f6dee63ff5e04e05bdb340b
Author: Masaki Kagaya <masakielastic@gmail.com> Tue, 14 Apr 2015 21:17:08 +0900
Parents: 533c4be0d55cf4a6086beab84e5d3ccdbeeb5314
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8d219f53079c0bc48f6dee63ff5e04e05bdb340b
Log:
apply a patch
Changed paths:
M ext/standard/basic_functions.c
M ext/standard/html.c
A ext/standard/tests/strings/bug61116.phpt
Diff:
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 36d530d...ebeca42 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1451,7 +1451,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1)
ZEND_ARG_INFO(0, string)
ZEND_ARG_INFO(0, quote_style)
- ZEND_ARG_INFO(0, charset)
+ ZEND_ARG_INFO(0, encoding)
ZEND_ARG_INFO(0, double_encode)
ZEND_END_ARG_INFO()
@@ -1463,19 +1463,20 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_html_entity_decode, 0, 0, 1)
ZEND_ARG_INFO(0, string)
ZEND_ARG_INFO(0, quote_style)
- ZEND_ARG_INFO(0, charset)
+ ZEND_ARG_INFO(0, encoding)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1)
ZEND_ARG_INFO(0, string)
ZEND_ARG_INFO(0, quote_style)
- ZEND_ARG_INFO(0, charset)
+ ZEND_ARG_INFO(0, encoding)
ZEND_ARG_INFO(0, double_encode)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_html_translation_table, 0, 0, 0)
ZEND_ARG_INFO(0, table)
ZEND_ARG_INFO(0, quote_style)
+ ZEND_ARG_INFO(0, encoding)
ZEND_END_ARG_INFO()
/* }}} */
diff --git a/ext/standard/html.c b/ext/standard/html.c
index cce1b73..2677e3e 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -1493,7 +1493,7 @@ void register_html_constants(INIT_FUNC_ARGS)
}
/* }}} */
-/* {{{ proto string htmlspecialchars(string string [, int quote_style[, string charset[, bool
double_encode]]])
+/* {{{ proto string htmlspecialchars(string string [, int quote_style[, string encoding[, bool
double_encode]]])
Convert special characters to HTML entities */
PHP_FUNCTION(htmlspecialchars)
{
@@ -1522,7 +1522,7 @@ PHP_FUNCTION(htmlspecialchars_decode)
}
/* }}} */
-/* {{{ proto string html_entity_decode(string string [, int quote_style][, string charset])
+/* {{{ proto string html_entity_decode(string string [, int quote_style][, string encoding])
Convert all HTML entities to their applicable characters */
PHP_FUNCTION(html_entity_decode)
{
@@ -1558,7 +1558,7 @@ PHP_FUNCTION(html_entity_decode)
/* }}} */
-/* {{{ proto string htmlentities(string string [, int quote_style[, string charset[, bool
double_encode]]])
+/* {{{ proto string htmlentities(string string [, int quote_style[, string encoding[, bool
double_encode]]])
Convert all applicable characters to HTML entities */
PHP_FUNCTION(htmlentities)
{
@@ -1622,7 +1622,7 @@ static inline void write_s3row_data(
}
/* }}} */
-/* {{{ proto array get_html_translation_table([int table [, int flags [, string charset_hint]]])
+/* {{{ proto array get_html_translation_table([int table [, int flags [, string encoding]]])
Returns the internal translation table used by htmlspecialchars and htmlentities */
PHP_FUNCTION(get_html_translation_table)
{
diff --git a/ext/standard/tests/strings/bug61116.phpt b/ext/standard/tests/strings/bug61116.phpt
new file mode 100644
index 0000000..2bd9f25
--- /dev/null
+++ b/ext/standard/tests/strings/bug61116.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #61116 (HTML functions use encoding, not charset)
+--FILE--
+<?php
+Reflection::export(new ReflectionFunction('htmlspecialchars'));
+Reflection::export(new ReflectionFunction('get_html_translation_table'));
+?>
+--EXPECT--
+Function [ <internal:standard> function htmlspecialchars ] {
+
+ - Parameters [4] {
+ Parameter #0 [ <required> $string ]
+ Parameter #1 [ <optional> $quote_style ]
+ Parameter #2 [ <optional> $encoding ]
+ Parameter #3 [ <optional> $double_encode ]
+ }
+}
+
+Function [ <internal:standard> function get_html_translation_table ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <optional> $table ]
+ Parameter #1 [ <optional> $quote_style ]
+ Parameter #2 [ <optional> $encoding ]
+ }
+}
+
+
+