aboutsummaryrefslogtreecommitdiffstats
path: root/includes/WebResponse.php
diff options
context:
space:
mode:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>2011-07-05 16:40:12 +0000
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>2011-07-05 16:40:12 +0000
commit303eb519247d7d5ca95dc3c52294743f58d0a6ec (patch)
tree07d686d61938311274ed9193c2b33d65d9c81009 /includes/WebResponse.php
parentb0bd1aae89014749f1d03ce805ed74664b02b977 (diff)
downloadmediawikicore-303eb519247d7d5ca95dc3c52294743f58d0a6ec.tar.gz
mediawikicore-303eb519247d7d5ca95dc3c52294743f58d0a6ec.zip
Per Brion, fix for r91460: make this a bit more robust
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91463
Diffstat (limited to 'includes/WebResponse.php')
-rw-r--r--includes/WebResponse.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/WebResponse.php b/includes/WebResponse.php
index a2d257c13a0e..6d443425c93f 100644
--- a/includes/WebResponse.php
+++ b/includes/WebResponse.php
@@ -87,8 +87,9 @@ class FauxResponse extends WebResponse {
*/
public function header( $string, $replace = true, $http_response_code = null ) {
$match = array();
- if ( preg_match( '~^HTTP/1.\d (\d+)\D*$~', $string, $match ) ) {
- $this->code = intval( $match[1] );
+ if ( substr( $string, 0, 5 ) == 'HTTP/' ) {
+ $parts = explode( ' ', $string, 3 );
+ $this->code = intval( $parts[1] );
} else {
list( $key, $val ) = explode( ":", $string, 2 );