[FileBackend] Added work-around for lack of temp url support in rgw.
[lhc/web/wiklou.git] / includes / EditPage.php
index 0e6eafb..f3c0237 100644 (file)
@@ -1283,7 +1283,7 @@ class EditPage {
 
                $status = Status::newGood();
 
-               wfProfileIn( __METHOD__  );
+               wfProfileIn( __METHOD__ );
                wfProfileIn( __METHOD__ . '-checks' );
 
                if ( !wfRunHooks( 'EditPage::attemptSave', array( $this ) ) ) {
@@ -1291,7 +1291,7 @@ class EditPage {
                        $status->fatal( 'hookaborted' );
                        $status->value = self::AS_HOOK_ERROR;
                        wfProfileOut( __METHOD__ . '-checks' );
-                       wfProfileOut( __METHOD__  );
+                       wfProfileOut( __METHOD__ );
                        return $status;
                }
 
@@ -1301,6 +1301,7 @@ class EditPage {
                } catch ( MWContentSerializationException $ex ) {
                        $status->fatal( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() );
                        $status->value = self::AS_PARSE_ERROR;
+                       wfProfileOut( __METHOD__ . '-checks' );
                        wfProfileOut( __METHOD__ );
                        return $status;
                }
@@ -1313,7 +1314,7 @@ class EditPage {
                                $status->setResult( false, $code );
 
                                wfProfileOut( __METHOD__ . '-checks' );
-                               wfProfileOut( __METHOD__  );
+                               wfProfileOut( __METHOD__ );
 
                                return $status;
                }
@@ -1649,12 +1650,7 @@ class EditPage {
                        $doEditStatus = $this->mArticle->doEditContent( $content, $this->summary, $flags,
                                                                                                                        false, null, $this->contentFormat );
 
-               if ( $doEditStatus->isOK() ) {
-                               $result['redirect'] = $content->isRedirect();
-                       $this->updateWatchlist();
-                       wfProfileOut( __METHOD__ );
-                       return $status;
-               } else {
+               if ( !$doEditStatus->isOK() ) {
                        // Failure from doEdit()
                        // Show the edit conflict page for certain recognized errors from doEdit(),
                        // but don't show it for errors from extension hooks
@@ -1669,6 +1665,11 @@ class EditPage {
                        wfProfileOut( __METHOD__ );
                        return $doEditStatus;
                }
+
+               $result['redirect'] = $content->isRedirect();
+               $this->updateWatchlist();
+               wfProfileOut( __METHOD__ );
+               return $status;
        }
 
        /**
@@ -1760,10 +1761,10 @@ class EditPage {
                        $editContent = $result;
                        wfProfileOut( __METHOD__ );
                        return true;
-               } else {
-                       wfProfileOut( __METHOD__ );
-                       return false;
                }
+
+               wfProfileOut( __METHOD__ );
+               return false;
        }
 
        /**