From 034f8d56d408c36e8a5df6d577969bb00df48b31 Mon Sep 17 00:00:00 2001 From: John Hinojosa Date: Wed, 12 Aug 2009 17:17:26 -0500 Subject: [PATCH] fixed DT#5095 When upload a file mp3 with the same name, this file mp3 is renamed. change to $sErrorNumber = 201 to a $sErrorNumber = 0 --- .../editor/filemanager/connectors/php/commands.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php index cf7a3df039..856634f83d 100755 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php @@ -214,7 +214,7 @@ function FileUpload( $resourceType, $currentFolder, $sCommand ) // Get the extension. $sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; $sExtension = strtolower( $sExtension ) ; - + if ( isset( $Config['SecureImageUploads'] ) ) { if ( ( $isImageValid = IsImageValid( $oFile['tmp_name'], $sExtension ) ) === false ) @@ -245,7 +245,7 @@ function FileUpload( $resourceType, $currentFolder, $sCommand ) { $iCounter++ ; $sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ; - $sErrorNumber = '201' ; + $sErrorNumber = '0' ; //Change sErrorNumber $ 201 to 0 to allow create record files renamed } else { @@ -273,7 +273,6 @@ function FileUpload( $resourceType, $currentFolder, $sCommand ) break ; } } - if ( file_exists( $sFilePath ) ) { //previous checks failed, try once again @@ -294,7 +293,6 @@ function FileUpload( $resourceType, $currentFolder, $sCommand ) } else $sErrorNumber = '202' ; - if ($sErrorNumber == '0') { // While we are in a course: Registering the newly uploaded file in the course's database.