Exemplo n.º 1
0
 /**
  * Handle a redirect response
  *
  */
 static function Redirect($headers, $r, $arrURL)
 {
     if ($r['redirection']-- < 0) {
         trigger_error('Too many redirects');
         return false;
     }
     //check location for releative value
     $location = $headers['headers']['location'];
     if (is_array($location)) {
         $location = array_pop($location);
     }
     if ($location[0] == '/') {
         $location = $arrURL['scheme'] . '://' . $arrURL['host'] . $location;
     }
     self::$redirected = $location;
     return gpRemoteGet::_get($location, $r);
 }