[icinga-checkins] icinga.org: icinga-core/rbartels/1.3: classic ui: fix whitespace escaping in html urls, config expander printing [SP] instead of [WS] (Jochen Bern) #965

git at icinga.org git at icinga.org
Thu Nov 11 19:54:26 CET 2010


Module: icinga-core
Branch: rbartels/1.3
Commit: 22c377c889750618401146c6ceaa9236f46aff16
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=22c377c889750618401146c6ceaa9236f46aff16

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Fri Nov  5 17:53:55 2010 +0100

classic ui: fix whitespace escaping in html urls, config expander printing [SP] instead of [WS] (Jochen Bern) #965

refs #965

---

 Changelog      |    2 ++
 cgi/cgiutils.c |    2 +-
 cgi/config.c   |    9 ++-------
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/Changelog b/Changelog
index dc2f466..3a2ad53 100644
--- a/Changelog
+++ b/Changelog
@@ -25,6 +25,8 @@ FIXES
 * classic ui: fix object values in utf8 are displayed incorrectly in the web interface (Alexey Dvoryanchikov) #952
 * classic ui: make html header w3c conform #952
 * classic ui: fix typo for css attribute in extinfo.cgi (Ton Voon) #963
+* classic ui: fix whitespace escaping in html urls (Jochen Bern) #965
+* classic ui: fix config expander printing [SP] instead of [WS] (Jochen Bern) #965
 
 * install: fix LD_LIBRARY_PATH export on non bash in idoutils init script (Alexander Skwar) #936
 * install: add log2ido for adding archived logs onto socket/rdbms #926
diff --git a/cgi/cgiutils.c b/cgi/cgiutils.c
index a499cbc..2bad261 100644
--- a/cgi/cgiutils.c
+++ b/cgi/cgiutils.c
@@ -1419,7 +1419,7 @@ char * url_encode(char *input){
 		}
 
 		/* spaces are pluses */
-		else if((char)input[x]<=(char)' '){
+		else if((char)input[x]==(char)' '){
 			str[y]='+';
 			y++;
 		        }
diff --git a/cgi/config.c b/cgi/config.c
index 4dc4b63..c698e25 100644
--- a/cgi/config.c
+++ b/cgi/config.c
@@ -2365,10 +2365,7 @@ void display_command_expansion(void){
 						printf("<TR CLASS='%s'><TD CLASS='%s' ALIGN='right'><FONT COLOR='#0000FF'>dangling whitespace:</FONT></TD>\n",bg_class,bg_class);
 						printf("<TD CLASS='%s'>$ARG%u$=<FONT COLOR='#0000FF'>",bg_class,i);
 						for (c=command_args[i],j=0;c&&isspace(*c);c++,j++)
-							/* TODO: As long as the hyperlinks change all whitespace into actual spaces,
-							   we'll output "[WS]" (whitespace) instead of "[SP]"(ace). */
-							/* if ((*c)==' ')		printf("[SP]"); */
-							if ((*c)==' ')		printf("[WS]");
+							if ((*c)==' ')		printf("[SP]");
 							else if ((*c)=='\f')	printf("[FF]");
 							else if ((*c)=='\n')	printf("[LF]");
 							else if ((*c)=='\r')	printf("[CR]");
@@ -2379,9 +2376,7 @@ void display_command_expansion(void){
 						for (;c&&((*c)!='\0')&&(j<strlen(command_args[i])-trail_space[i]);c++,j++) putchar(*c);
 						printf("</FONT><FONT COLOR='#0000FF'>");
 						for (;c&&((*c)!='\0');c++)
-							/* TODO: As long as the hyperlinks change all whitespace into actual spaces,
-							   we'll output "[WS]" (whitespace) instead of "[SP]"(ace). */
-							/* if ((*c)==' ')		printf("[SP]"); */
+							if ((*c)==' ')		printf("[SP]");
 							if ((*c)==' ')		printf("[WS]");
 							else if ((*c)=='\f')	printf("[FF]");
 							else if ((*c)=='\n')	printf("[LF]");





More information about the icinga-checkins mailing list