|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-08-13 09:40 UTC] callum at lynxphp dot com
Description: ------------ A few modules in PHP cause php_info to print invalid anchor names: <h2><a name="module_Zend Optimizer">Zend Optimizer</a></h2> The anchor name should not contain a space - this is invalid. This bug can be replicated on a vanilla install of PHP with Zend Optimiser installed. Test script: --------------- <?php phpinfo(); Patchesfix-php_info-anchor-names (last revision 2011-08-13 10:35 UTC by callum at lynxphp dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 20:00:02 2025 UTC |
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