diff --git a/src/IFramePage.php b/src/IFramePage.php index bd11733..2715c52 100644 --- a/src/IFramePage.php +++ b/src/IFramePage.php @@ -142,8 +142,8 @@ class IFramePage extends Page //whitelist allowed URL schemes $allowed_schemes = array('http', 'https'); - if ($matches = parse_url($this->IFrameURL)) { - if (isset($matches['scheme']) && !in_array($matches['scheme'], $allowed_schemes)) { + if ($matches = parse_url($this->IFrameURL ?? '')) { + if (isset($matches['scheme']) && !in_array($matches['scheme'], $allowed_schemes ?? [])) { $result->addError(_t(__CLASS__ . '.VALIDATION_BANNEDURLSCHEME', "This URL scheme is not allowed.")); } } diff --git a/src/IFramePageController.php b/src/IFramePageController.php index 2050a1e..6a5ea22 100644 --- a/src/IFramePageController.php +++ b/src/IFramePageController.php @@ -16,8 +16,8 @@ class IFramePageController extends PageController if ($desiredProtocol && $currentProtocol !== $desiredProtocol) { $enforcedLocation = preg_replace( "#^${currentProtocol}#", - $desiredProtocol, - $this->AbsoluteLink() + $desiredProtocol ?? '', + $this->AbsoluteLink() ?? '' ); return $this->redirect($enforcedLocation); }