pull origin

This commit is contained in:
RichWeber
2014-08-01 00:32:08 +03:00
parent 5a8bd4747d
commit 92cd13a913
411 changed files with 4872 additions and 1587 deletions

View File

@@ -27,6 +27,7 @@ class BaseFileHelper
const PATTERN_MUSTBEDIR = 8;
const PATTERN_NEGATIVE = 16;
/**
* Normalizes a file/directory path.
* The normalization does the following work:
@@ -42,7 +43,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;
}
@@ -602,10 +603,8 @@ class BaseFileHelper
$result['flags'] |= self::PATTERN_NEGATIVE;
$pattern = StringHelper::byteSubstr($pattern, 1, StringHelper::byteLength($pattern));
}
$len = StringHelper::byteLength($pattern);
if ($len && StringHelper::byteSubstr($pattern, -1, 1) == '/') {
if (StringHelper::byteLength($pattern) && StringHelper::byteSubstr($pattern, -1, 1) == '/') {
$pattern = StringHelper::byteSubstr($pattern, 0, -1);
$len--;
$result['flags'] |= self::PATTERN_MUSTBEDIR;
}
if (strpos($pattern, '/') === false) {