Skip to content

Commit 76b5344

Browse files
committed
RoutingPanel: guard against non-string presenter/signal/action params
1 parent 6b6b71f commit 76b5344

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Bridges/ApplicationTracy/RoutingPanel.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ private function findSource(): \ReflectionClass|\ReflectionMethod|string|null
123123
{
124124
$params = $this->matched;
125125
$presenter = $params['presenter'] ?? '';
126+
if (!is_string($presenter)) {
127+
return null;
128+
}
126129
try {
127130
$class = $this->presenterFactory->getPresenterClass($presenter);
128131
} catch (Nette\Application\InvalidPresenterException) {
@@ -134,9 +137,10 @@ private function findSource(): \ReflectionClass|\ReflectionMethod|string|null
134137

135138
if (is_a($class, Nette\Application\UI\Presenter::class, allow_string: true)) {
136139
$rc = $class::getReflection();
137-
if (isset($params[Presenter::SignalKey])) {
140+
if (isset($params[Presenter::SignalKey]) && is_string($params[Presenter::SignalKey])) {
138141
return $rc->getSignalMethod($params[Presenter::SignalKey]);
139142
} elseif (isset($params[Presenter::ActionKey])
143+
&& is_string($params[Presenter::ActionKey])
140144
&& ($method = $rc->getActionRenderMethod($params[Presenter::ActionKey]))
141145
) {
142146
return $method;

0 commit comments

Comments
 (0)