mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
Handle undefined PATH_INFO value
This commit is contained in:
@@ -4,7 +4,7 @@ $pluginManager = \RaspAP\Plugins\PluginManager::getInstance();
|
|||||||
|
|
||||||
// Get the requested page
|
// Get the requested page
|
||||||
$extraFooterScripts = array();
|
$extraFooterScripts = array();
|
||||||
$page = $_SERVER['PATH_INFO'];
|
$page = $_SERVER['PATH_INFO'] ?? '';
|
||||||
|
|
||||||
// Check if any plugin wants to handle the request
|
// Check if any plugin wants to handle the request
|
||||||
if (!$pluginManager->handlePageAction($page)) {
|
if (!$pluginManager->handlePageAction($page)) {
|
||||||
|
|||||||
2
plugins
2
plugins
Submodule plugins updated: b8e51de448...054f6bc0ab
@@ -76,8 +76,10 @@ class PluginManager
|
|||||||
* Iterates over registered plugins and calls its associated method
|
* Iterates over registered plugins and calls its associated method
|
||||||
* @param string $page
|
* @param string $page
|
||||||
*/
|
*/
|
||||||
public function handlePageAction(string $page): bool
|
public function handlePageAction(?string $page): bool
|
||||||
{
|
{
|
||||||
|
$page = $page ?? '';
|
||||||
|
|
||||||
foreach ($this->getInstalledPlugins() as $pluginClass) {
|
foreach ($this->getInstalledPlugins() as $pluginClass) {
|
||||||
$plugin = new $pluginClass($this->pluginPath, $pluginClass);
|
$plugin = new $pluginClass($this->pluginPath, $pluginClass);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user