diff --git a/ext/link_image/main.php b/ext/link_image/main.php index dd4e91d0..3183a41d 100644 --- a/ext/link_image/main.php +++ b/ext/link_image/main.php @@ -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); } }