(bug 15430) Cancel the upload process and rollback database changes in case no articl...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 26 Dec 2008 19:42:29 +0000 (19:42 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 26 Dec 2008 19:42:29 +0000 (19:42 +0000)
RELEASE-NOTES
includes/filerepo/LocalFile.php

index 80b88eb..70ad4bf 100644 (file)
@@ -563,6 +563,8 @@ The following extensions are migrated into MediaWiki 1.14:
 * (bug 16726) siprop=namespacealiases should also list localized aliases
 * (bug 16730) Added apprfiltercascade parameter to list=allpages to filter
   cascade-protected pages
+* (bug 15430) Cancel the upload process and rollback database changes in case 
+  no article associated with the file can be created 
 
 === Languages updated in 1.14 ===
 
index 899fbd0..9adac91 100644 (file)
@@ -913,7 +913,11 @@ class LocalFile extends File
                } else {
                        // New file; create the description page.
                        // There's already a log entry, so don't make a second RC entry
-                       $article->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC );
+                       $result = $article->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC );
+                       if ( !$result->isOK() ) {
+                               $dbw->rollback( __METHOD__ );
+                               return false;
+                       }
                }
 
                # Hooks, hooks, the magic of hooks...