dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da62fc4
)
Made getUndoText() not use unreliable getContent() function (weird wgRequest dependency)
author
Aaron Schulz
<aaron@users.mediawiki.org>
Sun, 12 Sep 2010 10:02:19 +0000
(10:02 +0000)
committer
Aaron Schulz
<aaron@users.mediawiki.org>
Sun, 12 Sep 2010 10:02:19 +0000
(10:02 +0000)
includes/Article.php
patch
|
blob
|
history
diff --git
a/includes/Article.php
b/includes/Article.php
index
c6bb41b
..
0999bdb
100644
(file)
--- a/
includes/Article.php
+++ b/
includes/Article.php
@@
-321,9
+321,13
@@
class Article {
* @return mixed string on success, false on failure
*/
public function getUndoText( Revision $undo, Revision $undoafter = null ) {
* @return mixed string on success, false on failure
*/
public function getUndoText( Revision $undo, Revision $undoafter = null ) {
+ $currentRev = Revision::newFromTitle( $this->mTitle );
+ if ( !$currentRev ) {
+ return false; // no page
+ }
$undo_text = $undo->getText();
$undoafter_text = $undoafter->getText();
$undo_text = $undo->getText();
$undoafter_text = $undoafter->getText();
- $cur_text = $
this->getConten
t();
+ $cur_text = $
currentRev->getTex
t();
if ( $cur_text == $undo_text ) {
# No use doing a merge if it's just a straight revert.
if ( $cur_text == $undo_text ) {
# No use doing a merge if it's just a straight revert.