Skip to content

Commit

Permalink
Update @foreach and @forelse regex to fix #16085 and similar cases (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid authored and taylorotwell committed Oct 24, 2016
1 parent e9ed079 commit f0cf6fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/View/Compilers/BladeCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ protected function compileFor($expression)
*/
protected function compileForeach($expression)
{
preg_match('/\( *(.*) +as *([^\)]*)/is', $expression, $matches);
preg_match('/\( *(.*) +as *(.*)\)$/is', $expression, $matches);

$iteratee = trim($matches[1]);

Expand Down Expand Up @@ -624,7 +624,7 @@ protected function compileForelse($expression)
{
$empty = '$__empty_'.++$this->forelseCounter;

preg_match('/\( *(.*) +as *([^\)]*)/is', $expression, $matches);
preg_match('/\( *(.*) +as *(.*)\)$/is', $expression, $matches);

$iteratee = trim($matches[1]);

Expand Down

0 comments on commit f0cf6fa

Please sign in to comment.