com php-src: Fixed bug #55415 (php_info produces invali d anchor names): NEWS ext/standard/info.c
| From: | Kalle Sommer Nielsen | Date: | Sun, 14 Dec 2014 22:09:13 +0000 |
| Subject: | com php-src: Fixed bug #55415 (php_info produces invali d anchor names): NEWS ext/standard/info.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83694@lists.php.net to get a copy of this message | ||
Commit: ad01fd8b49c6117d5c5fce98871c41781a5c00b9
Author: Kalle Sommer Nielsen <kalle@php.net> Sun, 14 Dec 2014 23:09:13 +0100
Parents: 9afae43b1238291f7c11fc9a2075289d07fb5ccf
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ad01fd8b49c6117d5c5fce98871c41781a5c00b9
Log:
Fixed bug #55415 (php_info produces invalid anchor names)
@@ Slightly based off Johannes' patch
Bugs:
https://bugs.php.net/55415
Changed paths:
M NEWS
M ext/standard/info.c
Diff:
diff --git a/NEWS b/NEWS
index a57e6cb..aad4837 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 73ec873..d6911a4 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);