X-Git-Url: http://git.cyclocoop.org/%24action?a=blobdiff_plain;f=includes%2FOutputPage.php;h=8f86b6e65709ce946ade5c2da259f8923cc6097d;hb=392af46809d831514f49618cdef1e1529d7fddf4;hp=ac90e6741b5d1bee9f05e604c8409372fe1cd1fd;hpb=e516a54238e0d017ba2f1cf7557dc4411bff6b6a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index ac90e6741b..8f86b6e657 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -647,24 +647,16 @@ class OutputPage extends ContextSource { $maxModified = max( $modifiedTimes ); $this->mLastModified = wfTimestamp( TS_RFC2822, $maxModified ); - if( empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) { + $clientHeader = $this->getRequest()->getHeader( 'If-Modified-Since' ); + if ( $clientHeader === false ) { wfDebug( __METHOD__ . ": client did not send If-Modified-Since header\n", false ); return false; } - # Make debug info - $info = ''; - foreach ( $modifiedTimes as $name => $value ) { - if ( $info !== '' ) { - $info .= ', '; - } - $info .= "$name=" . wfTimestamp( TS_ISO_8601, $value ); - } - # IE sends sizes after the date like this: # Wed, 20 Aug 2003 06:51:19 GMT; length=5202 # this breaks strtotime(). - $clientHeader = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] ); + $clientHeader = preg_replace( '/;.*$/', '', $clientHeader ); wfSuppressWarnings(); // E_STRICT system time bitching $clientHeaderTime = strtotime( $clientHeader ); @@ -675,6 +667,15 @@ class OutputPage extends ContextSource { } $clientHeaderTime = wfTimestamp( TS_MW, $clientHeaderTime ); + # Make debug info + $info = ''; + foreach ( $modifiedTimes as $name => $value ) { + if ( $info !== '' ) { + $info .= ', '; + } + $info .= "$name=" . wfTimestamp( TS_ISO_8601, $value ); + } + wfDebug( __METHOD__ . ": client sent If-Modified-Since: " . wfTimestamp( TS_ISO_8601, $clientHeaderTime ) . "\n", false ); wfDebug( __METHOD__ . ": effective Last-Modified: " . @@ -1724,7 +1725,7 @@ class OutputPage extends ContextSource { /** * Return a Vary: header on which to vary caches. Based on the keys of $mVaryHeader, * such as Accept-Encoding or Cookie - * + * * @return String */ public function getVaryHeader() { @@ -1999,7 +2000,11 @@ class OutputPage extends ContextSource { } $this->sendCacheControl(); + + wfRunHooks( 'AfterFinalPageOutput', array( &$this ) ); + ob_end_flush(); + wfProfileOut( __METHOD__ ); } @@ -2052,13 +2057,18 @@ class OutputPage extends ContextSource { * * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) ); * showErrorPage( 'titlemsg', $messageObject ); + * showErrorPage( $titleMessageObj, $messageObject ); * - * @param $title String: message key for page title + * @param $title Mixed: message key (string) for page title, or a Message object * @param $msg Mixed: message key (string) for page text, or a Message object * @param $params Array: message parameters; ignored if $msg is a Message object */ public function showErrorPage( $title, $msg, $params = array() ) { - $this->prepareErrorPage( $this->msg( $title ), $this->msg( 'errorpagetitle' ) ); + if( !$title instanceof Message ) { + $title = $this->msg( $title ); + } + + $this->prepareErrorPage( $title, $this->msg( 'errorpagetitle' ) ); if ( $msg instanceof Message ){ $this->addHTML( $msg->parse() ); @@ -2345,7 +2355,7 @@ $templates * Add a "return to" link pointing to a specified title * * @param $title Title to link - * @param $query String query string + * @param $query Array query string parameters * @param $text String text of the link (input is not escaped) */ public function addReturnTo( $title, $query = array(), $text = null ) { @@ -2385,7 +2395,7 @@ $templates $titleObj = Title::newMainPage(); } - $this->addReturnTo( $titleObj, $returntoquery ); + $this->addReturnTo( $titleObj, wfCgiToArray( $returntoquery ) ); } /** @@ -2963,6 +2973,9 @@ $templates 'wgPageContentLanguage' => $lang->getCode(), 'wgSeparatorTransformTable' => $compactSeparatorTransTable, 'wgDigitTransformTable' => $compactDigitTransTable, + 'wgDefaultDateFormat' => $lang->getDefaultDateFormat(), + 'wgMonthNames' => $lang->getMonthNamesArray(), + 'wgMonthNamesShort' => $lang->getMonthAbbreviationsArray(), 'wgRelevantPageName' => $relevantTitle->getPrefixedDBKey(), ); if ( $wgContLang->hasVariants() ) { @@ -3512,7 +3525,7 @@ $templates * Add a wikitext-formatted message to the output. * This is equivalent to: * - * $wgOut->addWikiText( wfMsgNoTrans( ... ) ) + * $wgOut->addWikiText( wfMessage( ... )->plain() ) */ public function addWikiMsg( /*...*/ ) { $args = func_get_args();