Hello. Thought I had this one cracked. Wondering if anyone can help me.
I've got a object method that cleans up image links within content by
inserting a full url to an image directory, if it does not have one already.
For example:
image.gif is replaced with http://myserver/fullpath/image.gif
http://someserver/image.gif is left alone.
Basically I'm trying to match any images that do not begin with http://
My code:
sub cleanUp{
my $self=shift;
my $content=shift;
$content=~s/src\s*=\s*\"([^h][^t][^t][^p].+?)\.(GIF|JPG|gif|jpg)?\"/src="$se
lf->{'config'}{'static'}\/$self->{'paths'}[0]\/$1.$2"/g;
return $content;
}
Doesn't seem to work. Probably an easier/better or both way of doing this.
Any takers. Hope this is clear.
Cheers
Andy R