aboutsummaryrefslogtreecommitdiffstats
path: root/includes/WebResponse.php
diff options
context:
space:
mode:
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 );