WordPress.org

Make WordPress Core

Changes between Version 6 and Version 7 of Ticket #16855, comment 33


Ignore:
Timestamp:
03/23/2011 10:35:07 PM (9 years ago)
Author:
cogmios
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16855, comment 33

    v6 v7  
    1313Where in this case  [ ' redirection ' ]  == 0 so it will always give this error. It should not check for the redirection amount but if the is_array location is present IMHO.
    1414
     15So... this works better:
    1516
     17{{{
     18// See #11305 - When running under safe mode, redirection is disabled above. Handle it manually.
     19if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) {
     20  // EDL see: 16855
     21  if (array_key_exists('location',$theHeaders['headers']))
     22 {
     23   return $this->request($theHeaders['headers']['location'], $r);
     24 }
     25                        //if ( $r['redirection']-- > 0 ) {
     26                        //      return $this->request($theHeaders['headers']['location'], $r);
     27                        //} else {
     28                        //      return new WP_Error('http_request_failed', __('Too many redirects.'));
     29                        //}
     30}
     31}}}
    1632
     33Now the correct redirection URL is stored in my request database.