Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Application/LinkGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Nette\Http\UrlScript;
use Nette\Routing\Router;
use Nette\Utils\Reflection;
use function array_intersect_key, array_key_exists, http_build_query, is_string, is_subclass_of, parse_str, preg_match, rtrim, str_contains, str_ends_with, strcasecmp, strlen, strncmp, strtr, substr, trigger_error, urldecode;
use function array_intersect_key, array_key_exists, http_build_query, in_array, is_string, is_subclass_of, parse_str, preg_match, rtrim, str_contains, str_ends_with, strcasecmp, strlen, strncmp, strtr, substr, trigger_error, urldecode;


/**
Expand Down Expand Up @@ -299,7 +299,7 @@ private function validateLinkTarget(
string $mode,
): void
{
if ($mode !== 'forward' && !(new UI\AccessPolicy($element))->isLinkable()) {
if (!in_array($mode, ['test', 'forward']) && !(new UI\AccessPolicy($element))->isLinkable()) {
throw new UI\InvalidLinkException("Link to forbidden $message from '{$presenter->getName()}:{$presenter->getAction()}'.");
} elseif ($presenter?->invalidLinkMode
&& (UI\ComponentReflection::parseAnnotation($element, 'deprecated') || $element->getAttributes(Attributes\Deprecated::class))
Expand Down