WordPress.org

Make WordPress Core

Changes between Version 15 and Version 16 of Ticket #16855, comment 33


Ignore:
Timestamp:
03/24/2011 02:18:39 AM (9 years ago)
Author:
cogmios
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16855, comment 33

    v15 v16  
    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)
     1I changed the 11305 but to this:
    22
    33{{{
    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 UPDATE: NOT: because it causes the malformed URLs
    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')) ) {   
     4if ( $r['redirection'] > 1 && !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) )
     5{
     6 if ( $r['redirection']-- > 0 )
     7 {
    208   return $this->request($theHeaders['headers']['location'], $r);
     9 }
     10 else
     11 {
     12 return new WP_Error('http_request_failed', __('Too many redirects.'));
     13 }
    2114}
    2215}}}
    2316
    24 If it should redirect can be handled at other places :)
     17Otherwise  [ ' redirection ' ]  == 0 so it will always give this error.
    2518
    2619This looks good on the server as the first 750 uri's do not show 'Too many redirects'
    27 
    28 ''offtopic: but for the first time I get back some '<url> malformed' on 301's (so this is to be handled in the custom location builder since probably the new location urls are in yet another new form i did not expect).''
    2920
    3021For the situation 'safe mode' / 'open base dir' + Curl + ssl verify off: my run on the first 750 (running) :
     
    4031}}}
    4132
    42 (So with the fix above) (so no Maximum redirects followed anymore (at least in the first 750)). The malformed URL is cause by me: that piece of code needs an extra thing probably the extra parameter from Hakre.
     33the malformed ones are cause by a before-bug.