Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
patch issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Mar 14, 2017
1 parent 377a472 commit 10a78b5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/Flow/Extension/TSimple/TVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,20 @@ public function view()
}
else
{
foreach ($this->attributes as $key => $value)
$attributes = array_merge([$variable], $this->attributes);

foreach ($attributes as $key => $value)
{
$attributes[$key] = str_replace('\'', '"', $attributes[$key]);

if (preg_match('~^(?<a>[\'"])\X*(\k<a>)$~', $value, $match))
{
$this->attributes[$key] = mb_substr($value, 1, -1);
$attributes[$key] = mb_substr($value, 1, -1);
}
}

$storage = '$this->configure->di()->call(\'' . $callback . '\', ';
$export = var_export(array_merge([$variable], $this->attributes), true);
$export = var_export($attributes, true);
$regExp = sprintf('~\'(%s)\'~', self::REGEXP_VARIABLE);
$export = preg_replace($regExp, '$1', $export);
$export = preg_replace('~\'(-?[\d\.]+)\'~', '$1', $export);
Expand Down
4 changes: 2 additions & 2 deletions src/Flow/Flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ protected function compile()

preg_match_all('~"(\X+?)"~', $compile, $matches);

$this->_compile($compile);

foreach ($matches[1] as $match)
{
$this->_compile($compile, $match);
}

$this->_compile($compile);

return $compile;
}

Expand Down
10 changes: 9 additions & 1 deletion view/admin/bug.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@
<a class="{if $d}dir{else}file{/if}" href="{$file->getBasename()}{if $d}/{/if}">{$file->getBasename()}</a>
{if ! $d} - {$helper->str()->fileSize($file->getSize())} {/if}
</div>
{/foreach}
{/foreach}

{assign d true}

{if $d}
{else}
<a href="/{$request->attribute('controller')}/file/{$request->attribute('path')}/{$file->getBasename()}{if $d}/{/if}">{$file->getBasename()}</a>
- {$helper->str()->fileSize($file->getSize())}
{/if}

0 comments on commit 10a78b5

Please sign in to comment.