Commit 045eb9f7 by AlexGx

Inline control structures are not allowed

parent 6d72c6a7
...@@ -514,8 +514,9 @@ class BaseFileHelper ...@@ -514,8 +514,9 @@ class BaseFileHelper
'flags' => 0, 'flags' => 0,
'firstWildcard' => false, 'firstWildcard' => false,
); );
if (!isset($pattern[0])) if (!isset($pattern[0])) {
return $result; return $result;
}
if ($pattern[0] == '!') { if ($pattern[0] == '!') {
$result['flags'] |= self::PATTERN_NEGATIVE; $result['flags'] |= self::PATTERN_NEGATIVE;
...@@ -527,11 +528,13 @@ class BaseFileHelper ...@@ -527,11 +528,13 @@ class BaseFileHelper
$len--; $len--;
$result['flags'] |= self::PATTERN_MUSTBEDIR; $result['flags'] |= self::PATTERN_MUSTBEDIR;
} }
if (strpos($pattern, '/') === false) if (strpos($pattern, '/') === false) {
$result['flags'] |= self::PATTERN_NODIR; $result['flags'] |= self::PATTERN_NODIR;
}
$result['firstWildcard'] = self::firstWildcardInPattern($pattern); $result['firstWildcard'] = self::firstWildcardInPattern($pattern);
if ($pattern[0] == '*' && self::firstWildcardInPattern(StringHelper::byteSubstr($pattern, 1, StringHelper::byteLength($pattern))) === false) if ($pattern[0] == '*' && self::firstWildcardInPattern(StringHelper::byteSubstr($pattern, 1, StringHelper::byteLength($pattern))) === false) {
$result['flags'] |= self::PATTERN_ENDSWITH; $result['flags'] |= self::PATTERN_ENDSWITH;
}
$result['pattern'] = $pattern; $result['pattern'] = $pattern;
return $result; return $result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment