#43915 [Asn->Csd]: INI parser no longer allows hyphens in directive names

From: Date: Mon, 04 Feb 2008 20:45:40 +0000
Subject: #43915 [Asn->Csd]: INI parser no longer allows hyphens in directive names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121967@lists.php.net to get a copy of this message
ID: 43915 Updated by: jani@php.net Reported By: sfox@php.net -Status: Assigned +Status: Closed Bug Type: Scripting Engine problem Operating System: irrelevant PHP Version: 5.3CVS-2008-01-23 (CVS) Assigned To: jani New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2008-01-24 00:30:27] sfox@php.net You fibber! You know I tested it at least - and sent you a patch to make testing easy. ------------------------------------------------------------------------ [2008-01-23 20:50:41] jani@php.net As note to myself, changing this in zend_ini_scanner.l: LABEL [a-zA-Z0-9][a-zA-Z0-9._]* to LABEL [a-zA-Z0-9][a-zA-Z0-9._-]* Should fix this. Untested! :) ------------------------------------------------------------------------ [2008-01-23 13:36:08] sfox@php.net I thought INI directive names were tied up with the module initialization in TSRM/Zend, but discovered otherwise in the wee sma' hours of this morning. It's possible to change the name just by altering the entries on the .c page (in the declaration and everywhere that mentions them), and they'll still format as normal with ini_get_all()/phpinfo(). It's still a bug, as in 'an undocumented change in behaviour'; if it's fixable I'm sure Andrei will be all sweetness and light. But if it isn't, the dot may be a good alternative for us - and a nicer error message a good alternative for everyone else out there. FWIW I know the hyphen was pushing at boundaries. I can't actually remember how we got around the problem of the module name, it was so long ago... and the module API's changed since then. ------------------------------------------------------------------------ [2008-01-23 11:13:29] jani@php.net Assigning to myself, gotta check out later. The directive follow the rule of PHP variable names: hyphen (-) is illegal in those too. But then again, dot (.) is allowed in INI directive names. :D ------------------------------------------------------------------------ [2008-01-23 02:59:17] sfox@php.net Description: ------------ Trying to load PHP-GTK extensions led to the discovery that we now get a parser error (under doze, this is in the form of a message box). I tried with a 5.3-dev from December and got a different message saying that the hyphen is illegal syntax. The INI directive, being for PHP-GTK, has a hyphen as part of its extension prefix. All works fine with current CVS for 5_2 branch. Reproduce code: --------------- extension=php_gtk2.dll php-gtk.codepage=CP1250 php-gtk.extensions=php_gtk_libglade2.dll Expected result: ---------------- Codepage used by PHP-GTK to change to CP1250, and the PHP-GTK extension libglade to load. Actual result: -------------- (in a message box) PHP Error parse error in C:\sandbox\testarea\php.ini on line 10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43915&edit=1

« previous php.bugs (#121967) next »