t3lib_div::mkdir() should suppress PHP warnings/errors
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 16 Mar 2008 14:25:33 +0000 (14:25 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 16 Mar 2008 14:25:33 +0000 (14:25 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3434 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 6d1fda5..28804e5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 
-2008-03-02  Martin Kutschker  <masi@typo3.org>
+2008-03-16  Martin Kutschker  <masi@typo3.org>
 
        * Fixed bug #7793: Argument 1 passed to t3lib_div::arrayToLogString() in module setting must not be null (thanks to Steffen Kamper)
+       * Fixed bug #7861: t3lib_div::mkdir() should suppress PHP warnings/errors (thanks to Francois Suter)
 
 2008-03-16  Ingo Renner  <ingo@typo3.org>
 
index 13db029..0626cfc 100755 (executable)
@@ -2736,13 +2736,15 @@ class t3lib_div {
         */
        public static function mkdir($theNewFolder)     {
                $theNewFolder = preg_replace('|/$|','',$theNewFolder);
-               if (mkdir($theNewFolder, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']))){
+               if (@mkdir($theNewFolder, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']))){
                        chmod($theNewFolder, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'])); //added this line, because the mode at 'mkdir' has a strange behaviour sometimes
 
                        if($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'])    {       // skip this if createGroup is empty
-                               chgrp($theNewFolder, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']);
+                               @chgrp($theNewFolder, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']);
                        }
-                       return TRUE;
+                       return true;
+               } else {
+                       return false;
                }
        }