Req #75959 [Opn->Fbk]: Support a function to escape glob metacharacters
Edit report at https://bugs.php.net/bug.php?id=75959&edit=1
ID: 75959
Updated by: requinix@php.net
Reported by: maggus dot staab+php at googlemail dot com
Summary: Support a function to escape glob metacharacters
-Status: Open
+Status: Feedback
Type: Feature/Change Request
Package: *General Issues
PHP Version: 7.0.27
Block user comment: N
Private report: N
New Comment:
http://php.net/manual/en/function.quotemeta.php
Previous Comments:
------------------------------------------------------------------------
[2018-02-14 09:49:06] maggus dot staab+php at googlemail dot com
Description:
------------
Atm there is no api to escape glob patterns.
this makes glob() useless for cases in which dynamic (maybe even user-supplied contents will be
embedded into the glob pattern).
Test script:
---------------
$glob = 'hallo*lala'; // I want this string to match the literal '*' char
glob(glob_quote($glob))
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75959&edit=1
Thread (6 messages)