Fix logic that determines if a URL is relative or absolute in script() and cssLink()

This commit is contained in:
Craig Andrews 2009-08-08 22:56:42 -04:00
parent 1330998b9b
commit 060d5c4b8e

View File

@ -350,7 +350,7 @@ class HTMLOutputter extends XMLOutputter
function script($src, $type='text/javascript') function script($src, $type='text/javascript')
{ {
$url = parse_url($src); $url = parse_url($src);
if(! ($url->scheme || $url->host || $url->query || $url->fragment)) if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
{ {
$src = common_path($src) . '?version=' . LACONICA_VERSION; $src = common_path($src) . '?version=' . LACONICA_VERSION;
} }
@ -371,7 +371,7 @@ class HTMLOutputter extends XMLOutputter
function cssLink($src,$theme=null,$media=null) function cssLink($src,$theme=null,$media=null)
{ {
$url = parse_url($src); $url = parse_url($src);
if(! ($url->scheme || $url->host || $url->query || $url->fragment)) if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
{ {
if(file_exists(theme_file($src,$theme))){ if(file_exists(theme_file($src,$theme))){
$src = theme_path($src, $theme) . '?version=' . LACONICA_VERSION; $src = theme_path($src, $theme) . '?version=' . LACONICA_VERSION;