Ticket #1871: 1871_2.patch
File 1871_2.patch, 3.4 KB (added by , 15 years ago) |
---|
-
editor/filemanager/connectors/php/commands.php
219 219 220 220 if ( is_file( $sFilePath ) ) 221 221 { 222 if ( isset( $Config['ChmodOnUpload'] ) && !$Config['ChmodOnUpload'] ) 223 { 224 break ; 225 } 226 227 $permissions = 0777; 228 229 if ( isset( $Config['ChmodOnUpload'] ) && $Config['ChmodOnUpload'] ) 230 { 231 $permissions = $Config['ChmodOnUpload'] ; 232 } 233 222 234 $oldumask = umask(0) ; 223 chmod( $sFilePath, 0777) ;235 chmod( $sFilePath, $permissions ) ; 224 236 umask( $oldumask ) ; 225 237 } 226 238 -
editor/filemanager/connectors/php/config.php
47 47 // following setting enabled. 48 48 $Config['ForceSingleExtension'] = true ; 49 49 50 // Perform additional checks for image files 51 // if set to true, validate image size (using getimagesize)50 // Perform additional checks for image files. 51 // If set to true, validate image size (using getimagesize). 52 52 $Config['SecureImageUploads'] = true; 53 53 54 // What the user can do with this connector 54 // What the user can do with this connector. 55 55 $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ; 56 56 57 // Allowed Resource Types 57 // Allowed Resource Types. 58 58 $Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media') ; 59 59 60 60 // For security, HTML is allowed in the first Kb of data for files having the 61 61 // following extensions only. 62 62 $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ; 63 63 64 // After file is uploaded, sometimes it is required to change its permissions 65 // so that it was possible to access it at the later time. 66 // If possible, it is recommended to set more restrictive permissions, like 0755. 67 // Set to 0 to disable this feature. 68 // Note: not needed on Windows-based servers. 69 $Config['ChmodOnUpload'] = 0777 ; 70 71 // See comments above. 72 // Used when creating folders that does not exist. 73 $Config['ChmodOnFolderCreate'] = 0777 ; 74 64 75 /* 65 76 Configuration settings for each Resource Type 66 77 -
editor/filemanager/connectors/php/io.php
88 88 89 89 function CreateServerFolder( $folderPath, $lastFolder = null ) 90 90 { 91 global $Config ; 91 92 $sParent = GetParentFolder( $folderPath ) ; 92 93 93 94 // Ensure the folder path has no double-slashes, or mkdir may fail on certain platforms … … 118 119 // Enable error tracking to catch the error. 119 120 ini_set( 'track_errors', '1' ) ; 120 121 122 $permissions = 0777 ; 123 if ( isset( $Config['ChmodOnFolderCreate'] ) && $Config['ChmodOnFolderCreate'] ) 124 { 125 $permissions = $Config['ChmodOnFolderCreate'] ; 126 } 127 121 128 // To create the folder with 0777 permissions, we need to set umask to zero. 122 129 $oldumask = umask(0) ; 123 mkdir( $folderPath, 0777) ;130 mkdir( $folderPath, $permissions ) ; 124 131 umask( $oldumask ) ; 125 132 126 133 $sErrorMsg = $php_errormsg ;