Skip to content

Commit e6a2af7

Browse files
committed
{link} disables URL checking
1 parent 2cbc947 commit e6a2af7

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"nette/forms": "^3.0",
3232
"nette/robot-loader": "^3.2",
3333
"nette/security": "^3.0",
34-
"latte/latte": "^2.10.2 || ^3.0",
34+
"latte/latte": "^2.10.2 || ^3.0.1",
3535
"tracy/tracy": "^2.6",
3636
"mockery/mockery": "^1.0",
3737
"phpstan/phpstan-nette": "^0.12"
@@ -41,7 +41,7 @@
4141
"nette/di": "<3.0.7",
4242
"nette/forms": "<3.0",
4343
"nette/schema": "<1.2",
44-
"latte/latte": "<2.7.1 || >=3.1",
44+
"latte/latte": "<2.7.1 || >=3.1 || =3.0.0",
4545
"tracy/tracy": "<2.5"
4646
},
4747
"autoload": {

src/Bridges/ApplicationLatte/Nodes/LinkNode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public static function create(Tag $tag): ?static
4040
$node->args = $tag->parser->parseArguments();
4141
$node->modifier = $tag->parser->parseModifier();
4242
$node->modifier->escape = true;
43+
$node->modifier->check = false;
4344
$node->mode = $tag->name;
4445

4546
if ($tag->isNAttribute()) {

tests/Bridges.Latte3/expected/isLinkCurrent.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
echo '>n:href after n:class</a>
1313

1414
<a href="';
15-
echo LR\Filters::escapeHtmlAttr(LR\Filters::safeUrl($this->global->uiControl->link('default'))) /* line 5 */;
15+
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default')) /* line 5 */;
1616
echo '"';
1717
echo ($ʟ_tmp = array_filter([$presenter->isLinkCurrent() ? 'current' : null])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($ʟ_tmp))) . '"' : "" /* line 5 */;
1818
echo '>href before n:class</a>
1919

2020
<a';
2121
echo ($ʟ_tmp = array_filter([$presenter->isLinkCurrent() ? 'current' : null])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($ʟ_tmp))) . '"' : "" /* line 7 */;
2222
echo ' href="';
23-
echo LR\Filters::escapeHtmlAttr(LR\Filters::safeUrl($this->global->uiControl->link('default'))) /* line 7 */;
23+
echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link('default')) /* line 7 */;
2424
echo '">href after n:class</a>
2525

2626
<a href="';

tests/Bridges.Latte3/{link}.2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ Assert::match(<<<'EOD'
111111
112112
{link $action}
113113
114-
<a href="{plink $arr['link'], $arr['param']|nocheck}"></a>
114+
<a href="{plink $arr['link'], $arr['param']}"></a>
115115
116-
<a href="{link default! 10, 'a' => 20, 'b' => 30|nocheck}"></a>
116+
<a href="{link default! 10, 'a' => 20, 'b' => 30}"></a>
117117
118118
<a n:href="Homepage:"></a>
119119

0 commit comments

Comments
 (0)