From 53851419a1230926295d324fe94236402b95aad9 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 18 Aug 2011 00:54:06 +0000 Subject: [PATCH] Upstreaming wikia change to WebRequest Trim trailing whitespace Tweak documentation --- includes/Article.php | 2 +- includes/WebRequest.php | 8 ++++---- includes/parser/ParserCache.php | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 591216d3ca..3af63513c7 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2106,7 +2106,7 @@ class PoolWorkArticleView extends PoolCounterWork { } /** - * @param $status Status + * @param $status Status */ function error( $status ) { global $wgOut; diff --git a/includes/WebRequest.php b/includes/WebRequest.php index cfb6ce146f..6c20324615 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -160,11 +160,11 @@ class WebRequest { return $proto . '://' . IP::combineHostAndPort( $host, $port, $stdPort ); } - + public static function detectProtocolAndStdPort() { return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? array( 'https', 443 ) : array( 'http', 80 ); } - + public static function detectProtocol() { list( $proto, $stdPort ) = self::detectProtocolAndStdPort(); return $proto; @@ -520,7 +520,7 @@ class WebRequest { * @return Boolean */ public function wasPosted() { - return $_SERVER['REQUEST_METHOD'] == 'POST'; + return isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] == 'POST'; } /** @@ -597,7 +597,7 @@ class WebRequest { * Return the request URI with the canonical service and hostname, path, * and query string. This will be suitable for use as an absolute link * in HTML or other output. - * + * * NOTE: This will output a protocol-relative URL if $wgServer is protocol-relative * * @return String diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index 9515859c97..b8cf1bb636 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -194,7 +194,6 @@ class ParserCache { * @param $parserOutput ParserOutput * @param $article Article * @param $popts ParserOptions - * @return void */ public function save( $parserOutput, $article, $popts ) { $expire = $parserOutput->getCacheExpiry(); -- 2.20.1