Ticket #2622: commands.patch
File commands.patch, 1.3 KB (added by , 16 years ago) |
---|
-
.php
old new function FileUpload( $resourceType, $cur 169 169 170 170 $oFile = $_FILES['NewFile'] ; 171 171 172 // Map the virtual path to the local server path.173 $sServerDir = ServerMapFolder( $resourceType, $currentFolder, $sCommand ) ;174 175 172 // Get the uploaded file name. 176 173 $sFileName = $oFile['name'] ; 177 174 $sFileName = SanitizeFileName( $sFileName ) ; … … function FileUpload( $resourceType, $cur 182 179 $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; 183 180 $sExtension = strtolower( $sExtension ) ; 184 181 182 if ( $Config['QuickUploadFileDispatching'] ) { // #PATCH: automatically dispatch uploaded files 183 foreach ( $Config['ConfigAllowedTypes'] as $type ) { 184 if ( $type != 'File' && in_array ( $sExtension, $Config['AllowedExtensions'][$type] ) ) { 185 $resourceType = $type; 186 } 187 } 188 } 189 190 // Map the virtual path to the local server path. 191 $sServerDir = ServerMapFolder( $resourceType, $currentFolder, $sCommand ) ; // #PATCH: original line moved down 192 185 193 if ( isset( $Config['SecureImageUploads'] ) ) 186 194 { 187 195 if ( ( $isImageValid = IsImageValid( $oFile['tmp_name'], $sExtension ) ) === false )