From b1a91d8a59cc27623989d5d79643fb167c6d0aa9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 11 Nov 2005 11:38:54 +0000 Subject: =?UTF-8?q?work-around=20per=20tipi=20icone=20mal=20dichiarati:=20?= =?UTF-8?q?se=20non=20dichiarata=20come=20un'immagine,=20=C3=A8=20un=20ima?= =?UTF-8?q?ge/x-icon=20(ugh)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Bookmarks/M/DB/Links.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib/Bookmarks/M/DB/Links.pm') diff --git a/lib/Bookmarks/M/DB/Links.pm b/lib/Bookmarks/M/DB/Links.pm index 5103522..ebfa963 100644 --- a/lib/Bookmarks/M/DB/Links.pm +++ b/lib/Bookmarks/M/DB/Links.pm @@ -12,12 +12,26 @@ for my $col_name (qw(add_date last_access_date)) { } sub set_icon { - my ($self,$icon)=@_; + my ($self,$icon,$type)=@_; + $self->icon(encode_base64($icon||'')); + $type||=''; + if ($type !~ m{^image/}) { + $type='image/x-icon'; + } + $self->icon_type($type); + + return; } sub get_icon { my ($self)=@_; - return decode_base64($self->icon()||''); + + my $type=$self->icon_type()||''; + if ($type !~ m{^image/}) { + $type='image/x-icon'; + } + + return (decode_base64($self->icon()||''),$type); } sub search_complex { -- cgit v1.2.3