Bug #17856 Updated: quotemeta() does not escape all correct meta characters
| From: | robbat2 at orbis-terrarum dot net | Date: | Thu, 20 Jun 2002 07:54:16 +0000 |
| Subject: | Bug #17856 Updated: quotemeta() does not escape all correct meta characters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11520@lists.php.net to get a copy of this message | ||
ID: 17856
Updated by: robbat2@orbis-terrarum.net
Reported By: robbat2@orbis-terrarum.net
-Status: Closed
+Status: Open
Bug Type: Regexps related
Operating System: Linux, Apache 2.0.36
PHP Version: 4.1.2
New Comment:
I'm writing code for phpMyAdmin, and we try to avoid the PCRE because
some people don't have it enabled. And we still support people that are
that don't have it enabled.
Quotemeta() should escape all of the correct characters for non-Perl
regular expressions.
In the name of correctness, PHP should have this.
Previous Comments:
------------------------------------------------------------------------
[2002-06-20 02:22:49] derick@php.net
We already have preg_quote for this..
Derick
------------------------------------------------------------------------
[2002-06-19 22:05:36] robbat2@orbis-terrarum.net
quotemeta() only escapes:
. \\ + * ? [ ^ ] ( $ )
To properly escape traditional characters for regexps, it is also
nessecary to escape '-' and '|', as the are the range and OR operators
respectively.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17856&edit=1