Révision 6b24a280
Ajouté par Assos Assos il y a presque 4 ans
drupal7/misc/typo3/phar-stream-wrapper/src/Resolver/PharInvocationResolver.php | ||
---|---|---|
14 | 14 |
use TYPO3\PharStreamWrapper\Helper; |
15 | 15 |
use TYPO3\PharStreamWrapper\Manager; |
16 | 16 |
use TYPO3\PharStreamWrapper\Phar\Reader; |
17 |
use TYPO3\PharStreamWrapper\Phar\ReaderException; |
|
17 | 18 |
use TYPO3\PharStreamWrapper\Resolvable; |
18 | 19 |
|
19 | 20 |
class PharInvocationResolver implements Resolvable |
... | ... | |
59 | 60 |
{ |
60 | 61 |
$hasPharPrefix = Helper::hasPharPrefix($path); |
61 | 62 |
if ($flags === null) { |
62 |
$flags = static::RESOLVE_REALPATH | static::RESOLVE_ALIAS | static::ASSERT_INTERNAL_INVOCATION;
|
|
63 |
$flags = static::RESOLVE_REALPATH | static::RESOLVE_ALIAS; |
|
63 | 64 |
} |
64 | 65 |
|
65 | 66 |
if ($hasPharPrefix && $flags & static::RESOLVE_ALIAS) { |
... | ... | |
147 | 148 |
} |
148 | 149 |
// ensure the possible alias name (how we have been called initially) matches |
149 | 150 |
// the resolved alias name that was retrieved by the current possible base name |
150 |
$reader = new Reader($currentBaseName); |
|
151 |
$currentAlias = $reader->resolveContainer()->getAlias(); |
|
152 |
if ($currentAlias !== $possibleAlias) { |
|
151 |
try { |
|
152 |
$reader = new Reader($currentBaseName); |
|
153 |
$currentAlias = $reader->resolveContainer()->getAlias(); |
|
154 |
} catch (ReaderException $exception) { |
|
155 |
// most probably that was not a Phar file |
|
156 |
continue; |
|
157 |
} |
|
158 |
if (empty($currentAlias) || $currentAlias !== $possibleAlias) { |
|
153 | 159 |
continue; |
154 | 160 |
} |
155 | 161 |
$this->addBaseName($currentBaseName); |
... | ... | |
215 | 221 |
if (isset($this->baseNames[$baseName])) { |
216 | 222 |
return; |
217 | 223 |
} |
218 |
$this->baseNames[$baseName] = realpath($baseName); |
|
224 |
$this->baseNames[$baseName] = Helper::normalizeWindowsPath( |
|
225 |
realpath($baseName) |
|
226 |
); |
|
219 | 227 |
} |
220 | 228 |
|
221 | 229 |
/** |
Formats disponibles : Unified diff
-a