1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-14 01:54:11 +02:00

Added rtrim, removed preg_match

This commit is contained in:
Dmitry Demidovsky
2015-12-05 17:51:58 +03:00
parent da70e92cc1
commit 3f02443c1f

View File

@@ -112,20 +112,15 @@ class Minify_Source_Factory {
/**
* @param string $path
* @param string $path
* @return string
*/
public function getNormalizedPath($path)
{
// turn windows-style slashes into unix-style
$norm = str_replace("\\", "/", $path);
// lowercase drive letter
if (preg_match('/^\w:/', $norm)) {
$norm = lcfirst($norm);
}
return $norm;
// turn windows-style slashes into unix-style,
// remove trailing slash
// and lowercase drive letter
return lcfirst(rtrim(str_replace('\\', '/', $path), '/'));
}