?
avatar irbian
irbian
11 Sep 2014

Steps to reproduce the issue

Segmentation fault when debugging language if there is an overriden string key starting with "_"

Expected result

Actual result

System information (as much as possible)

Additional comments

avatar irbian irbian - open - 11 Sep 2014
avatar infograf768
infograf768 - comment - 11 Sep 2014

I confirm we get
( ! ) Fatal error: Maximum function nesting level of '100' reached, aborting! in ROOT/libraries/joomla/language/language.php on line 1164

Such a string starting with an underscore in a "normal" ini will just trigger a parsing error in the debug.

To solve that error, as there is no reason to prevent a constant to start by an underscore, we just have to do this, i.e. add the underscore in the regex:

diff --git a/libraries/joomla/language/language.php b/libraries/joomla/language/language.php
index ee48981..f26bba7 100644
--- a/libraries/joomla/language/language.php
+++ b/libraries/joomla/language/language.php
@@ -862,5 +862,5 @@
            // Initialise variables for manually parsing the file for common errors.
            $blacklist = array('YES', 'NO', 'NULL', 'FALSE', 'ON', 'OFF', 'NONE', 'TRUE');
-           $regex = '/^(|(\[[^\]]*\])|([A-Z][A-Z0-9_\-\.]*\s*=(\s*(("[^"]*")|(_QQ_)))+))\s*(;.*)?$/';
+           $regex = '/^(|(\[[^\]]*\])|([A-Z_][A-Z0-9_\-\.]*\s*=(\s*(("[^"]*")|(_QQ_)))+))\s*(;.*)?$/';
            $this->debug = false;
            $errors = array();

But it will not solve in fact ANY parsing error in an xx-XX.override.ini file.
We always, instead of the debug, get the Fatal error there for any error (like a missing ")

It would be good to solve both issues at the same time, or I can make a PR for the underscore issue only for the moment.
What do you think?

avatar asika32764
asika32764 - comment - 11 Sep 2014

Just a question. Where can I get this issue template?

avatar infograf768
infograf768 - comment - 11 Sep 2014

Just create a string override in Language Manager=>Overrides
Enter directly in the fields
_CONSTANT
and
some text
Save, then save and close

You can edit an existing xx-XX.override.ini file to also test

avatar irbian
irbian - comment - 11 Sep 2014

As you say, there is no reason to donĀ“t allow keys starting with _ (as far as I know), but neither to allow it. (I got that error because I was making test and wanted to disable that entry easy) I think is more robust to simply catch that errors instead of modifying the regex

avatar infograf768
infograf768 - comment - 11 Sep 2014

The issue is that any error in an override.ini is not catched at all now...

avatar brianteeman brianteeman - change - 12 Sep 2014
Title
Segmentation fault when debugging language 
Segmentation fault when debugging language
Status New Confirmed
avatar brianteeman brianteeman - change - 3 Jan 2015
Title
Segmentation fault when debugging language 
Segmentation fault when debugging language
Labels Added: ?
avatar brianteeman brianteeman - change - 12 Nov 2015
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2015-11-12 13:45:09
Closed_By brianteeman
avatar brianteeman brianteeman - close - 12 Nov 2015
avatar brianteeman brianteeman - change - 12 Nov 2015
Title
Segmentation fault when debugging language 
Segmentation fault when debugging language
avatar brianteeman brianteeman - close - 12 Nov 2015
avatar brianteeman
brianteeman - comment - 12 Nov 2015

I can no longer replicate this. I assume it has been resolved elsewhere - if that is not the case and yu can provide new instructions to replicate the issue it can always be re-opened.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4270.

avatar infograf768
infograf768 - comment - 12 Nov 2015

oops, debug overrides is now fixed

Add a Comment

Login with GitHub to post a comment