|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-12-28 23:05 UTC] cmb@php.net
[2019-01-02 09:32 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2019-01-02 09:32 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 13:00:01 2025 UTC |
Description: ------------ preg_quote function escapes # character, while it shouldn't. This breaks IPBoard 4.3.6 forums in which friendly urls uses custom regexes with #, @, ? characters in url templates. Urls are passed through preg_quote function and # is replaced with \#. In next section {#} should be replaced with (\d+), but this fails, since there is {#} but {\#}. PHP 7.3.0-2 (cli) (built: Dec 17 2018 09:51:53) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.0-2, Copyright (c) 1999-2018, by Zend Technologies Test script: --------------- <?php $inputs = ['#', '?', '@']; foreach($inputs as $input) { var_dump($input, preg_quote($input)); } Expected result: ---------------- string(1) "#" string(1) "#" string(1) "?" string(2) "\?" string(1) "@" string(1) "@" Actual result: -------------- string(1) "#" string(2) "\#" string(1) "?" string(2) "\?" string(1) "@" string(1) "@"