php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79552 preg_quote doesnt work on #
Submitted: 2020-05-01 08:59 UTC Modified: 2020-05-01 09:09 UTC
From: devste at devste dot com Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 7.2.30 OS:
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
23 - 1 = ?
Subscribe to this entry?

 
 [2020-05-01 08:59 UTC] devste at devste dot com
Description:
------------
---
From manual page: https://php.net/function.preg-quote
---


Test script:
---------------
echo preg_quote( 'foo#bar' );

Expected result:
----------------
foo\#bar

Actual result:
--------------
foo#bar

(Note: works correctly in PHP 7.3+)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-01 09:09 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2020-05-01 09:09 UTC] nikic@php.net
Yes, # is escaped since 7.3. See the changelog on the page you linked.
 [2020-05-01 22:27 UTC] a at b dot c dot de
And PHP 7.2 is no longer actively supported (it will receive security fixes only for another six months).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 19:01:26 2024 UTC