From 226cfc1ade7b46703653dee416064fa21472df6b Mon Sep 17 00:00:00 2001 From: Metabox Date: Sun, 28 Apr 2019 18:43:25 +1000 Subject: [PATCH] Tag bug. Appears at times when using LNK tag in compination with other tags. --- htdocs/cgi-bin/main.cgi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index 64cb2b4..3fe5304 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -250,7 +250,7 @@ while(my @row = $st->fetchrow_array()) { } my $sub =""; - + my $tagged = 0; #Check for LNK takes precedence here as we also parse plain placed URL's for http protocol later. if($log =~ /<fetchrow_array()) { $sub = substr($log, $idx+1,$len-$idx-1); my $url = qq($sub); $tags .= qq(\n); + $tagged = 1; $log=~s/</$url/osi; } @@ -267,7 +268,9 @@ while(my @row = $st->fetchrow_array()) { my $len = index($log, '>', $idx); $sub = substr($log,$idx+1,$len-$idx-1); my $url = qq(); + if(!$tagged){ $tags .= qq(\n); + } $log=~s/</$url/osi; } elsif($log =~ /<fetchrow_array()) { #TODO fetch from web locally the original image. $lnk = qq(\n); } - $tags .= qq(\n); + if(!$tagged){ + $tags .= qq(\n); + } $log=~s/</$lnk/o; } -- 2.34.1