Skip to content

Commit

Permalink
Merge pull request joomla#1448 from pjwiseman/28912
Browse files Browse the repository at this point in the history
[#28912] Browser doesn't respond when debug language is enabled
  • Loading branch information
LouisLandry committed Aug 16, 2012
2 parents 2000b44 + 08cc05b commit 6ebe9f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/joomla/language/language.php
Expand Up @@ -824,7 +824,7 @@ protected function parse($filename)

// 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();

Expand All @@ -842,6 +842,9 @@ protected function parse($filename)
// Check that the key is not in the blacklist and that the line format passes the regex.
$key = strtoupper(trim(substr($line, 0, strpos($line, '='))));

// Workaround to reduce regex complexity when matching escaped quotes
$line = str_replace('\"', '_QQ_', $line);

if (!preg_match($regex, $line) || in_array($key, $blacklist))
{
$errors[] = $lineNumber;
Expand Down

0 comments on commit 6ebe9f6

Please sign in to comment.