Handle undefined PATH_INFO value

This commit is contained in:
billz
2025-08-20 08:11:51 -07:00
parent d9e00171b2
commit 5319b9dbbd
3 changed files with 5 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ $pluginManager = \RaspAP\Plugins\PluginManager::getInstance();
// Get the requested page
$extraFooterScripts = array();
$page = $_SERVER['PATH_INFO'];
$page = $_SERVER['PATH_INFO'] ?? '';
// Check if any plugin wants to handle the request
if (!$pluginManager->handlePageAction($page)) {

Submodule plugins updated: b8e51de448...054f6bc0ab

View File

@@ -76,8 +76,10 @@ class PluginManager
* Iterates over registered plugins and calls its associated method
* @param string $page
*/
public function handlePageAction(string $page): bool
public function handlePageAction(?string $page): bool
{
$page = $page ?? '';
foreach ($this->getInstalledPlugins() as $pluginClass) {
$plugin = new $pluginClass($this->pluginPath, $pluginClass);