WordPress.org

Plugin Directory

Changeset 595971


Ignore:
Timestamp:
09/07/12 14:54:26 (20 months ago)
Author:
MarcusPope
Message:

fixed function reference issue for php4 users [JOBID: admin]

Location:
root-relative-urls/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • root-relative-urls/trunk/readme.txt

    r595485 r595971  
    109109== Changelog == 
    110110 
     111= 1.6 = 
     112* Bug fix: I really wish php < 5.3 would die - fixed incompatible funciton reference. 
     113 
    111114= 1.5 = 
    112115* Bug fix: Fixed an infinite redirect problem caused by a core bug in WordPress - http://core.trac.wordpress.org/ticket/21824 
  • root-relative-urls/trunk/sb_root_relative_urls.php

    r595485 r595971  
    99Author: Marcus E. Pope, marcuspope 
    1010Author URI: http://www.marcuspope.com 
    11 Version: 1.5 
     11Version: 1.6 
    1212 
    1313Copyright 2011 Marcus E. Pope (email : me@marcuspope.com) 
     
    153153    } 
    154154 
     155    static function fix_canonical_redirect($redirect, $requested) { 
     156        //Fixes infinite redirect loop caused by WP Core bug: http://core.trac.wordpress.org/ticket/21824 
     157        if (MP_WP_Root_Relative_URLS::proper_root_relative_url($redirect) == 
     158            MP_WP_Root_Relative_URLS::proper_root_relative_url($requested)) { 
     159            return false; 
     160        } 
     161    } 
     162    
    155163    static function init() { 
    156164        //Setup all hooks / filters for either dynamically replacing the host part of a URL with the current host 
     
    265273        ); 
    266274 
    267         add_filter('redirect_canonical', function($redirect, $requested) { 
    268             //Fixes infinite redirect loop caused by WP Core bug: http://core.trac.wordpress.org/ticket/21824 
    269             if (MP_WP_Root_Relative_URLS::proper_root_relative_url($redirect) == 
    270                 MP_WP_Root_Relative_URLS::proper_root_relative_url($requested)) { 
    271                 return false; 
    272             } 
    273         }, 10, 2); 
     275        add_filter( 
     276            'redirect_canonical', 
     277            array( 
     278                'MP_WP_Root_Relative_URLS', 
     279                'fix_canonical_redirect' 
     280            ), 
     281            10, 
     282            2 
     283        ); 
    274284    } 
    275285} 
Note: See TracChangeset for help on using the changeset viewer.