mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-06 14:19:23 +08:00
Improved strtr calls
This commit is contained in:
@ -42,7 +42,7 @@ class BaseFileHelper
|
||||
*/
|
||||
public static function normalizePath($path, $ds = DIRECTORY_SEPARATOR)
|
||||
{
|
||||
$path = rtrim(strtr($path, ['/' => $ds, '\\' => $ds]), $ds);
|
||||
$path = rtrim(strtr($path, '/\\', $ds . $ds), $ds);
|
||||
if (strpos($ds . $path, "{$ds}.") === false && strpos($path, "{$ds}{$ds}") === false) {
|
||||
return $path;
|
||||
}
|
||||
|
Reference in New Issue
Block a user