Skip to content

Commit 6427be1

Browse files
authored
Repairing trigger404() bug such that 404 works again without custom 404 handler
1 parent d2cf97d commit 6427be1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Bramus/Router/Router.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ public function trigger404($match = null){
367367
++$numHandled;
368368
}
369369
}
370-
if($numHandled == 0 and $this->notFoundCallback['/']) {
371-
$this->invoke($this->notFoundCallback['/']);
372-
} elseif ($numHandled == 0) {
373-
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
374-
}
370+
}
371+
if (($numHandled == 0) && (isset($this->notFoundCallback['/']))) {
372+
$this->invoke($this->notFoundCallback['/']);
373+
} elseif ($numHandled == 0) {
374+
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
375375
}
376376
}
377377

0 commit comments

Comments
 (0)