WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #11305, comment 16


Ignore:
Timestamp:
03/23/11 22:44:20 (4 years ago)
Author:
cogmios
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11305, comment 16

    initial v1  
    1 ah I see why I get so many additional 'Too many redirects.' under non empty basepath on the server + redirect=0 (so on topic but not the complete topic) 
    2  
    3 {{{ 
    4 // See #11305 - When running under safe mode, redirection is disabled above. Handle it manually. 
    5                 if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) { 
    6                         if ( $r['redirection']-- > 0 ) { 
    7                                 return $this->request($theHeaders['headers']['location'], $r); 
    8                         } else { 
    9                                 return new WP_Error('http_request_failed', __('Too many redirects.')); 
    10                         }  
    11 }}} 
    12  
    13 Where 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. 
    14  
    15 So... this works better: 
    16  
    17 {{{ 
    18 // See #11305 - When running under safe mode, redirection is disabled above. Handle it manually. 
    19 if ( !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 }}} 
    32  
    33 Now the correct redirection URL is stored in my request database. 
     1see my comment on this in #16890 when redirect = 0