This feature request is inspired by the recent attempt to switch to the "raw" parser in Joomla 4.4.1/5.0.1.
The proposal suggests a modification to the language file parser in Joomla from the current "normal" mode to the more efficient and secure "raw" mode of parse_ini_string
for the Joomla 6.0 release. This change aims to improve performance while ensuring a more secure environment by eliminating string interpolation.
Parser Optimization: Switching to the "raw" parser mode provides significant performance advantages (parsing is ~30% faster). This mode specifically disallows string interpolation, thereby fortifying the platform against potential security vulnerabilities.
Backward Compatibility: To ensure a smooth transition and maintain backwards compatibility, the proposal suggests introducing a format="6.0"
attribute within the languages
and language
nodes of an extension's XML manifest file. This addition will signal the use of the new "raw" format. In addition, legacy language files are automatically converted to the raw format during installation.
Example of a new format language block in the XML manifest:
<languages format="6.0" folder="language">
<language tag="en-GB">en-GB/com_name.ini</language>
<language tag="en-GB">en-GB/com_name.sys.ini</language>
</languages>
Also, the 5.x->6.0 upgrade script should iterate all installed extensions and convert their language files to the new format.
COM_A="text1" "text2"
COM_A="text1
text2"
"
, \
, $
): COM_A="<a href=\"link\"> \$ C:\\Windows\\"
COM_A="<a href="link"> $ C:\Windows\"
COM_A='text'
COM_A="AAA" ;"test"
AAA
AAA" ;"test
Performance Improvement: By using the faster "raw" mode, Joomla's language file parsing can achieve a significant performance boost, resulting in faster load times and an overall improved user experience.
Security: Eliminating string interpolation ensures a more secure environment by mitigating potential risks.
This feature request is intended to initiate a constructive discussion within the Joomla community regarding the proposed parser change. Feedback, insights, and potential considerations from developers, contributors, and stakeholders are highly encouraged to collectively assess the feasibility, implications, and implementation strategies for this enhancement.
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-12-25 07:35:17 |
Closed_By | ⇒ | alikon |
Actually, I created this topic with the assumption that my patch #42463 will be accepted, but there is no direct connection between these two discussions.
Here I want to discuss how to change the format of language files in Joomla 6.0 (normal->raw), how to minimize possible problems while maintaining backward compatibility as much as possible, etc.
So, in my opinion, it's too early to close this discussion.
Labels |
Added:
Feature
|
Status | Closed | ⇒ | New |
Closed_Date | 2023-12-25 07:35:17 | ⇒ | |
Closed_By | alikon | ⇒ |
I will close it, reason is here: #42463 (comment)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-01-03 19:25:11 |
Closed_By | ⇒ | bembelimen |
please test #42463