Skip to content

Commit

Permalink
Merge pull request #2668 from neos/task/drop-useless-unicode-safe-fun…
Browse files Browse the repository at this point in the history
…ction

TASK: Drop call to unicode-safe pathinfo()
  • Loading branch information
kdambekalns authored Mar 10, 2022
2 parents 6832106 + 405dbc2 commit 0a19f92
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
use Neos\Error\Messages\Error;
use Neos\Flow\ResourceManagement\CollectionInterface;
use Neos\Flow\ResourceManagement\Storage\PackageStorage;
use Neos\Flow\ResourceManagement\Target\Exception as TargetException;
use Neos\Flow\Utility\Algorithms;
use Neos\Utility\Files;
use Neos\Utility\Unicode\Functions as UnicodeFunctions;
use Neos\Flow\ResourceManagement\Target\Exception as TargetException;

/**
* A target which publishes resources by creating symlinks.
Expand Down Expand Up @@ -58,8 +57,9 @@ public function publishCollection(CollectionInterface $collection, callable $cal
*/
protected function publishFile($sourceStream, $relativeTargetPathAndFilename)
{
$pathInfo = UnicodeFunctions::pathinfo($relativeTargetPathAndFilename);
if (isset($pathInfo['extension']) && array_key_exists(strtolower($pathInfo['extension']), $this->excludedExtensions) && $this->excludedExtensions[strtolower($pathInfo['extension'])] === true) {
$pathInfo = pathinfo($relativeTargetPathAndFilename);
$extension = isset($pathInfo['extension']) ? strtolower($pathInfo['extension']) : null;
if ($extension !== null && array_key_exists($extension, $this->excludedExtensions) && $this->excludedExtensions[$extension] === true) {
throw new TargetException(sprintf('Could not publish "%s" into resource publishing target "%s" because the filename extension "%s" is excluded.', $sourceStream, $this->name, strtolower($pathInfo['extension'])), 1447152230);
}

Expand Down

0 comments on commit 0a19f92

Please sign in to comment.