diff options
Diffstat (limited to 'libs/sysplugins/smarty_internal_configfilelexer.php')
| -rw-r--r-- | libs/sysplugins/smarty_internal_configfilelexer.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libs/sysplugins/smarty_internal_configfilelexer.php b/libs/sysplugins/smarty_internal_configfilelexer.php index 86143bcf..9180aecf 100644 --- a/libs/sysplugins/smarty_internal_configfilelexer.php +++ b/libs/sysplugins/smarty_internal_configfilelexer.php @@ -84,15 +84,15 @@ class Smarty_Internal_Configfilelexer if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^(#)|^(\\[)|^(\\])|^(=)|^([ \t\r]+)|^(\n)|^([0-9]*[a-zA-Z_]\\w*)/iS"; + $yy_global_pattern = "/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)/iS"; do { - if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) { + if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { $yysubmatches = $yymatches; $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns if (!count($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - 'an empty string. Input "' . substr($this->data, + ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state START'); } next($yymatches); // skip global match @@ -191,15 +191,15 @@ class Smarty_Internal_Configfilelexer if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^([ \t\r]+)|^(\\d+\\.\\d+(?=[ \t\r]*[\n#]))|^(\\d+(?=[ \t\r]*[\n#]))|^('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#]))|^(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#]))|^(\"\"\"([^\"]|\\\\\"|\"{1,2}[^\"])*\"\"\"(?=[ \t\r]*[\n#]))|^([a-zA-Z]+(?=[ \t\r]*[\n#]))|^([^\n]+?(?=[ \t\r]*\n))|^(\n)/iS"; + $yy_global_pattern = "/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G(\"\"\"([^\"]|\\\\\"|\"{1,2}[^\"])*\"\"\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS"; do { - if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) { + if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { $yysubmatches = $yymatches; $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns if (!count($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - 'an empty string. Input "' . substr($this->data, + ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state VALUE'); } next($yymatches); // skip global match @@ -312,15 +312,15 @@ class Smarty_Internal_Configfilelexer if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^([^\n]+?(?=[ \t\r]*\n))/iS"; + $yy_global_pattern = "/\G([^\n]+?(?=[ \t\r]*\n))/iS"; do { - if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) { + if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { $yysubmatches = $yymatches; $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns if (!count($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - 'an empty string. Input "' . substr($this->data, + ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state NAKED_STRING_VALUE'); } next($yymatches); // skip global match @@ -381,15 +381,15 @@ class Smarty_Internal_Configfilelexer if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^([ \t\r]+)|^([^\n]+?(?=[ \t\r]*\n))|^(\n)/iS"; + $yy_global_pattern = "/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS"; do { - if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) { + if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { $yysubmatches = $yymatches; $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns if (!count($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - 'an empty string. Input "' . substr($this->data, + ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state COMMENT'); } next($yymatches); // skip global match @@ -459,15 +459,15 @@ class Smarty_Internal_Configfilelexer if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^(\\.)|^(.*?(?=[\.=[\]\r\n]))/iS"; + $yy_global_pattern = "/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/iS"; do { - if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) { + if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { $yysubmatches = $yymatches; $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns if (!count($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - 'an empty string. Input "' . substr($this->data, + ' an empty string. Input "' . substr($this->data, $this->counter, 5) . '... state SECTION'); } next($yymatches); // skip global match |
