Merge "Message::inLanguage() shouldn't unstub StubUserLang"
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index ff31eb6..4f6efd4 100644 (file)
@@ -65,8 +65,8 @@ class InfoAction extends FormlessAction {
         */
        public static function invalidateCache( Title $title ) {
                global $wgMemc;
-               // Clear page info.
-               $revision = WikiPage::factory( $title )->getRevision();
+
+               $revision = Revision::newFromTitle( $title, 0, Revision::READ_LATEST );
                if ( $revision !== null ) {
                        $key = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $revision->getId() );
                        $wgMemc->delete( $key );
@@ -246,13 +246,13 @@ class InfoAction extends FormlessAction {
                        $pageInfo['header-basic'][] = array(
                                $this->msg( 'pageinfo-redirectsto' ),
                                Linker::link( $this->page->getRedirectTarget() ) .
-                               $this->msg( 'word-separator' )->text() .
-                               $this->msg( 'parentheses', Linker::link(
+                               $this->msg( 'word-separator' )->escaped() .
+                               $this->msg( 'parentheses' )->rawParams( Linker::link(
                                        $this->page->getRedirectTarget(),
                                        $this->msg( 'pageinfo-redirectsto-info' )->escaped(),
                                        array(),
                                        array( 'action' => 'info' )
-                               ) )->text()
+                               ) )->escaped()
                        );
                }
 
@@ -434,6 +434,9 @@ class InfoAction extends FormlessAction {
                                        $message = $message->escaped();
                                }
                        }
+                       $expiry = $title->getRestrictionExpiry( $restrictionType );
+                       $formattedexpiry = $this->msg( 'parentheses', $this->getLanguage()->formatExpiry( $expiry ) )->escaped();
+                       $message .= $this->msg( 'word-separator' )->escaped() . $formattedexpiry;
 
                        // Messages: restriction-edit, restriction-move, restriction-create,
                        // restriction-upload