output_html_url(fp_ou,url);
fputs("\"><img src=\"../images/sarg-squidguard-block.png\"></a> ",fp_ou);
}
- output_html_link(fp_ou,url,100);
+ output_html_link(fp_ou,"",url,100); //the original scheme is left in the URL
fputs("</td></th>\n",fp_ou);
}
fclose(fp_in);
}
fprintf(fp_ou,"<tr><td class=\"data2\">%s</td><td class=\"data2\">%s</td><td class=\"data2\">%s-%s</td><td class=\"data2\">",name,ip,date,hour);
- output_html_link(fp_ou,url,100);
+ output_html_link(fp_ou,NULL,url,100);
fprintf(fp_ou,"</td><td class=\"data2\">%s</td></tr>\n",rule);
}
fclose(fp_in);
output_html_url(fp_ou,url);
fprintf(fp_ou,"\"><img src=\"%s/sarg-squidguard-block.png\"></a> ",ImageFile);
}
- output_html_link(fp_ou,url,100);
+ output_html_link(fp_ou,"",url,100); //the URL contains the scheme
fputs("</td></tr>\n",fp_ou);
}
fclose(fp_in);
output_html_url(fp_ou,url);
fprintf(fp_ou,"\"><img src=\"%s/sarg-squidguard-block.png\"></a> ",ImageFile);
}
- output_html_link(fp_ou,url,100);
+ output_html_link(fp_ou,"",url,100);//scheme is kept from the log file
fputs("</td></tr>\n",fp_ou);
}
fclose(fp_in);
output_html_url(fp_ou,url);
fprintf(fp_ou,"\"><img src=\"%s/sarg-squidguard-block.png\"></a> ",tmp6);
}
- output_html_link(fp_ou,url,100);
+ output_html_link(fp_ou,NULL,url,100);
fputs("</td>",fp_ou);
}
__attribute__((warn_unused_result)) int write_html_trailer(FILE *fp_ou);
void output_html_string(FILE *fp_ou,const char *str,int maxlen);
void output_html_url(FILE *fp_ou,const char *url);
-void output_html_link(FILE *fp_ou,const char *url,int maxlen);
+void output_html_link(FILE *fp_ou,const char *scheme,const char *url,int maxlen);
void debuga(const char *msg,...) __attribute__((format(printf,1,2)));
void debugaz(const char *msg,...) __attribute__((format(printf,1,2)));
void my_lltoa(unsigned long long int n, char *s, int ssize, int len);
else
fputs("<tr><td class=\"data2\"></td><td class=\"data2\"></td>",fp_ou);
fprintf(fp_ou,"<td class=\"data2\">%s-%s</td><td class=\"data2\">",data,hora);
- output_html_link(fp_ou,url,100);
+ output_html_link(fp_ou,NULL,url,100);
fprintf(fp_ou,"</td><td class=\"data2\">%s</td></tr>\n",rule);
}
fclose(fp_in);
output_html_url(fp_ou,ourl);
fputs("\"><img src=\"../images/sarg-squidguard-block.png\"></a> ",fp_ou);
}
- output_html_link(fp_ou,ourl,100);
+ output_html_link(fp_ou,NULL,ourl,100);
fputs("</td>",fp_ou);
if (BytesInSitesUsersReport) {
fputs("\"><img src=\"../images/sarg-squidguard-block.png\"></a> ",fp_ou);
}
- output_html_link(fp_ou,url,100);
+ output_html_link(fp_ou,NULL,url,100);
fputs("</td><td class=\"data\"",fp_ou);
if (SortTableJs[0]) fprintf(fp_ou," sorttable_customkey=\"%"PRId64"\"",(uint64_t)twork1);
fprintf(fp_ou,">%s</td>",fixnum(twork1,1));
so the A tag is not written around the host name.
\param fp_ou The handle of the HTML file.
+ \param scheme The scheme to print in the link (http:// if the pointer is null).
\param url The host to display in the HTML file.
\param maxlen The maximum number of characters to print into the host name.
*/
-void output_html_link(FILE *fp_ou,const char *url,int maxlen)
+void output_html_link(FILE *fp_ou,const char *scheme,const char *url,int maxlen)
{
if (url[0]==ALIAS_PREFIX) {
// this is an alias, no need for a A tag
output_html_string(fp_ou,url+1,100);
} else {
- fputs("<a href=\"http://",fp_ou);
+ if (scheme==NULL) scheme="http://";
+ fprintf(fp_ou,"<a href=\"%s",scheme);
output_html_url(fp_ou,url);
fputs("\">",fp_ou);
output_html_string(fp_ou,url,100);