Merge "[Bug 41030] fix fatal error when rendering non-existing pages"
[lhc/web/wiklou.git] / includes / Revision.php
index 40e7734..2bc98c6 100644 (file)
@@ -118,15 +118,13 @@ class Revision implements IDBAccessObject {
         * @param $flags Integer Bitfield (optional)
         * @return Revision or null
         */
-       public static function newFromPageId( $pageId, $revId = 0, $flags = null ) {
+       public static function newFromPageId( $pageId, $revId = 0, $flags = 0 ) {
                $conds = array( 'page_id' => $pageId );
                if ( $revId ) {
                        $conds['rev_id'] = $revId;
                } else {
                        // Use a join to get the latest revision
                        $conds[] = 'rev_id = page_latest';
-                       // Callers assume this will be up-to-date
-                       $flags = is_int( $flags ) ? $flags : self::READ_LATEST; // b/c
                }
                return self::newFromConds( $conds, (int)$flags );
        }
@@ -894,7 +892,7 @@ class Revision implements IDBAccessObject {
         * @return String
         */
        public function getText( $audience = self::FOR_PUBLIC, User $user = null ) {
-               wfDeprecated( __METHOD__, '1.21' );
+               ContentHandler::deprecated( __METHOD__, '1.21' );
 
                $content = $this->getContent( $audience, $user );
                return ContentHandler::getContentText( $content ); # returns the raw content text, if applicable
@@ -944,7 +942,7 @@ class Revision implements IDBAccessObject {
         *                         or Revision::getSerializedData() as appropriate.
         */
        public function getRawText() {
-               wfDeprecated( __METHOD__, "1.21" );
+               ContentHandler::deprecated( __METHOD__, "1.21" );
 
                return $this->getText( self::RAW );
        }