Project

General

Profile

Actions

Bug #79269

closed

Condition in ResourceCompressor::retrieveExternalFile makes no sense

Added by David Greiner over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-01-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi!

Trying to compress and concatenate external assets leads to an error. This happens because condition in ResourceCompressor::retrieveExternalFile:637-648 makes no sense.

if (!file_exists(PATH_site . $filename)
            && (md5($externalContent) !== md5(file_get_contents(PATH_site . $filename)))
        ) {
            GeneralUtility::writeFile(PATH_site . $filename, $externalContent);
        }

It is not possible to "file_get_contents" a file that not exists.

May be the following is a better condition:

 if (!file_exists(PATH_site . $filename) ||
            (file_exists(PATH_site . $filename) && md5($externalContent) !== md5(file_get_contents(PATH_site . $filename)))) {
            GeneralUtility::writeFile(PATH_site . $filename, $externalContent);
        }

Files

Actions #2

Updated by Gerrit Code Review over 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51270

Actions #3

Updated by Benni Mack over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51274

Actions #5

Updated by Benni Mack over 7 years ago

  • Status changed from Under Review to Resolved
Actions #6

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF