[BUGFIX] Use local paths for image tests (EXT:install) 11/55311/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:55:36 +0000 (20:55 +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/55311
Tested-by: TYPO3com <no-reply@typo3.com>
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 924b8cb..21608cc 100644 (file)
@@ -726,8 +726,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);
                 $status = new Status\OkStatus();
@@ -786,7 +786,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);
                 $status = new Status\OkStatus();