]> granicus.if.org Git - php/commitdiff
apply a patch
authorMasaki Kagaya <masakielastic@gmail.com>
Tue, 14 Apr 2015 12:17:08 +0000 (21:17 +0900)
committerMasaki Kagaya <masakielastic@gmail.com>
Tue, 14 Apr 2015 12:17:08 +0000 (21:17 +0900)
ext/standard/basic_functions.c
ext/standard/html.c
ext/standard/tests/strings/bug61116.phpt [new file with mode: 0644]

index 36d530d47b74db4c28f9cc2b9ec7793845a4c5b9..ebeca422df3d98ea6b5f1e3fd9fb7603fa499947 100644 (file)
@@ -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()
 
 /* }}} */
index cce1b73be806c7ebfa25bed8fa4c9e1544342f6d..2677e3ec5171b9683a8c60541b5e698b30e49fa1 100644 (file)
@@ -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 (file)
index 0000000..2bd9f25
--- /dev/null
@@ -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 ]
+  }
+}
+
+
+