Fixed bug #3949: Files in typo3temp/GB have wrong permissions (thanks to Christian...
authorMichael Stucki <michael.stucki@typo3.org>
Fri, 27 Feb 2009 17:01:44 +0000 (17:01 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Fri, 27 Feb 2009 17:01:44 +0000 (17:01 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5102 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_stdgraphic.php

index 9fe3a8c..3ec5cee 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-02-27  Michael Stucki  <michael@typo3.org>
 
+       * Fixed bug #3949: Files in typo3temp/GB have wrong permissions (thanks to Christian Kuhn)
        * Fixed bug #10131: Use TYPO3 encryption key in initial state of random byte generation (ported from TYPO3_4-2, thanks to Marcus Krause)
        * Follow-up to #10083: Constant styles.content.imgtext.separateRows has a wrong default value. This was changed accidentally during a bugfix on 2009-01-09. Reverting back to the old bahaviour. Thanks to Adrian Fischer for pointing this out!
 
index c81b4b9..d0e188b 100644 (file)
@@ -2747,12 +2747,13 @@ class t3lib_stdGraphic  {
         * @param       pointer         The GDlib image resource pointer
         * @param       string          The filename to write to
         * @param       integer         The image quality (for JPEGs)
-        * @return      mixed           The output of either imageGif, imagePng or imageJpeg based on the filename to write
+        * @return      boolean         The output of either imageGif, imagePng or imageJpeg based on the filename to write
         * @see maskImageOntoImage(), scale(), output()
         */
        function ImageWrite($destImg, $theImage, $quality=0)    {
                imageinterlace ($destImg,0);
                $ext = strtolower(substr($theImage, strrpos($theImage, '.')+1));
+               $result = FALSE;
                switch ($ext)   {
                        case 'jpg':
                        case 'jpeg':
@@ -2760,7 +2761,7 @@ class t3lib_stdGraphic    {
                                        if ($quality == 0)      {
                                                $quality = $this->jpegQuality;
                                        }
-                                       return imageJpeg($destImg, $theImage, $quality);
+                                       $result = imageJpeg($destImg, $theImage, $quality);
                                }
                        break;
                        case 'gif':
@@ -2768,16 +2769,19 @@ class t3lib_stdGraphic  {
                                        if ($this->truecolor)   {
                                                imagetruecolortopalette($destImg, true, 256);
                                        }
-                                       return imageGif($destImg, $theImage);
+                                       $result = imageGif($destImg, $theImage);
                                }
                        break;
                        case 'png':
                                if (function_exists('imagePng'))        {
-                                       return ImagePng($destImg, $theImage);
+                                       $result = ImagePng($destImg, $theImage);
                                }
                        break;
                }
-               return false;           // Extension invalid or write-function does not exist
+               if ($result) {
+                       t3lib_div::fixPermissions($theImage); 
+               }
+               return $result;
        }