r49998 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49997‎ | r49998 | r49999 >
Date:10:34, 28 April 2009
Author:catrope
Status:deferred
Tags:
Comment:
EditOwn: Fix for cases where the revision table contains a revision with rev_page=0
Modified paths:
  • /trunk/extensions/EditOwn/EditOwn.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EditOwn/EditOwn.php
@@ -62,6 +62,14 @@
6363 $result = $cache[$user->getName()][$title->getArticleId()];
6464 return is_null($result);
6565 }
 66+
 67+ if(!$title->exists())
 68+ {
 69+ // Creation is allowed
 70+ $cache[$user->getName()][$title->getArticleId()] = null;
 71+ $result = null;
 72+ return true;
 73+ }
6674
6775 // Since there's no easy way to get the first revision,
6876 // we'll just do a DB query
@@ -73,7 +81,7 @@
7482 $row = $dbr->fetchObject($res);
7583 if(!$row)
7684 {
77 - // Nonexistent title? Creation is allowed
 85+ // Title with no revs, weird... allow creation
7886 $cache[$user->getName()][$title->getArticleId()] = null;
7987 $result = null;
8088 return true;

Status & tagging log