View | Details | Raw Unified | Return to bug 53530
Collapse All | Expand All

(-)query-pr.cgi (-9 / +19 lines)
Lines 219-231 Link Here
219
}
219
}
220
220
221
sub fixline {
221
sub fixline {
222
    local($line) = shift;
222
    local(@splitline) = split(/((?:https?|ftp):\/\/[^\s"\(\)<>,;]+)/, shift);
223
    
223
224
    $line =~ s/&/&amp;/g;
224
    local($isurl) = 0;
225
    $line =~ s/</&lt;/g;
225
    foreach (@splitline) {
226
    $line =~ s/>/&gt;/g;
226
	if ($isurl) {
227
    $line =~ s%((http|ftp)://[^\s"\)\>,;]+)%<A HREF="$1">$1</A>%gi;
227
	    local($href) = local($html) = $_;
228
    $line =~ s%(\WPR[:s# \t]+)([a-z3486]+\/)?([0-9]+)%$1<A HREF="query-pr.cgi?pr=$3">$2$3</A>%ig; 
228
	    $href =~ s/&/%26/g;
229
    
229
	    $html =~ s/&/&amp;/g;
230
    return &srcref($line);
230
	    $_ = "<A HREF=\"$href\">$html</A>";
231
	} else {
232
	    s/&/&amp;/g;
233
	    s/</&lt;/g;
234
	    s/>/&gt;/g;
235
	    s%(\WPR[:s# \t]+)([a-z3486]+\/)?([0-9]+)%$1<A HREF="query-pr.cgi?pr=$3">$2$3</A>%ig;
236
	}
237
	$isurl = ! $isurl;
238
    }
239
240
    return &srcref(join('', @splitline));
231
}
241
}

Return to bug 53530