original_string: protected function curlGetReturn()
      {
          $follow = !isset($this->optionsPassed['CURLOPT_FOLLOWLOCATION'])
              || $this->optionsPassed['CURLOPT_FOLLOWLOCATION'];
          $headers = $this->fetchResponse['headers'];
          if ($follow && isset($headers['Location'])) {   // follow location
              $location = Html::getAbsUrl($this->options['CURLOPT_URL'], $headers['Location']);
              $this->debug->info('redirect', $location);
              if (\count(\array_keys($this->redirectHistory, $location)) > 1) {
                  // a -> b -> a   is OK
                  $this->debug->warn('redirect loop', $this->redirectHistory);
                  $return = false;
              } else {
                  if (\in_array($headers['Return-Code'], array(302,303))) {
                      $this->optionsPassed['CURLOPT_POSTFIELDS'] = null;
                      $this->optionsPassed['post'] = null;
                  }
                  $this->optionsPassed['cookies'] = $this->fetchResponse['cookies'];
                  unset($this->optionsPassed['url']); // url used by scrape()
                  unset($this->optionsPassed['CURLOPT_URL']);
                  $return = $this->fetchCurl($location, $this->optionsPassed);
              }
          } else {
              $this->redirectHistory = array();
              if ($headers && $headers['Return-Code'] != 200 && $follow) {
                  #$this->debug->log('fetchResponse', $this->fetchResponse);
                  $return = false;
              } else {
                  if (!empty($headers['Content-Encoding']) && $headers['Content-Encoding'] == 'gzip') {
                      $this->debug->info('decompressing gzip content');
                      $this->fetchResponse['body'] = Gzip::decompressString($this->fetchResponse['body']);
                  }
                  $return = $this->fetchResponse;
              }
          }
          return $return;
      }
code: protected function curlGetReturn()
      {
          $follow = !isset($this->optionsPassed['CURLOPT_FOLLOWLOCATION'])
              || $this->optionsPassed['CURLOPT_FOLLOWLOCATION'];
          $headers = $this->fetchResponse['headers'];
          if ($follow && isset($headers['Location'])) {   // follow location
              $location = Html::getAbsUrl($this->options['CURLOPT_URL'], $headers['Location']);
              $this->debug->info('redirect', $location);
              if (\count(\array_keys($this->redirectHistory, $location)) > 1) {
                  // a -> b -> a   is OK
                  $this->debug->warn('redirect loop', $this->redirectHistory);
                  $return = false;
              } else {
                  if (\in_array($headers['Return-Code'], array(302,303))) {
                      $this->optionsPassed['CURLOPT_POSTFIELDS'] = null;
                      $this->optionsPassed['post'] = null;
                  }
                  $this->optionsPassed['cookies'] = $this->fetchResponse['cookies'];
                  unset($this->optionsPassed['url']); // url used by scrape()
                  unset($this->optionsPassed['CURLOPT_URL']);
                  $return = $this->fetchCurl($location, $this->optionsPassed);
              }
          } else {
              $this->redirectHistory = array();
              if ($headers && $headers['Return-Code'] != 200 && $follow) {
                  #$this->debug->log('fetchResponse', $this->fetchResponse);
                  $return = false;
              } else {
                  if (!empty($headers['Content-Encoding']) && $headers['Content-Encoding'] == 'gzip') {
                      $this->debug->info('decompressing gzip content');
                      $this->fetchResponse['body'] = Gzip::decompressString($this->fetchResponse['body']);
                  }
                  $return = $this->fetchResponse;
              }
          }
          return $return;
      }
code_tokens: protected function curlGetReturn ( ) { $ follow = ! isset ( $ this -> optionsPassed [ 'CURLOPT_FOLLOWLOCATION' ] ) || $ this -> optionsPassed [ 'CURLOPT_FOLLOWLOCATION' ] ; $ headers = $ this -> fetchResponse [ 'headers' ] ; if ( $ follow && isset ( $ headers [ 'Location' ] ) ) { // follow location $ location = Html :: getAbsUrl ( $ this -> options [ 'CURLOPT_URL' ] , $ headers [ 'Location' ] ) ; $ this -> debug -> info ( 'redirect' , $ location ) ; if ( \ count ( \ array_keys ( $ this -> redirectHistory , $ location ) ) > 1 ) { // a -> b -> a   is OK $ this -> debug -> warn ( 'redirect loop' , $ this -> redirectHistory ) ; $ return = false ; } else { if ( \ in_array ( $ headers [ 'Return-Code' ] , array ( 302 , 303 ) ) ) { $ this -> optionsPassed [ 'CURLOPT_POSTFIELDS' ] = null ; $ this -> optionsPassed [ 'post' ] = null ; } $ this -> optionsPassed [ 'cookies' ] = $ this -> fetchResponse [ 'cookies' ] ; unset ( $ this -> optionsPassed [ 'url' ] ) ; // url used by scrape() unset ( $ this -> optionsPassed [ 'CURLOPT_URL' ] ) ; $ return = $ this -> fetchCurl ( $ location , $ this -> optionsPassed ) ; } } else { $ this -> redirectHistory = array ( ) ; if ( $ headers && $ headers [ 'Return-Code' ] != 200 && $ follow ) { #$this->debug->log('fetchResponse', $this->fetchResponse); $ return = false ; } else { if ( ! empty ( $ headers [ 'Content-Encoding' ] ) && $ headers [ 'Content-Encoding' ] == 'gzip' ) { $ this -> debug -> info ( 'decompressing gzip content' ) ; $ this -> fetchResponse [ 'body' ] = Gzip :: decompressString ( $ this -> fetchResponse [ 'body' ] ) ; } $ return = $ this -> fetchResponse ; } } return $ return ; }
docstring: Build return value from fetchResponse
  
  @return array|false
docstring_tokens: Build return value from fetchResponse