Skip to content

Commit

Permalink
Merge branch 'master' into sync-to-2-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jan 6, 2024
2 parents ca1df5e + b46e267 commit 637fc37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Yii Framework 2 Change Log
2.0.50 under development
------------------------

- Bug #17181: Improved `BaseUrl::isRelative($url)` performance (sammousa, bizley, rob006)
- Bug #17191: Fixed `BaseUrl::isRelative($url)` method in `yii\helpers\BaseUrl` (ggh2e3)
- Bug #18469: Fixed `Link::serialize(array $links)` method in `yii\web\Link` (ggh2e3)
- Bug #20040: Fix type `boolean` in `MSSQL` (terabytesoftw)
Expand Down
3 changes: 1 addition & 2 deletions framework/helpers/BaseUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ public static function home($scheme = false)
*/
public static function isRelative($url)
{
$urlComponents = parse_url($url, PHP_URL_SCHEME);
return strncmp($url, '//', 2) && empty($urlComponents);
return preg_match('~^[[:alpha:]][[:alnum:]+-.]*://|^//~', $url) === 0;
}

/**
Expand Down

0 comments on commit 637fc37

Please sign in to comment.