]>
Commit | Line | Data |
---|---|---|
f6f70ac5 ER |
1 | --- nagios-3.0.3/cgi/avail.c 2008-06-23 23:47:42.000000000 +0300 |
2 | +++ nagios-3.0.3-cgi/cgi/avail.c 2008-10-11 12:34:44.496658785 +0300 | |
3 | @@ -37,6 +37,8 @@ | |
4 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
5 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
6 | ||
7 | +extern char *http_charset; | |
8 | + | |
9 | extern host *host_list; | |
10 | extern hostgroup *hostgroup_list; | |
11 | extern servicegroup *servicegroup_list; | |
12 | @@ -1079,9 +1081,9 @@ | |
13 | printf("Expires: %s\r\n",date_time); | |
14 | ||
15 | if(output_format==HTML_OUTPUT) | |
16 | - printf("Content-type: text/html\r\n\r\n"); | |
17 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
18 | else{ | |
19 | - printf("Content-type: text/plain\r\n\r\n"); | |
20 | + printf("Content-type: text/plain; charset=\"%s\"\r\n\r\n", http_charset); | |
21 | return; | |
22 | } | |
23 | ||
af765cf5 ER |
24 | --- nagios-3.0.3-cgi/cgi/cgiutils.c 2008-10-11 12:34:44.472657400 +0300 |
25 | +++ nagios-3.2.0/cgi/cgiutils.c 2009-09-11 16:14:43.130251761 +0300 | |
f6f70ac5 ER |
26 | @@ -55,6 +55,7 @@ |
27 | char *statuswrl_include=NULL; | |
28 | ||
29 | char *illegal_output_chars=NULL; | |
30 | +char *http_charset=NULL; | |
31 | ||
32 | char *notes_url_target=NULL; | |
33 | char *action_url_target=NULL; | |
34 | @@ -188,6 +189,9 @@ | |
35 | host_unreachable_sound=NULL; | |
36 | normal_sound=NULL; | |
37 | ||
38 | + my_free(http_charset); | |
39 | + http_charset = strdup(DEFAULT_HTTP_CHARSET); | |
40 | + | |
41 | statusmap_background_image=NULL; | |
42 | statuswrl_include=NULL; | |
43 | ||
44 | @@ -391,6 +395,9 @@ | |
45 | else if(!strcmp(var,"illegal_macro_output_chars")) | |
46 | illegal_output_chars=strdup(val); | |
47 | ||
48 | + else if(!strcmp(var,"http_charset")) | |
49 | + http_charset=strdup(val); | |
50 | + | |
51 | else if(!strcmp(var,"notes_url_target")) | |
52 | notes_url_target=strdup(val); | |
53 | ||
af765cf5 ER |
54 | @@ -1553,6 +1560,9 @@ |
55 | else if(((char)input[x]==(char)' ') || ((char)input[x]==(char)'-') || ((char)input[x]==(char)'.') || ((char)input[x]==(char)'_') || ((char)input[x]==(char)':')) | |
56 | encoded_html_string[y++]=input[x]; | |
57 | ||
58 | + /* high bit chars don't get encoded, so we won't be breaking utf8 characters */ | |
59 | + else if ((unsigned char)input[x] >= 0x7f) | |
60 | + encoded_html_string[y++]=input[x]; | |
61 | /* for simplicity, all other chars represented by their numeric value */ | |
62 | else{ | |
63 | encoded_html_string[y]='\x0'; | |
f6f70ac5 ER |
64 | --- nagios-3.0.3/cgi/cmd.c 2008-05-19 21:42:26.000000000 +0300 |
65 | +++ nagios-3.0.3-cgi/cgi/cmd.c 2008-10-11 12:34:44.496658785 +0300 | |
66 | @@ -39,6 +39,8 @@ | |
67 | ||
68 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
69 | ||
70 | +extern char *http_charset; | |
71 | + | |
72 | extern int nagios_process_state; | |
73 | ||
74 | extern int check_external_commands; | |
75 | @@ -235,7 +237,7 @@ | |
76 | ||
77 | if(content_type==WML_CONTENT){ | |
78 | ||
79 | - printf("Content-type: text/vnd.wap.wml\r\n\r\n"); | |
80 | + printf("Content-type: text/vnd.wap.wml; charset=\"%s\"\r\n\r\n", http_charset); | |
81 | ||
82 | printf("<?xml version=\"1.0\"?>\n"); | |
83 | printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); | |
84 | @@ -247,7 +249,7 @@ | |
85 | ||
86 | else{ | |
87 | ||
88 | - printf("Content-type: text/html\r\n\r\n"); | |
89 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
90 | ||
91 | printf("<html>\n"); | |
92 | printf("<head>\n"); | |
93 | --- nagios-3.0.3/cgi/config.c 2008-04-13 21:34:27.000000000 +0300 | |
94 | +++ nagios-3.0.3-cgi/cgi/config.c 2008-10-11 12:34:44.496658785 +0300 | |
95 | @@ -37,6 +37,8 @@ | |
96 | extern char url_logo_images_path[MAX_FILENAME_LENGTH]; | |
97 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
98 | ||
99 | +extern char *http_charset; | |
100 | + | |
101 | extern host *host_list; | |
102 | extern service *service_list; | |
103 | extern hostgroup *hostgroup_list; | |
104 | @@ -293,7 +295,7 @@ | |
105 | printf("Pragma: no-cache\r\n"); | |
106 | printf("Last-Modified: %s\r\n",date_time); | |
107 | printf("Expires: %s\r\n",date_time); | |
108 | - printf("Content-type: text/html\r\n\r\n"); | |
109 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
110 | ||
111 | printf("<html>\n"); | |
112 | printf("<head>\n"); | |
113 | --- nagios-3.0.3/cgi/extinfo.c 2008-01-24 04:51:30.000000000 +0200 | |
114 | +++ nagios-3.0.3-cgi/cgi/extinfo.c 2008-10-11 12:34:44.500659016 +0300 | |
115 | @@ -38,6 +38,8 @@ | |
116 | extern int nagios_process_state; | |
117 | extern int refresh_rate; | |
118 | ||
119 | +extern char *http_charset; | |
120 | + | |
121 | extern time_t program_start; | |
122 | extern int nagios_pid; | |
123 | extern int daemon_mode; | |
124 | @@ -584,7 +586,7 @@ | |
125 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
126 | printf("Expires: %s\r\n",date_time); | |
127 | ||
128 | - printf("Content-type: text/html\r\n\r\n"); | |
129 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
130 | ||
131 | if(embedded==TRUE) | |
132 | return; | |
133 | --- nagios-3.0.3/cgi/histogram.c 2008-05-19 21:42:26.000000000 +0300 | |
134 | +++ nagios-3.0.3-cgi/cgi/histogram.c 2008-10-11 12:34:44.512659708 +0300 | |
135 | @@ -130,6 +130,8 @@ | |
136 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
137 | extern char physical_images_path[MAX_FILENAME_LENGTH]; | |
138 | ||
139 | +extern char *http_charset; | |
140 | + | |
141 | extern int log_rotation_method; | |
142 | ||
143 | extern host *host_list; | |
144 | @@ -994,7 +996,7 @@ | |
145 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
146 | printf("Expires: %s\r\n",date_time); | |
147 | ||
148 | - printf("Content-type: text/html\r\n\r\n"); | |
149 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
150 | ||
151 | if(embedded==TRUE) | |
152 | return; | |
2b46b6f0 ER |
153 | --- nagios-3.0.3-cgi/cgi/history.c 2008-10-11 12:34:44.480657862 +0300 |
154 | +++ nagios-3.0.3/cgi/history.c 2008-10-11 12:38:12.164637148 +0300 | |
155 | @@ -57,6 +57,8 @@ | |
156 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
157 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
158 | ||
159 | +extern char *http_charset; | |
160 | + | |
161 | extern int log_rotation_method; | |
162 | ||
163 | extern int enable_splunk_integration; | |
164 | @@ -315,7 +317,7 @@ | |
f6f70ac5 ER |
165 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); |
166 | printf("Expires: %s\r\n",date_time); | |
167 | ||
168 | - printf("Content-type: text/html\r\n\r\n"); | |
169 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
170 | ||
171 | if(embedded==TRUE) | |
172 | return; | |
173 | --- nagios-3.0.3/cgi/notifications.c 2008-05-19 21:42:27.000000000 +0300 | |
174 | +++ nagios-3.0.3-cgi/cgi/notifications.c 2008-10-11 12:34:44.500659016 +0300 | |
175 | @@ -37,6 +37,8 @@ | |
176 | extern char url_docs_path[MAX_FILENAME_LENGTH]; | |
177 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
178 | ||
179 | +extern char *http_charset; | |
180 | + | |
181 | extern int log_rotation_method; | |
182 | ||
183 | ||
184 | @@ -303,7 +305,7 @@ | |
185 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
186 | printf("Expires: %s\r\n",date_time); | |
187 | ||
188 | - printf("Content-type: text/html\r\n\r\n"); | |
189 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
190 | ||
191 | if(embedded==TRUE) | |
192 | return; | |
193 | --- nagios-3.0.3/cgi/outages.c 2008-01-09 19:51:23.000000000 +0200 | |
194 | +++ nagios-3.0.3-cgi/cgi/outages.c 2008-10-11 12:34:44.500659016 +0300 | |
195 | @@ -39,6 +39,8 @@ | |
196 | extern hoststatus *hoststatus_list; | |
197 | extern servicestatus *servicestatus_list; | |
198 | ||
199 | +extern char *http_charset; | |
200 | + | |
201 | extern char main_config_file[MAX_FILENAME_LENGTH]; | |
202 | extern char url_html_path[MAX_FILENAME_LENGTH]; | |
203 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
204 | @@ -215,7 +217,7 @@ | |
205 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
206 | printf("Expires: %s\r\n",date_time); | |
207 | ||
208 | - printf("Content-type: text/html\r\n\r\n"); | |
209 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
210 | ||
211 | if(embedded==TRUE) | |
212 | return; | |
213 | --- nagios-3.0.3/cgi/showlog.c 2008-01-09 19:51:23.000000000 +0200 | |
214 | +++ nagios-3.0.3-cgi/cgi/showlog.c 2008-10-11 12:34:44.500659016 +0300 | |
215 | @@ -37,6 +37,8 @@ | |
216 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
217 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
218 | ||
219 | +extern char *http_charset; | |
220 | + | |
221 | extern int log_rotation_method; | |
222 | ||
223 | extern int enable_splunk_integration; | |
224 | @@ -188,7 +190,7 @@ | |
225 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
226 | printf("Expires: %s\r\n",date_time); | |
227 | ||
228 | - printf("Content-type: text/html\r\n\r\n"); | |
229 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
230 | ||
231 | if(embedded==TRUE) | |
232 | return; | |
233 | --- nagios-3.0.3/cgi/status.c 2008-06-23 23:47:46.000000000 +0300 | |
234 | +++ nagios-3.0.3-cgi/cgi/status.c 2008-10-11 12:34:44.504659246 +0300 | |
235 | @@ -44,6 +44,8 @@ | |
236 | extern char url_media_path[MAX_FILENAME_LENGTH]; | |
237 | extern char log_file[MAX_FILENAME_LENGTH]; | |
238 | ||
239 | +extern char *http_charset; | |
240 | + | |
241 | extern char *service_critical_sound; | |
242 | extern char *service_warning_sound; | |
243 | extern char *service_unknown_sound; | |
244 | @@ -503,7 +505,7 @@ | |
245 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
246 | printf("Expires: %s\r\n",date_time); | |
247 | ||
248 | - printf("Content-type: text/html\r\n\r\n"); | |
249 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
250 | ||
251 | if(embedded==TRUE) | |
252 | return; | |
253 | --- nagios-3.0.3/cgi/statusmap.c 2008-05-19 21:42:28.000000000 +0300 | |
254 | +++ nagios-3.0.3-cgi/cgi/statusmap.c 2008-10-11 12:34:44.508659477 +0300 | |
255 | @@ -54,6 +54,8 @@ | |
256 | extern char url_logo_images_path[MAX_FILENAME_LENGTH]; | |
257 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
258 | ||
259 | +extern char *http_charset; | |
260 | + | |
261 | extern host *host_list; | |
262 | extern hostgroup *hostgroup_list; | |
263 | extern service *service_list; | |
264 | @@ -320,7 +322,7 @@ | |
265 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
266 | printf("Expires: %s\r\n",date_time); | |
267 | ||
268 | - printf("Content-Type: text/html\r\n\r\n"); | |
269 | + printf("Content-Type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
270 | ||
271 | if(embedded==TRUE) | |
272 | return; | |
273 | --- nagios-3.0.3/cgi/statuswml.c 2008-05-19 21:42:28.000000000 +0300 | |
274 | +++ nagios-3.0.3-cgi/cgi/statuswml.c 2008-10-11 12:34:44.504659246 +0300 | |
66b4f57f | 275 | @@ -47,6 +47,8 @@ |
f6f70ac5 | 276 | |
66b4f57f AM |
277 | extern char *ping_syntax; |
278 | ||
279 | +extern char *http_charset; | |
f6f70ac5 | 280 | + |
66b4f57f AM |
281 | #define DISPLAY_HOST 0 |
282 | #define DISPLAY_SERVICE 1 | |
283 | #define DISPLAY_HOSTGROUP 2 | |
f6f70ac5 ER |
284 | @@ -193,7 +195,7 @@ |
285 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
286 | printf("Expires: %s\r\n",date_time); | |
287 | ||
288 | - printf("Content-type: text/vnd.wap.wml\r\n\r\n"); | |
289 | + printf("Content-type: text/vnd.wap.wml; charset=\"%s\"\r\n\r\n", http_charset); | |
290 | ||
291 | printf("<?xml version=\"1.0\"?>\n"); | |
292 | printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); | |
293 | --- nagios-3.0.3/cgi/statuswrl.c 2007-07-16 19:41:46.000000000 +0300 | |
294 | +++ nagios-3.0.3-cgi/cgi/statuswrl.c 2008-10-11 12:34:44.508659477 +0300 | |
295 | @@ -41,6 +41,8 @@ | |
296 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
297 | extern char url_logo_images_path[MAX_FILENAME_LENGTH]; | |
298 | ||
299 | +extern char *http_charset; | |
300 | + | |
301 | extern char *statuswrl_include; | |
302 | ||
303 | extern host *host_list; | |
304 | @@ -202,7 +204,7 @@ | |
305 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
306 | printf("Expires: %s\r\n",date_time); | |
307 | ||
308 | - printf("Content-Type: x-world/x-vrml\r\n\r\n"); | |
309 | + printf("Content-Type: x-world/x-vrml; charset=\"%s\"\r\n\r\n", http_charset); | |
310 | ||
311 | return; | |
312 | } | |
313 | --- nagios-3.0.3/cgi/summary.c 2008-01-24 04:51:30.000000000 +0200 | |
314 | +++ nagios-3.0.3-cgi/cgi/summary.c 2008-10-11 12:34:44.504659246 +0300 | |
315 | @@ -37,6 +37,8 @@ | |
316 | extern char url_images_path[MAX_FILENAME_LENGTH]; | |
317 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
318 | ||
319 | +extern char *http_charset; | |
320 | + | |
321 | extern host *host_list; | |
322 | extern hostgroup *hostgroup_list; | |
323 | extern service *service_list; | |
324 | @@ -698,9 +700,9 @@ | |
325 | printf("Expires: %s\r\n",date_time); | |
326 | ||
327 | if(output_format==HTML_OUTPUT) | |
328 | - printf("Content-type: text/html\r\n\r\n"); | |
329 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
330 | else{ | |
331 | - printf("Content-type: text/plain\r\n\r\n"); | |
332 | + printf("Content-type: text/plain; charset=\"%s\"\r\n\r\n", http_charset); | |
333 | return; | |
334 | } | |
335 | ||
336 | --- nagios-3.0.3/cgi/tac.c 2008-02-21 08:17:37.000000000 +0200 | |
337 | +++ nagios-3.0.3-cgi/cgi/tac.c 2008-10-11 12:34:44.508659477 +0300 | |
338 | @@ -52,6 +52,8 @@ | |
339 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
340 | extern char url_media_path[MAX_FILENAME_LENGTH]; | |
341 | ||
342 | +extern char *http_charset; | |
343 | + | |
344 | extern int refresh_rate; | |
345 | ||
346 | extern char *service_critical_sound; | |
347 | @@ -381,7 +383,7 @@ | |
348 | get_time_string(&expire_time,date_time,(int)sizeof(date_time),HTTP_DATE_TIME); | |
349 | printf("Expires: %s\r\n",date_time); | |
350 | ||
351 | - printf("Content-type: text/html\r\n\r\n"); | |
352 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
353 | ||
354 | if(embedded==TRUE) | |
355 | return; | |
356 | --- nagios-3.0.3/cgi/trends.c 2008-06-23 23:47:46.000000000 +0300 | |
357 | +++ nagios-3.0.3-cgi/cgi/trends.c 2008-10-11 12:34:44.512659708 +0300 | |
358 | @@ -44,6 +44,8 @@ | |
359 | extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; | |
360 | extern char physical_images_path[MAX_FILENAME_LENGTH]; | |
361 | ||
362 | +extern char *http_charset; | |
363 | + | |
364 | extern int log_rotation_method; | |
365 | ||
366 | extern host *host_list; | |
367 | @@ -1114,7 +1116,7 @@ | |
368 | get_time_string(&expire_time,date_time,sizeof(date_time),HTTP_DATE_TIME); | |
369 | printf("Expires: %s\r\n",date_time); | |
370 | ||
371 | - printf("Content-type: text/html\r\n\r\n"); | |
372 | + printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset); | |
373 | ||
374 | if(embedded==TRUE) | |
375 | return; | |
f6f70ac5 ER |
376 | --- nagios-3.0.3/include/cgiutils.h.in 2007-11-11 01:34:26.000000000 +0200 |
377 | +++ nagios-3.0.3-cgi/include/cgiutils.h.in 2008-10-11 12:34:44.468657170 +0300 | |
378 | @@ -422,6 +422,9 @@ | |
379 | #define LIFO_ERROR_FILE 2 | |
380 | #define LIFO_ERROR_DATA 3 | |
381 | ||
382 | +/************************** HTTP CHARSET ****************************/ | |
383 | + | |
90efa8f5 | 384 | +#define DEFAULT_HTTP_CHARSET "utf-8" |
f6f70ac5 ER |
385 | |
386 | ||
387 | ||
388 | --- nagios-3.0.3/sample-config/cgi.cfg.in 2007-10-07 22:42:52.000000000 +0300 | |
389 | +++ nagios-3.0.3-cgi/sample-config/cgi.cfg.in 2008-10-11 12:34:44.472657400 +0300 | |
390 | @@ -36,6 +36,11 @@ | |
391 | url_html_path=@htmurl@ | |
392 | ||
393 | ||
394 | +# HTTP CHARSET | |
395 | +# This defines charset that is sent with HTTP headers. | |
396 | + | |
90efa8f5 | 397 | +http_charset=utf-8 |
f6f70ac5 ER |
398 | + |
399 | ||
400 | # CONTEXT-SENSITIVE HELP | |
401 | # This option determines whether or not a context-sensitive |