diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b759c7..29253af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.5.12 + +* Fix strpos() type error. + ## 2.5.11 * Fix bad use of import. diff --git a/classes/RedirectManager.php b/classes/RedirectManager.php index 350e3e1..4745ac5 100644 --- a/classes/RedirectManager.php +++ b/classes/RedirectManager.php @@ -239,7 +239,8 @@ public function getLocation(RedirectRule $rule) break; } - if ($rule->getToScheme() !== Models\Redirect::SCHEME_AUTO + if (is_string($toUrl) + && $rule->getToScheme() !== Models\Redirect::SCHEME_AUTO && (strpos($toUrl, 'http://') === 0 || strpos($toUrl, 'https://') === 0) ) { $toUrl = str_replace(['https://', 'http://'], $rule->getToScheme() . '://', $toUrl); diff --git a/updates/version.yaml b/updates/version.yaml index 0e8f0fa..daea95e 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -93,3 +93,5 @@ - "Add PHP 8.0 version constraint and composer/installers package" 2.5.11: - "Minor fixes -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.5.11" +2.5.12: + - "Fix strpos() type error"