mirror of
https://github.com/mrclay/minify.git
synced 2025-08-17 19:37:22 +02:00
Added rtrim, removed preg_match
This commit is contained in:
@@ -112,20 +112,15 @@ class Minify_Source_Factory {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getNormalizedPath($path)
|
public function getNormalizedPath($path)
|
||||||
{
|
{
|
||||||
// turn windows-style slashes into unix-style
|
// turn windows-style slashes into unix-style,
|
||||||
$norm = str_replace("\\", "/", $path);
|
// remove trailing slash
|
||||||
|
// and lowercase drive letter
|
||||||
// lowercase drive letter
|
return lcfirst(rtrim(str_replace('\\', '/', $path), '/'));
|
||||||
if (preg_match('/^\w:/', $norm)) {
|
|
||||||
$norm = lcfirst($norm);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $norm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user