mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Use rsputs3 for proper display of HTML logbook entries
SVN revision: 1104
This commit is contained in:
parent
b17995a964
commit
4802d0aa43
32
src/elogd.c
32
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.494 2004/10/13 20:15:06 midas
|
||||||
|
Use rsputs3 for proper display of HTML logbook entries
|
||||||
|
|
||||||
Revision 1.493 2004/10/13 18:21:49 midas
|
Revision 1.493 2004/10/13 18:21:49 midas
|
||||||
Fixed compiler warning
|
Fixed compiler warning
|
||||||
|
|
||||||
@ -2192,6 +2195,10 @@ INT sendmail(LOGBOOK * lbs, char *smtp_host, char *from, char *to,
|
|||||||
offset = (-(int) timezone);
|
offset = (-(int) timezone);
|
||||||
if (ts->tm_isdst)
|
if (ts->tm_isdst)
|
||||||
offset += 3600;
|
offset += 3600;
|
||||||
|
if (verbose) {
|
||||||
|
snprintf(str, strsize - 1, "timezone: %d, offset: %d", (int) timezone, (int) offset);
|
||||||
|
efputs(str);
|
||||||
|
}
|
||||||
snprintf(str, strsize - 1, "Date: %s %+03d%02d\r\n", buf, (int) (offset / 3600),
|
snprintf(str, strsize - 1, "Date: %s %+03d%02d\r\n", buf, (int) (offset / 3600),
|
||||||
(int) ((abs((int) offset) / 60) % 60));
|
(int) ((abs((int) offset) / 60) % 60));
|
||||||
send(s, str, strlen(str), 0);
|
send(s, str, strlen(str), 0);
|
||||||
@ -5200,7 +5207,7 @@ void rsputs2(const char *str)
|
|||||||
if (strncmp(str + i, key_list[l], strlen(key_list[l])) == 0) {
|
if (strncmp(str + i, key_list[l], strlen(key_list[l])) == 0) {
|
||||||
p = (char *) (str + i + strlen(key_list[l]));
|
p = (char *) (str + i + strlen(key_list[l]));
|
||||||
i += strlen(key_list[l]);
|
i += strlen(key_list[l]);
|
||||||
for (k = 0; *p && strcspn(p, " \t\n\r({[)}]") && k < (int) sizeof(link); k++, i++)
|
for (k = 0; *p && strcspn(p, " \t\n\r({[)}]\"") && k < (int) sizeof(link); k++, i++)
|
||||||
link[k] = *p++;
|
link[k] = *p++;
|
||||||
link[k] = 0;
|
link[k] = 0;
|
||||||
i--;
|
i--;
|
||||||
@ -8200,13 +8207,15 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf(str);
|
rsprintf(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
rsputs(text);
|
/* use rsputs3 which just converts "<", ">", "&", "\"" to > etc. */
|
||||||
|
/* otherwise some HTML statments would break the page syntax */
|
||||||
|
rsputs3(text);
|
||||||
|
|
||||||
if (getcfg(lbs->name, "Append on edit", str, sizeof(str))) {
|
if (getcfg(lbs->name, "Append on edit", str, sizeof(str))) {
|
||||||
strsubst(str, slist, svalue, j);
|
strsubst(str, slist, svalue, j);
|
||||||
while (strstr(str, "\\n"))
|
while (strstr(str, "\\n"))
|
||||||
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
||||||
rsprintf(str);
|
rsputs3(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (breply) {
|
} else if (breply) {
|
||||||
@ -8221,7 +8230,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
strsubst(str, slist, svalue, j);
|
strsubst(str, slist, svalue, j);
|
||||||
while (strstr(str, "\\n"))
|
while (strstr(str, "\\n"))
|
||||||
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
||||||
rsprintf(str);
|
rsputs3(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
p = text;
|
p = text;
|
||||||
@ -8235,11 +8244,11 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
*strchr(p, '\n') = 0;
|
*strchr(p, '\n') = 0;
|
||||||
|
|
||||||
if (encoding[0] == 'H') {
|
if (encoding[0] == 'H') {
|
||||||
rsputs2(reply_string);
|
rsputs3(reply_string);
|
||||||
rsprintf("%s<br>\n", p);
|
rsprintf("%s<br>\n", p);
|
||||||
} else {
|
} else {
|
||||||
rsputs(reply_string);
|
rsputs(reply_string);
|
||||||
rsputs2(p);
|
rsputs3(p);
|
||||||
rsprintf("\n");
|
rsprintf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8248,11 +8257,11 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
p++;
|
p++;
|
||||||
} else {
|
} else {
|
||||||
if (encoding[0] == 'H') {
|
if (encoding[0] == 'H') {
|
||||||
rsputs2(reply_string);
|
rsputs3(reply_string);
|
||||||
rsprintf("%s<p>\n", p);
|
rsprintf("%s<p>\n", p);
|
||||||
} else {
|
} else {
|
||||||
rsputs(reply_string);
|
rsputs(reply_string);
|
||||||
rsputs2(p);
|
rsputs3(p);
|
||||||
rsprintf("\n\n");
|
rsprintf("\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8271,7 +8280,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
strsubst(str, slist, svalue, j);
|
strsubst(str, slist, svalue, j);
|
||||||
while (strstr(str, "\\n"))
|
while (strstr(str, "\\n"))
|
||||||
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
||||||
rsprintf(str);
|
rsputs3(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8297,14 +8306,14 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
read(fh, buffer, length);
|
read(fh, buffer, length);
|
||||||
buffer[length] = 0;
|
buffer[length] = 0;
|
||||||
close(fh);
|
close(fh);
|
||||||
rsputs(buffer);
|
rsputs3(buffer);
|
||||||
xfree(buffer);
|
xfree(buffer);
|
||||||
} else {
|
} else {
|
||||||
j = build_subst_list(lbs, slist, svalue, attrib, TRUE);
|
j = build_subst_list(lbs, slist, svalue, attrib, TRUE);
|
||||||
strsubst(str, slist, svalue, j);
|
strsubst(str, slist, svalue, j);
|
||||||
while (strstr(str, "\\n"))
|
while (strstr(str, "\\n"))
|
||||||
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
memcpy(strstr(str, "\\n"), "\r\n", 2);
|
||||||
rsputs(str);
|
rsputs3(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18602,6 +18611,7 @@ void interprete(char *lbook, char *path)
|
|||||||
strlcpy(css, str, sizeof(css));
|
strlcpy(css, str, sizeof(css));
|
||||||
else if (lbs == NULL && getcfg("global", "CSS", str, sizeof(str)))
|
else if (lbs == NULL && getcfg("global", "CSS", str, sizeof(str)))
|
||||||
strlcpy(css, str, sizeof(css));
|
strlcpy(css, str, sizeof(css));
|
||||||
|
|
||||||
/* check if guest access */
|
/* check if guest access */
|
||||||
if (!(getcfg(lbs->name, "Guest menu commands", str, sizeof(str))
|
if (!(getcfg(lbs->name, "Guest menu commands", str, sizeof(str))
|
||||||
&& *getparam("unm") == 0 && !isparam("wpwd")
|
&& *getparam("unm") == 0 && !isparam("wpwd")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user