Properly save status code in HTTPRequest
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 20 Feb 2013 21:03:02 +0000 (22:03 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 20 Feb 2013 21:03:02 +0000 (22:03 +0100)
wcfsetup/install/files/lib/util/HTTPRequest.class.php

index 54ba7fa405f8016b5069fa330473213610446185..52c7c16e6af1554492497e19b22f65cd9f98a2fc 100644 (file)
@@ -194,9 +194,9 @@ final class HTTPRequest {
                $regex = new Regex('^HTTP/1.(?:0|1) (\d{3})');
                if (!$regex->match($statusLine)) throw new SystemException("Unexpected status '".$statusLine."'");
                $matches = $regex->getMatches();
-               $statusCode = $matches[1];
+               $this->statusCode = $matches[1];
                
-               switch ($statusCode) {
+               switch ($this->statusCode) {
                        case '301':
                        case '302':
                        case '303':
@@ -232,7 +232,7 @@ final class HTTPRequest {
                        break;
                        
                        default:
-                               throw new SystemException("Got status '".$statusCode."' and I don't know how to handle it");
+                               throw new SystemException("Got status '".$this->statusCode."' and I don't know how to handle it");
                        break;
                }