X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites%22%2C%22%22%29.%20%22?a=blobdiff_plain;f=includes%2FEditPage.php;h=fe0e95eed78b86dcce82f18d473c029c442ffab1;hb=b6b686c13b1d78525ae16150a201491c8d0b6451;hp=5102f7aa92deac6237406cece3376a428fc07e76;hpb=855b17cf2dc7ea45bb10d3a5fa799e84a5f3fd14;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 5102f7aa92..fe0e95eed7 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1420,7 +1420,7 @@ class EditPage { $this->isConflict = false; wfDebug( __METHOD__ . ": conflict suppressed; new section\n" ); } - } elseif ( $this->section == '' && $this->userWasLastToEdit( $wgUser->getId(), $this->edittime ) ) { + } elseif ( $this->section == '' && Revision::userWasLastToEdit( DB_MASTER, $this->mTitle->getArticleID(), $wgUser->getId(), $this->edittime ) ) { # Suppress edit conflict with self, except for section edits where merging is required. wfDebug( __METHOD__ . ": Suppressing edit conflict, same user.\n" ); $this->isConflict = false; @@ -1625,35 +1625,6 @@ class EditPage { } } - /** - * Check if no edits were made by other users since - * the time a user started editing the page. Limit to - * 50 revisions for the sake of performance. - * - * @param $id int - * @param $edittime string - * - * @return bool - */ - protected function userWasLastToEdit( $id, $edittime ) { - if ( !$id ) return false; - $dbw = wfGetDB( DB_MASTER ); - $res = $dbw->select( 'revision', - 'rev_user', - array( - 'rev_page' => $this->mTitle->getArticleID(), - 'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $edittime ) ) - ), - __METHOD__, - array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 50 ) ); - foreach ( $res as $row ) { - if ( $row->rev_user != $id ) { - return false; - } - } - return true; - } - /** * @private * @todo document @@ -2880,6 +2851,7 @@ HTML if ( $this->mTriedSave && !$this->mTokenOk ) { if ( $this->mTokenOkExceptSuffix ) { $note = wfMessage( 'token_suffix_mismatch' )->plain() ; + } else { $note = wfMessage( 'session_fail_preview' )->plain() ; } @@ -2890,7 +2862,7 @@ HTML ' [[#' . self::EDITFORM_ID . '|' . $wgLang->getArrow() . ' ' . wfMessage( 'continue-editing' )->text() . ']]'; } - $parserOptions = ParserOptions::newFromUser( $wgUser ); + $parserOptions = $this->mArticle->makeParserOptions( $this->mArticle->getContext() ); $parserOptions->setEditSection( false ); $parserOptions->setTidy( true ); $parserOptions->setIsPreview( true ); @@ -2926,7 +2898,6 @@ HTML } $rt = $content->getRedirectChain(); - if ( $rt ) { $previewHTML = $this->mArticle->viewRedirect( $rt, false ); } else {