summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2015-04-18 19:51:22 -0700
committerStanislav Malyshev <stas@php.net>2015-04-18 19:51:22 -0700
commitdd56598d0d7c95098202818a3c247a29c565f161 (patch)
treeb60d047fd5594cf6a8c6d0bd202e909e2131f3d1
parent80bd148cc9afa6cd393fc20c3f42ab94345881dd (diff)
parent8d219f53079c0bc48f6dee63ff5e04e05bdb340b (diff)
downloadphp-git-dd56598d0d7c95098202818a3c247a29c565f161.tar.gz
Merge branch 'pull-request/1238'
* pull-request/1238: apply a patch
-rw-r--r--ext/standard/basic_functions.c7
-rw-r--r--ext/standard/html.c8
-rw-r--r--ext/standard/tests/strings/bug61116.phpt29
3 files changed, 37 insertions, 7 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 36d530d47b..ebeca422df 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 cce1b73be8..2677e3ec51 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 0000000000..2bd9f2537f
--- /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 ]
+ }
+}
+
+
+