use the global and well tested make_http() rather than local hostify()

This commit is contained in:
Shish 2012-05-23 11:50:04 +01:00
parent 5fdb54c9ec
commit 4f8332f3f7

View file

@ -21,16 +21,6 @@ class LinkImage extends Extension {
$config->set_default_string("ext_link-img_text-link_format", '$title - $id ($ext $size $filesize)');
}
private function hostify(/*string*/ $str) {
$str = str_replace(" ", "%20", $str);
if(strpos($str, "ttp://") > 0) {
return $str;
}
else {
return "http://" . $_SERVER["HTTP_HOST"] . $str;
}
}
private function data(Image $image) {
global $config;
@ -38,9 +28,9 @@ class LinkImage extends Extension {
$text_link = trim($text_link) == "" ? null : $text_link; // null blank setting so the url gets filled in on the text links.
return array(
'thumb_src' => $this->hostify($image->get_thumb_link()),
'image_src' => $this->hostify($image->get_image_link()),
'post_link' => $this->hostify($_SERVER["REQUEST_URI"]),
'thumb_src' => make_http($image->get_thumb_link()),
'image_src' => make_http($image->get_image_link()),
'post_link' => make_http($_SERVER["REQUEST_URI"]),
'text_link' => $text_link);
}
}