From: Bryan Tong Minh Date: Fri, 26 Dec 2008 19:42:29 +0000 (+0000) Subject: (bug 15430) Cancel the upload process and rollback database changes in case no articl... X-Git-Tag: 1.31.0-rc.0~43763 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=a15a28fadc4c2321ec86d3c24c964a2baa8bfe60;p=lhc%2Fweb%2Fwiklou.git (bug 15430) Cancel the upload process and rollback database changes in case no article associated with the file can be created --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 80b88eb0fa..70ad4bf672 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 899fbd0a9e..9adac91fdb 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -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...