|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2017-12-16 16:35 UTC] nikic@php.net
[2017-12-16 16:35 UTC] nikic@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ Since # character is used as a control character to start comments (in extended mode - the 'x' modifier), it should also be quoted by preg_quote(). Unquoted # character corrupts the pattern in extended mode even after preg_quote() has been applied. Test script: --------------- <?php preg_match('~^(' . preg_quote('hello#world', '~') . ')\z~x', 'hello#world') Expected result: ---------------- No error, # is properly escaped. Actual result: -------------- Warning: preg_match(): Compilation failed: missing ) at offset 16