+platform
[MyWeb.git] / Web.pm
diff --git a/Web.pm b/Web.pm
index 3d4104e..6ec9d59 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -328,6 +328,8 @@ my($url,$contents,%args)=@_;
 
        do { $$_=1 if !defined $$_; } for (\$args{"size"});
        $contents=CGI::escapeHTML($url) if !defined $contents;
+       $contents=~s#<a\b[^>]*>##gi;
+       $contents=~s#</a>##gi;
 
        my $r='<a href="';
        my $urlent=CGI::escapeHTML($url);
@@ -341,6 +343,8 @@ my($url,$contents,%args)=@_;
                { $r.=$urlent; }
        else    # unknown client, &CGI::escapeHTML should not be needed here
                { $r.=CGI::escapeHTML(top_dir()."/Redirect.pl?location=".uri_escape($url)); }
+       $r.='"';
+       do { $r.=" $_" if $_; } for ($args{"attr"});
        $r.='">'.$contents.'</a>';
        if ($args{"size"} && url_is_local($url) && $url=~/[.](?:gz|Z|rpm|zip|deb|lha)/) {       # Downloadable?
                if (!-r $url)