Have a language .ini file with the following string.
PLG_ACCESSMESSAGE="This location must be accessible to PHP.<br/>
Your <i>open_basedir</i> configuration in <i>php.ini</i> may restrict this."
Language file parsed OK.
Language file parsed OK in 4.4.0 but not in 4.4.1
Remove the new lineline in the text and language file now parses.
PLG_ACCESSMESSAGE="This location must be accessible to PHP.<br/>Your <i>open_basedir</i> configuration in <i>php.ini</i> may restrict this."
libraries/src/Language/LanguageHelper.php
Why has INI_SCANNER_RAW been added to parse_ini_file / parse_ini_string on lines 423, 425?
@parse_ini_file($fileName, false, INI_SCANNER_RAW);
Works in most cases, but got a couple of extensions where it fails to parse the language file.
Example parses OK
PLG_ACCESSMESSAGE="This location must be accessible to PHP.<br/>Your <i>open_basedir</i> configuration in <i>php.ini</i> may restrict this."
Exampe does not parse
PLG_ACCESSMESSAGE="This location must be accessible to PHP.<br/>
Your <i>open_basedir configuration in <i>php.ini may restrict this."
Labels |
Added:
No Code Attached Yet
|
Title |
|
||||||
Status | New | ⇒ | Closed | ||||
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-11-30 11:15:54 | ||||
Closed_By | ⇒ | bembelimen |
Found this information on parse_ini_file() function...
**The INI_SCANNER_NORMAL default option allows multiline values enclosed between quotes.
If you want to use the INI_SCANNER_RAW option, you must remove newlines in values.**
Well, could do that but makes maintaining a large .ini more difficult!
Why do we need INI_SCANNER_RAW?
Can we go back to INI_SCANNER_NORMAL for 4.4.2?
Maybe do that for 4.4.2 as a quick fix and for the longer term keep INI_SCANNER_RAW but get the file contents first and remove those newlines (with clever preg_replace) before calling parse_ini_string?
I assume the same issue applies to v5, but I have not checked.
==========================
See
php/php-src#11709