[php-src] Issue #12470: use of special characters(^ and $) in INI setting for type string won't work as expected

From: Date: Wed, 18 Oct 2023 20:58:58 +0000
Subject: [php-src] Issue #12470: use of special characters(^ and $) in INI setting for type string won't work as expected
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245599@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/12470
Author: HeenaBansal2009

### Description

The ini setting doesn't  work as expected when setting has regex expressions 
My customized ini file has string with regular expressions like below 
Case 1:
Ini setting value :
abc=*[Tt][Oo][Kk][Ee][Nn].*,^[Qq],one, two

php -I |grep abc shows
myextension.abc=> 0 => 0


But I expected this output instead:
php -I |grep abc shows
myextension.abc=> *[Tt][Oo][Kk][Ee][Nn].*,^[Qq],one, two =>*[Tt][Oo][Kk][Ee][Nn].*,^[Qq],one,
two

Case 2:
Ini setting value :
abc=*[Tt][Oo][Kk][Ee][Nn].*

php -I |grep abc shows
myextension.abc=> *[Tt][Oo][Kk][Ee][Nn].*=>*[Tt][Oo][Kk][Ee][Nn].*


Case 3:
Ini setting value :
abc=.^[Qq]$
php -I |grep abc shows
PHP:  syntax error, unexpected '=' myextension.ini on line 9
myextension.abc=> 0 =>0

Is there any limitation with regex expressions in php ini settings. Though It seems like carrot ^
and $ dollar sign doesn't seems to work with string ini setting.




### PHP Version

PHP 8.1

### Operating System

_No response_


Thread (1 message)

  • HeenaBansal2009
« previous php.bugs (#245599) next »