r19797 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19796‎ | r19797 | r19798 >
Date:23:26, 5 February 2007
Author:aaron
Status:old
Tags:
Comment:
* Add revText() to get non-public revision if user can, add rev_deleted constant for later use.
Modified paths:
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Revision.php
@@ -7,10 +7,11 @@
88 * @todo document
99 */
1010 class Revision {
11 - const DELETED_TEXT = 1;
12 - const DELETED_COMMENT = 2;
13 - const DELETED_USER = 4;
14 - const DELETED_RESTRICTED = 8;
 11+ const DELETED_TEXT = 1;
 12+ const DELETED_COMMENT = 2;
 13+ const DELETED_USER = 4;
 14+ const DELETED_RESTRICTED = 8;
 15+ const DELETED_NAME = 16;
1516
1617 /**
1718 * Load a page revision from a given revision ID number.
@@ -457,6 +458,18 @@
458459 }
459460 return $this->mText;
460461 }
 462+
 463+ /**
 464+ * Fetch revision text if it's available to THIS user
 465+ * @return string
 466+ */
 467+ function revText() {
 468+ if( !$this->userCan( self::DELETED_TEXT ) ) {
 469+ return "";
 470+ } else {
 471+ return $this->getRawText();
 472+ }
 473+ }
461474
462475 /**
463476 * @return string