diff --git a/Neos.Cache/Classes/Backend/FileBackend.php b/Neos.Cache/Classes/Backend/FileBackend.php index ec4711633e..e56526c83c 100644 --- a/Neos.Cache/Classes/Backend/FileBackend.php +++ b/Neos.Cache/Classes/Backend/FileBackend.php @@ -245,11 +245,15 @@ public function findIdentifiersByTag(string $searchedTag): array * specified tags. * * @param string[] $tags The tags to search for - * @return string[] An array with identifiers of all matching entries. An empty array if no entries matched + * @return string[] An array with identifiers of all matching entries. An empty array if no entries matched or no tags were provided * @api */ public function findIdentifiersByTags(array $tags): array { + if (empty($tags)) { + return []; + } + $entryIdentifiers = []; $now = $_SERVER['REQUEST_TIME']; $cacheEntryFileExtensionLength = strlen($this->cacheEntryFileExtension); diff --git a/Neos.Eel/Resources/Private/PHP/php-peg/Parser.php b/Neos.Eel/Resources/Private/PHP/php-peg/Parser.php index a30fdbcd3d..cf92c682e3 100644 --- a/Neos.Eel/Resources/Private/PHP/php-peg/Parser.php +++ b/Neos.Eel/Resources/Private/PHP/php-peg/Parser.php @@ -9,6 +9,11 @@ * the bracket if a failed match + restore has moved the current position backwards - so we have to check that too. */ class ParserRegexp { + protected $parser = null; + protected $rx = ''; + protected $matches = null; + protected $match_pos = null; + protected $check_pos = null; function __construct($parser, $rx) { $this->parser = $parser; @@ -50,6 +55,10 @@ function match() { * for result construction and building */ class Parser { + public $string = ''; + public $pos = 0; + protected $depth = 0; + protected $regexps = []; function __construct($string) { $this->string = $string; @@ -211,6 +220,9 @@ function store(&$result, $subres, $storetag = NULL) { * @author Hamish Friedlander */ class Packrat extends Parser { + protected $packstatebase = ''; + protected $packstate = []; + protected $packres = []; function __construct($string) { parent::__construct($string); diff --git a/Neos.Flow/Classes/ResourceManagement/Streams/ResourceStreamWrapper.php b/Neos.Flow/Classes/ResourceManagement/Streams/ResourceStreamWrapper.php index d7690d1ab2..559ffd6b3a 100644 --- a/Neos.Flow/Classes/ResourceManagement/Streams/ResourceStreamWrapper.php +++ b/Neos.Flow/Classes/ResourceManagement/Streams/ResourceStreamWrapper.php @@ -475,7 +475,11 @@ public function resourceStat() */ public function pathStat($path, $flags) { - return @stat($this->evaluateResourcePath($path)); + $evaluatedResourcePath = $this->evaluateResourcePath($path); + if (is_resource($evaluatedResourcePath)) { + return @fstat($evaluatedResourcePath); + } + return @stat($evaluatedResourcePath); } /** diff --git a/Neos.Flow/Classes/Security/Exception/InvalidHashException.php b/Neos.Flow/Classes/Security/Exception/InvalidHashException.php index f2d6286ba1..bef7ed180a 100644 --- a/Neos.Flow/Classes/Security/Exception/InvalidHashException.php +++ b/Neos.Flow/Classes/Security/Exception/InvalidHashException.php @@ -18,4 +18,5 @@ */ class InvalidHashException extends \Neos\Flow\Security\Exception { + protected $statusCode = 400; } diff --git a/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Routing.rst b/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Routing.rst index 0f8a804249..0120098f95 100644 --- a/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Routing.rst +++ b/Neos.Flow/Documentation/TheDefinitiveGuide/PartIII/Routing.rst @@ -58,7 +58,7 @@ But let's start with an easy example: ``name`` is optional, but it's recommended to set a name for all routes to make debugging easier. -If you insert these lines at the beginning of the file ``Configurations/Routes.yaml``, +If you insert these lines at the beginning of the file ``Configuration/Routes.yaml``, the ``indexAction`` of the ``StandardController`` in your *My.Demo* package will be called when you open up the homepage of your Flow installation (``http://localhost/``). diff --git a/Neos.Flow/Resources/Private/Installer/Distribution/Defaults/Web/_Resources/.htaccess b/Neos.Flow/Resources/Private/Installer/Distribution/Defaults/Web/_Resources/.htaccess index db138077c0..ba2094276d 100644 --- a/Neos.Flow/Resources/Private/Installer/Distribution/Defaults/Web/_Resources/.htaccess +++ b/Neos.Flow/Resources/Private/Installer/Distribution/Defaults/Web/_Resources/.htaccess @@ -8,9 +8,9 @@ SetHandler default-handler SetHandler default-handler - + php_flag engine off - + php_flag engine off diff --git a/Neos.Flow/Tests/Unit/ResourceManagement/Streams/ResourceStreamWrapperTest.php b/Neos.Flow/Tests/Unit/ResourceManagement/Streams/ResourceStreamWrapperTest.php index 637ca7f159..781380b055 100644 --- a/Neos.Flow/Tests/Unit/ResourceManagement/Streams/ResourceStreamWrapperTest.php +++ b/Neos.Flow/Tests/Unit/ResourceManagement/Streams/ResourceStreamWrapperTest.php @@ -100,6 +100,22 @@ public function openResolvesAnUpperCaseSha1HashUsingTheResourceManager() self::assertSame($tempFile, ObjectAccess::getProperty($this->resourceStreamWrapper, 'handle', true)); } + /** + * @test + */ + public function resourceStreamWrapperAllowsStatOfValidResourceLinks() + { + $sha1Hash = '68ac906495480a3404beee4874ed853a037a7a8f'; + + $tempFile = tmpfile(); + + $mockResource = $this->getMockBuilder(PersistentResource::class)->disableOriginalConstructor()->getMock(); + $this->mockResourceManager->expects(self::once())->method('getResourceBySha1')->with($sha1Hash)->will(self::returnValue($mockResource)); + $this->mockResourceManager->expects(self::once())->method('getStreamByResource')->with($mockResource)->will(self::returnValue($tempFile)); + + self::assertIsArray($this->resourceStreamWrapper->pathStat('resource://' . $sha1Hash, 0)); + } + /** * @test */