summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2014-12-14 23:09:13 +0100
committerKalle Sommer Nielsen <kalle@php.net>2014-12-14 23:09:13 +0100
commitad01fd8b49c6117d5c5fce98871c41781a5c00b9 (patch)
tree3b953a0b7303d858028a351f35f91c3efaa711cd
parent9afae43b1238291f7c11fc9a2075289d07fb5ccf (diff)
downloadphp-git-ad01fd8b49c6117d5c5fce98871c41781a5c00b9.tar.gz
Fixed bug #55415 (php_info produces invalid anchor names)
@@ Slightly based off Johannes' patch
-rw-r--r--NEWS1
-rw-r--r--ext/standard/info.c8
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index a57e6cbb25..aad4837de4 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@
modifier. (Guilherme Blanco)
. is_long() & is_integer() is now an alias of is_int(). (Kalle)
. Implemented FR #55467 (phpinfo: PHP Variables with $ and single quotes). (Kalle)
+ . Fixed bug #55415 (php_info produces invalid anchor names). (Kalle, Johannes)
- Date:
. Fixed day_of_week function as it could sometimes return negative values
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 73ec873d4e..d6911a42dd 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -146,7 +146,13 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
{
if (zend_module->info_func || zend_module->version) {
if (!sapi_module.phpinfo_as_text) {
- php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", zend_module->name, zend_module->name);
+ int len = 0;
+ zend_string *url_name = php_url_encode(zend_module->name, strlen(zend_module->name), &len);
+
+ php_strtolower(url_name->val, url_name->len);
+ php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", url_name->val, zend_module->name);
+
+ efree(url_name);
} else {
php_info_print_table_start();
php_info_print_table_header(1, zend_module->name);