Skip to content

Commit

Permalink
Merge pull request #24 from OpenBuildings/images-urls
Browse files Browse the repository at this point in the history
Add workaround for images with absolute URL
  • Loading branch information
hkdobrev committed Aug 26, 2014
2 parents b4ead5b + 6a0ef65 commit 6b4bc72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion classes/Kohana/Jam/Form/Tart/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@ public function upload($name, array $options = array(), array $attributes = arra
{
$thumbnail = Arr::get($options, 'thumbnail');

$h('img', array('src' => URL::site($self->object()->$name->url($thumbnail, TRUE))));
$img_url = $self->object()->$name->url($thumbnail);
$h('img', array(
'src' => mb_strpos($img_url, '://') !== FALSE
? $img_url
: URL::site($img_url, TRUE)
));
}
});

Expand Down

0 comments on commit 6b4bc72

Please sign in to comment.