Skip to content

Commit

Permalink
Fix strpos() type error
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Oct 5, 2021
1 parent 9b83ad0 commit ea79a0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.5.12

* Fix strpos() type error.

## 2.5.11

* Fix bad use of import.
Expand Down
3 changes: 2 additions & 1 deletion classes/RedirectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit ea79a0e

Please sign in to comment.