Plugin Directory

Changeset 570702


Ignore:
Timestamp:
07/11/2012 03:56:23 PM (14 years ago)
Author:
MarcusPope
Message:

Added missing fragment identifiers to urls

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

Legend:

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

    r492470 r570702  
    9898== Changelog ==
    9999
     100= 1.4 =
     101* Bug fix: Discovered url fragment identifiers were being dropped entirely from urls, which broke a couple ajax behaviors - most noticeably the menu editor.
     102
    100103= 1.3 =
    101104* Bug fix: Thanks to Kéri Norbert for noticing that 'get_comment_author_url' should not have been relativized
  • root-relative-urls/trunk/sb_root_relative_urls.php

    r492470 r570702  
    99Author: Marcus E. Pope, marcuspope
    1010Author URI: http://www.marcuspope.com
    11 Version: 1.3
     11Version: 1.4
    1212
    1313Copyright 2011 Marcus E. Pope (email : me@marcuspope.com)
     
    6565        $url = @parse_url($url);
    6666        $relative = ltrim(@$url['path'], '/') . (isset($url['query']) ? "?" . $url['query'] : '');
    67         return MP_WP_Root_Relative_URLS::scheme( 'http://' . @$_SERVER['HTTP_HOST'] . (!empty($relative) ? '/' . $relative: '') );
     67        return MP_WP_Root_Relative_URLS::scheme(
     68            'http://' . @$_SERVER['HTTP_HOST'] .
     69            (!empty($relative) ? '/' . $relative : '') .
     70            (isset($url['fragment']) ? '#' . $url['fragment'] : '')
     71        );
    6872    }
    6973
     
    114118        } else {
    115119            $url = @parse_url($url);
    116             return '/' . ltrim(@$url['path'], '/') . (isset($url['query']) ? "?" . $url['query'] : '');
     120            return '/' . ltrim(@$url['path'], '/') .
     121                (isset($url['query']) ? "?" . $url['query'] : '') .
     122                (isset($url['fragment']) ? '#' . $url['fragment'] : '');
    117123        }
    118124    }
Note: See TracChangeset for help on using the changeset viewer.