Bug #55415 [Csd]: php_info produces invalid anchor names
| From: | stas@php.net | Date: | Mon, 15 Dec 2014 19:37:32 +0000 |
| Subject: | Bug #55415 [Csd]: php_info produces invalid anchor names | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189076@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55415&edit=1
ID: 55415
Updated by: stas@php.net
Reported by: callum at lynxphp dot com
Summary: php_info produces invalid anchor names
Status: Closed
Type: Bug
Package: PHP options/info functions
Operating System: OS X / Windows
PHP Version: 5.3.6
Assigned To: kalle
Block user comment: N
Private report: N
New Comment:
Note that the patch is broken as is - php_url_encode doesn't even have this signature (it gets
2 params, not 3) but compiles because it misses the definition in url.h due to not including it.
This makes it completely broken on any platform where sizeof(int) != sizeof(void *) due to the fact
that the compiler assumes php_url_encode returns int.
Previous Comments:
------------------------------------------------------------------------
[2014-12-15 19:00:18] ab@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ad01fd8b49c6117d5c5fce98871c41781a5c00b9
Log: Fixed bug #55415 (php_info produces invalid anchor names)
------------------------------------------------------------------------
[2014-12-14 22:09:41] kalle@php.net
Fixed in PHP7.
------------------------------------------------------------------------
[2014-12-14 22:09:28] kalle@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ad01fd8b49c6117d5c5fce98871c41781a5c00b9
Log: Fixed bug #55415 (php_info produces invalid anchor names)
------------------------------------------------------------------------
[2011-08-22 14:27:40] kalle@php.net
I agree Johannes that php_url_encode() should be used, I'm assigning this to myself to try play
around with it and see if I can get a working solution for when 5.3.8 is packaged
------------------------------------------------------------------------
[2011-08-15 22:00:59] johannes@php.net
There might be other "bad" characters in the name, not only a space. So I think
php_url_encode() should be used.
About your patch: Mind that c does no garbage collection so you'd create two memory leaks. A
better version might be along the lines of
if (!sapi_module.phpinfo_as_text) {
int len = 0;
char *url_name = php_url_encode(zend_module->name, strlen(zend_module->name), &len);
php_printf("<h2><a
name=\"module_%s\">%s</a></h2>\n", url_name, zend_module->name);
efree(url_name);
}
Didn't test it though.
/mind that declarations in
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=55415
--
Edit this bug report at https://bugs.php.net/bug.php?id=55415&edit=1