wp/wp-includes/Requests/Response.php
changeset 18 be944660c56a
parent 7 cf61fcea0001
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    49 	 */
    49 	 */
    50 	public $status_code = false;
    50 	public $status_code = false;
    51 
    51 
    52 	/**
    52 	/**
    53 	 * Protocol version, false if non-blocking
    53 	 * Protocol version, false if non-blocking
       
    54 	 *
    54 	 * @var float|boolean
    55 	 * @var float|boolean
    55 	 */
    56 	 */
    56 	public $protocol_version = false;
    57 	public $protocol_version = false;
    57 
    58 
    58 	/**
    59 	/**
    95 	 *
    96 	 *
    96 	 * @return boolean True if redirect (3xx status), false if not.
    97 	 * @return boolean True if redirect (3xx status), false if not.
    97 	 */
    98 	 */
    98 	public function is_redirect() {
    99 	public function is_redirect() {
    99 		$code = $this->status_code;
   100 		$code = $this->status_code;
   100 		return in_array($code, array(300, 301, 302, 303, 307)) || $code > 307 && $code < 400;
   101 		return in_array($code, array(300, 301, 302, 303, 307), true) || $code > 307 && $code < 400;
   101 	}
   102 	}
   102 
   103 
   103 	/**
   104 	/**
   104 	 * Throws an exception if the request was not successful
   105 	 * Throws an exception if the request was not successful
   105 	 *
   106 	 *