use the global and well tested make_http() rather than local hostify()
This commit is contained in:
parent
5fdb54c9ec
commit
4f8332f3f7
1 changed files with 3 additions and 13 deletions
|
@ -21,16 +21,6 @@ class LinkImage extends Extension {
|
||||||
$config->set_default_string("ext_link-img_text-link_format", '$title - $id ($ext $size $filesize)');
|
$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) {
|
private function data(Image $image) {
|
||||||
global $config;
|
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.
|
$text_link = trim($text_link) == "" ? null : $text_link; // null blank setting so the url gets filled in on the text links.
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'thumb_src' => $this->hostify($image->get_thumb_link()),
|
'thumb_src' => make_http($image->get_thumb_link()),
|
||||||
'image_src' => $this->hostify($image->get_image_link()),
|
'image_src' => make_http($image->get_image_link()),
|
||||||
'post_link' => $this->hostify($_SERVER["REQUEST_URI"]),
|
'post_link' => make_http($_SERVER["REQUEST_URI"]),
|
||||||
'text_link' => $text_link);
|
'text_link' => $text_link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue