77978[BUGFIX] Handle getFileContents in LocalDriver better
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oliver Klee +1
- JAKOTA Design Group GmbH +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Christian Kuhn +2
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 1
Review log 2124
-
Thomas Hohn uploaded patch set 1 02/28/23, 09:08
-
core-ci voted on patch set 1 V +1 02/28/23, 09:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38189
-
JAKOTA Design Group GmbH commented on patch set 1 CR +1 02/28/23, 09:51
I was wondering about your suggestion, if that would get rid of the php warning as well. -
Thomas Hohn commented on patch set 1 02/28/23, 09:56
Reply
Hi - no - I removed that since I realised that it would not. The price for getting rid of it is the is_read() "overhead" -
JAKOTA Design Group GmbH commented on patch set 1 CR -1 02/28/23, 10:29
Sadly this won't do. If $filePath is a external location like https://get.typo3.org/11.5.24 is_readable will always return false. But I'm not sure if this can even be the case here. I've just read the phpdoc above. -
Thomas Hohn commented on patch set 1 02/28/23, 11:03
Reply
If you look into calculateBasePath you will see that it's actually a path to a file and cant be an url -
JAKOTA Design Group GmbH commented on patch set 1 CR +1 02/28/23, 13:16
You are right! And how could it be a URL? This is the LocalDriver... -
JAKOTA Design Group GmbH commented on patch set 1 02/28/23, 13:25
LocalDriver.php:1354If for whatever reason file_get_contents returns false... is_readable($filePath) ? file_get_contents($filePath) ?: '' : ''; this should cover every scenario -
Thomas Hohn commented on patch set 1 02/28/23, 13:29
LocalDriver.php:1354Replyfile_get_contents either returns false or the content ?: would return false positives depending on the content... -
Thomas Hohn uploaded patch set 2
CR +1V +102/28/23, 13:50 -
core-ci voted on patch set 2 V +1 02/28/23, 13:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38212
-
JAKOTA Design Group GmbH commented on patch set 2 CR +1 02/28/23, 13:58
This should do the trick. -
JAKOTA Design Group GmbH commented on patch set 2 02/28/23, 19:50
LocalDriver.php:1354But if you want to, you can simplify this again to return is_readable($filePath) ? (string)file_get_contents($filePath) : ''; -
Thomas Hohn uploaded patch set 3
CR +1V +102/28/23, 20:09 -
Thomas Hohn commented on patch set 2 02/28/23, 20:09
LocalDriver.php:1354ReplyDone -
Oliver Klee voted on patch set 3 CR +1 02/28/23, 20:14
-
core-ci voted on patch set 3 V +1 02/28/23, 20:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38234
-
JAKOTA Design Group GmbH voted on patch set 3 CR +1 02/28/23, 20:19
-
Simon Schaufelberger voted on patch set 3 V +1 CR +1 02/28/23, 23:40
-
Christian Kuhn voted on patch set 3 V +1 CR +1 03/01/23, 08:35
-
Christian Kuhn voted on patch set 3 V 0 CR 0 03/01/23, 08:47
-
Christian Kuhn voted on patch set 3 V +1 CR +1 03/01/23, 10:12
-
Christian Kuhn voted on patch set 3 V +2 CR +2 03/01/23, 11:51
-
Christian Kuhn merged patch set 4 03/01/23, 11:51