From 0e43acc71c9afa24dd3125513a96423c3aadeddd Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 5 Feb 2007 23:26:26 +0000 Subject: [PATCH] * Add revText() to get non-public revision if user can, add rev_deleted constant for later use. --- includes/Revision.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index 3e7e77e5d4..f5a84ca26b 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -7,10 +7,11 @@ * @todo document */ class Revision { - const DELETED_TEXT = 1; - const DELETED_COMMENT = 2; - const DELETED_USER = 4; - const DELETED_RESTRICTED = 8; + const DELETED_TEXT = 1; + const DELETED_COMMENT = 2; + const DELETED_USER = 4; + const DELETED_RESTRICTED = 8; + const DELETED_NAME = 16; /** * Load a page revision from a given revision ID number. @@ -457,6 +458,18 @@ class Revision { } return $this->mText; } + + /** + * Fetch revision text if it's available to THIS user + * @return string + */ + function revText() { + if( !$this->userCan( self::DELETED_TEXT ) ) { + return ""; + } else { + return $this->getRawText(); + } + } /** * @return string -- 2.20.1