Skip to content

Commit

Permalink
Fix pattern matches.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drak committed Jul 16, 2012
1 parent f27776e commit 7299522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions twigify.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

$string = file_get_contents($fileName);
} else {
$string = file_get_contents(__DIR__.'/web/system/SettingsModule/Resources/views/Admin/modifyconfig.tpl');
$string = file_get_contents(__DIR__.'/web/system/SearchModule/Resources/views/User/form.tpl');
}

$string = str_replace('{/else}', '{% else %}', $string);
$string = str_replace('{/if}', '{% endif %}', $string);
$string = str_replace('{/for}', '{% endfor %}', $string);
$string = str_replace('{/foreach}', '{% endfor %}', $string);

$res = preg_match_all('/\{\s{0,}(.+?)\s{0,}\}/', $string, $matches);
$twig = new Twiggifier($string, $matches);
Expand Down
2 changes: 1 addition & 1 deletion twigify_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function convertModurl($match, $key)

public function convertPagesetvar($match, $key, $command = 'pagesetvar')
{
preg_match('/^pagesetvar (.+?)\s{0,}$/', $match, $matches);
preg_match('/^'.$command.' (.+?)\s{0,}$/', $match, $matches);

$name = '';
if (preg_match('/name=(?:"{0,1}|\'{0,1})(.+?)(?:"{0,1}|\'{0,1})\s|$/', $matches[1], $nameMatches)) {
Expand Down

0 comments on commit 7299522

Please sign in to comment.