comparison StatusCodes.inc @ 75:5e76b6feb2ad

Correct check for matchlength.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Fri, 12 Oct 2012 01:19:23 +0200
parents 1d5166aba2c5
children ff5fc61aa5ea
comparison
equal deleted inserted replaced
74:1d5166aba2c5 75:5e76b6feb2ad
300 */ 300 */
301 public static function codeFromHeader($header) 301 public static function codeFromHeader($header)
302 { 302 {
303 $matches = array(); 303 $matches = array();
304 preg_match('/HTTP\/\S+\s(\d+)/', $header, $matches); 304 preg_match('/HTTP\/\S+\s(\d+)/', $header, $matches);
305 if ($matches->length < 1) 305 if (count($matches) < 1)
306 throw new Exception("Not an http header"); 306 throw new Exception("Not an http header");
307 $n = $matches[1]; 307 $n = $matches[1];
308 return $n; 308 return $n;
309 } 309 }
310 } 310 }