Changeset 17807

Show
Ignore:
Timestamp:
09/03/07 17:21:55 (10 months ago)
Author:
robertaccettura
Message:

Fix bug when blog is not in root directory (thanks for reporting this Eric Cheng).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • absoluterss/branches/1.1/absoluteRSS.php

    r17800 r17807  
    55Description: Adjusts your links in RSS to use absolute links so that they work correctly in all feed readers (and validate).  GPL Licensed. 
    66Author: Robert Accettura 
    7 Version: 1.1 
     7Version: 1.1.1 
    88Author URI: http://robert.accettura.com 
    99License: GPL (http://www.gnu.org/licenses/gpl.txt) 
     
    3030    global $doing_rss; 
    3131    if (is_feed() || $doing_rss) { 
     32        $home = parse_url(get_settings('home')); 
     33        $home = $home['scheme'].'://'.$home['host']; 
    3234        // replace <img src=""/> and <a href=""/> with absolute links 
    33         return preg_replace( "/<(a|img)(.*?)(href|src)=('|\")\/(.*?)('|\")/is", "<\\1\\2\\3=\"".get_settings('home')."/\\5\"", $content); 
     35        return preg_replace( "/<(a|img)(.*?)(href|src)=('|\")\/(.*?)('|\")/is", "<\\1\\2\\3=\"".$home."/\\5\"", $content); 
    3436    } 
    3537    // just return content untouched if it's not a feed