[BUGFIX] Use local paths for image tests (EXT:install) 00/55300/2
authorTim Lochm├╝ller <tim@fruit-lab.de>
Tue, 9 Jan 2018 09:16:42 +0000 (10:16 +0100)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 9 Jan 2018 19:37:03 +0000 (20:37 +0100)
Use local paths for image tests in EXT:install to avoid
problems with PHP allow_url_fopen configuration.
The "data://" wrapper requires a allow_url_fopen=1
configuration.

Resolves: #78117
Releases: master, 8.7
Change-Id: I7b022dc7681f6e2d3344525e624575be7e6037e9
Reviewed-on: https://review.typo3.org/55300
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/install/Classes/SystemEnvironment/Check.php

index 7a2a909..83036d7 100644 (file)
@@ -712,8 +712,8 @@ class Check implements CheckInterface
             && function_exists('imagegif')
             && (imagetypes() & IMG_GIF)
         ) {
-            // See http://stackoverflow.com/a/13139830
-            $imageResource = @imagecreatefromgif('data://image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
+            // Do not use data:// wrapper to be independent of allow_url_fopen
+            $imageResource = @imagecreatefromgif(__DIR__ . '/../../Resources/Public/Images/TestInput/Test.gif');
             if (is_resource($imageResource)) {
                 imagedestroy($imageResource);
                 $this->messageQueue->enqueue(new FlashMessage(
@@ -767,7 +767,8 @@ class Check implements CheckInterface
             && function_exists('imagepng')
             && (imagetypes() & IMG_PNG)
         ) {
-            $imageResource = @imagecreatefrompng('data://image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII');
+            // Do not use data:// wrapper to be independent of allow_url_fopen
+            $imageResource = @imagecreatefrompng(__DIR__ . '/../../Resources/Public/Images/TestInput/Test.png');
             if (is_resource($imageResource)) {
                 imagedestroy($imageResource);
                 $this->messageQueue->enqueue(new FlashMessage(