mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
Fix #17181: Improved BaseUrl::isRelative($url)
performance
This commit is contained in:
@ -4,6 +4,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)
|
||||
|
@ -378,8 +378,7 @@ class BaseUrl
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user