Improved strtr calls

This commit is contained in:
Alexander Makarov
2014-07-23 16:19:28 +04:00
parent 81d5dd0163
commit 92c64994cd
3 changed files with 3 additions and 3 deletions

View File

@ -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;
}