Skip to content

Commit

Permalink
🔧 Change include directive to catch-all
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylear committed Jul 23, 2021
1 parent 21e1960 commit 5bcce8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Modello.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,15 @@ private static function viewNeedsRecompiled(string $view, string $cached): bool
*/
private static function handleIncludes(string $view): string
{
preg_match_all('/@(include|extends)\( ?\'(\w+)\' ?\)/i', $view, $matches, PREG_SET_ORDER);
preg_match_all('/@(include|extends)\( ?\'(.*?)\' ?\)/i', $view, $matches, PREG_SET_ORDER);

// Recursively process includes and extends
foreach ($matches as $match) {
$included = self::read(self::makeViewPath($match[2]));
$view = str_replace($match[0], self::handleIncludes($included), $view);
}

return preg_replace('/@(include|extends)\( ?\'(\w+)\' ?\)/i', '', $view);
return preg_replace('/@(include|extends)\( ?\'(.*?)\' ?\)/i', '', $view);
}

/**
Expand Down

0 comments on commit 5bcce8a

Please sign in to comment.