head	1.2;
access;
symbols
	RELEASE_8_3_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2013.01.08.10.52.53;	author svnexp;	state dead;
branches;
next	1.1;

1.1
date	2012.01.12.13.13.50;	author garga;	state Exp;
branches;
next	;


desc
@@


1.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/310082
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r310082 | garga | 2013-01-08 10:25:00 +0000 (Tue, 08 Jan 2013) | 3 lines
## SVN ##
## SVN ## - Update to 2.3.4
## SVN ## - Add OPTIONS for ICONV, LDAP and PCRE
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@Index: redirector.c
===================================================================
--- redirector.c	(revision 594)
+++ redirector.c	(revision 595)
@@@@ -552,7 +552,7 @@@@
 		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);
Index: util.c
===================================================================
--- util.c	(revision 594)
+++ util.c	(revision 595)
@@@@ -1724,16 +1724,18 @@@@
   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);
Index: denied.c
===================================================================
--- denied.c	(revision 594)
+++ denied.c	(revision 595)
@@@@ -158,7 +158,7 @@@@
 			output_html_url(fp_ou,url);
 			fprintf(fp_ou,"\"><img src=\"%s/sarg-squidguard-block.png\"></a>&nbsp;",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);
Index: include/defs.h
===================================================================
--- include/defs.h	(revision 594)
+++ include/defs.h	(revision 595)
@@@@ -253,7 +253,7 @@@@
 __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);
Index: download.c
===================================================================
--- download.c	(revision 594)
+++ download.c	(revision 595)
@@@@ -156,7 +156,7 @@@@
 			output_html_url(fp_ou,url);
 			fprintf(fp_ou,"\"><img src=\"%s/sarg-squidguard-block.png\"></a>&nbsp;",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);
Index: topsites.c
===================================================================
--- topsites.c	(revision 594)
+++ topsites.c	(revision 595)
@@@@ -275,7 +275,7 @@@@
 			fputs("\"><img src=\"../images/sarg-squidguard-block.png\"></a>&nbsp;",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));
Index: authfail.c
===================================================================
--- authfail.c	(revision 594)
+++ authfail.c	(revision 595)
@@@@ -189,7 +189,7 @@@@
 			output_html_url(fp_ou,url);
 			fputs("\"><img src=\"../images/sarg-squidguard-block.png\"></a>&nbsp;",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);
Index: siteuser.c
===================================================================
--- siteuser.c	(revision 594)
+++ siteuser.c	(revision 595)
@@@@ -146,7 +146,7 @@@@
 				output_html_url(fp_ou,ourl);
 				fputs("\"><img src=\"../images/sarg-squidguard-block.png\"></a>&nbsp;",fp_ou);
 			}
-			output_html_link(fp_ou,ourl,100);
+			output_html_link(fp_ou,NULL,ourl,100);
 			fputs("</td>",fp_ou);
 
 			if (BytesInSitesUsersReport) {
Index: html.c
===================================================================
--- html.c	(revision 594)
+++ html.c	(revision 595)
@@@@ -285,7 +285,7 @@@@
 						output_html_url(fp_ou,url);
 						fprintf(fp_ou,"\"><img src=\"%s/sarg-squidguard-block.png\"></a>&nbsp;",tmp6);
 					}
-					output_html_link(fp_ou,url,100);
+					output_html_link(fp_ou,NULL,url,100);
 					fputs("</td>",fp_ou);
 				}
 
Index: dansguardian_report.c
===================================================================
--- dansguardian_report.c	(revision 594)
+++ dansguardian_report.c	(revision 595)
@@@@ -155,7 +155,7 @@@@
 		}
 
 		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);
@


1.1
log
@- Fix the link to the URL in some reports
- Bump PORTREVISION

Reported by:	budsz <budsz@@willsz.net>
Obtained from:	http://sarg.svn.sourceforge.net/viewvc/sarg?view=revision&revision=595
@
text
@@

