Index: trunk/phase3/includes/Revision.php |
— | — | @@ -7,10 +7,11 @@ |
8 | 8 | * @todo document |
9 | 9 | */ |
10 | 10 | 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; |
15 | 16 | |
16 | 17 | /** |
17 | 18 | * Load a page revision from a given revision ID number. |
— | — | @@ -457,6 +458,18 @@ |
458 | 459 | } |
459 | 460 | return $this->mText; |
460 | 461 | } |
| 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 | + } |
461 | 474 | |
462 | 475 | /** |
463 | 476 | * @return string |