Skip to content

Commit 5319b9d

Browse files
committed
Handle undefined PATH_INFO value
1 parent d9e0017 commit 5319b9d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

includes/page_actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Get the requested page
66
$extraFooterScripts = array();
7-
$page = $_SERVER['PATH_INFO'];
7+
$page = $_SERVER['PATH_INFO'] ?? '';
88

99
// Check if any plugin wants to handle the request
1010
if (!$pluginManager->handlePageAction($page)) {

plugins

Submodule plugins updated 1 file

src/RaspAP/Plugins/PluginManager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ public function getSidebar(): Sidebar
7676
* Iterates over registered plugins and calls its associated method
7777
* @param string $page
7878
*/
79-
public function handlePageAction(string $page): bool
79+
public function handlePageAction(?string $page): bool
8080
{
81+
$page = $page ?? '';
82+
8183
foreach ($this->getInstalledPlugins() as $pluginClass) {
8284
$plugin = new $pluginClass($this->pluginPath, $pluginClass);
8385

0 commit comments

Comments
 (0)