Skip to content

Commit 637fc37

Browse files
committed
Merge branch 'master' into sync-to-2-branch
2 parents ca1df5e + b46e267 commit 637fc37

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

framework/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Yii Framework 2 Change Log
1111
2.0.50 under development
1212
------------------------
1313

14+
- Bug #17181: Improved `BaseUrl::isRelative($url)` performance (sammousa, bizley, rob006)
1415
- Bug #17191: Fixed `BaseUrl::isRelative($url)` method in `yii\helpers\BaseUrl` (ggh2e3)
1516
- Bug #18469: Fixed `Link::serialize(array $links)` method in `yii\web\Link` (ggh2e3)
1617
- Bug #20040: Fix type `boolean` in `MSSQL` (terabytesoftw)

framework/helpers/BaseUrl.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ public static function home($scheme = false)
378378
*/
379379
public static function isRelative($url)
380380
{
381-
$urlComponents = parse_url($url, PHP_URL_SCHEME);
382-
return strncmp($url, '//', 2) && empty($urlComponents);
381+
return preg_match('~^[[:alpha:]][[:alnum:]+-.]*://|^//~', $url) === 0;
383382
}
384383

385384
/**

0 commit comments

Comments
 (0)