consolidate some theme path code between ssl and non-ssl

This commit is contained in:
Evan Prodromou 2010-10-14 00:59:53 -04:00
parent ca0323d01b
commit 74c5aa8f9a

View File

@ -134,15 +134,7 @@ class Theme
}
}
if ($path[strlen($path)-1] != '/') {
$path .= '/';
}
if ($path[0] != '/') {
$path = '/'.$path;
}
return 'https://'.$server.$path.$name;
$protocol = 'https';
} else {
@ -155,6 +147,15 @@ class Theme
}
}
$server = common_config($group, 'server');
if (empty($server)) {
$server = common_config('site', 'server');
}
$protocol = 'http';
}
if ($path[strlen($path)-1] != '/') {
$path .= '/';
}
@ -163,14 +164,7 @@ class Theme
$path = '/'.$path;
}
$server = common_config($group, 'server');
if (empty($server)) {
$server = common_config('site', 'server');
}
return 'http://'.$server.$path.$name;
}
return $protocol.'://'.$server.$path.$name;
}
/**