-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4ee3810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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."
4ee3810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change was for security purposes
4ee3810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some background information on the parseIniFile change? I have also been caught out because I had some multi-line ini strings in my extensions. And does this count as a backward compatibility break?
4ee3810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the PHP examples Joomla language handling is only interested in character strings.
https://www.php.net/manual/en/function.parse-ini-string.php
So we can forget all the other stuff.
We can also forget about using parse_ini_string.
In my pull request #42441 I am just in process of removing call to parse_ini_string() as it is pointless.
Will keep it in the $unexpectedFileContents handling section ... just in case someone doing something unexpected.
But if they are ... will Joomla language handling work in that scenario anyway? I doubt it!
4ee3810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4ee3810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the documentation is wrong and it needs to be corrected.
I have updated #42441 accordingly.
4ee3810
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which documentation? This one: https://docs.joomla.org/Creating_a_language_definition_file had a comment about single lines in 4.4.1 and 5.0.1 added yesterday (2023-12-01). This one does not mention it: https://developer.joomla.org/coding-standards/ini.html (and the link to the Specification of Language Files leads to a deleted page, and the link to the User Interface Text Guidelines does not mention it). I can't think of anywhere else to look.