mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Fixed problem with invalid encoding
SVN revision: 2234
This commit is contained in:
parent
fbaa82534a
commit
213e1a65b6
21
src/elogd.c
21
src/elogd.c
@ -21931,7 +21931,12 @@ void submit_elog(LOGBOOK * lbs)
|
|||||||
else
|
else
|
||||||
allowed_encoding = 7;
|
allowed_encoding = 7;
|
||||||
|
|
||||||
strcpy(encoding, isparam("encoding") ? getparam("encoding") : "plain");
|
strlcpy(encoding, isparam("encoding") ? getparam("encoding") : "plain", sizeof(encoding));
|
||||||
|
|
||||||
|
/* check for valid encoding */
|
||||||
|
if (!strieq(encoding, "plain") && !strieq(encoding, "ELCode") &&
|
||||||
|
!strieq(encoding, "HTML"))
|
||||||
|
strcpy(encoding, "plain");
|
||||||
|
|
||||||
if (strieq(encoding, "plain") && (allowed_encoding & 1) == 0) {
|
if (strieq(encoding, "plain") && (allowed_encoding & 1) == 0) {
|
||||||
show_error("Plain encoding not allowed");
|
show_error("Plain encoding not allowed");
|
||||||
@ -23798,16 +23803,16 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
if (show_text) {
|
if (show_text) {
|
||||||
rsprintf("<tr><td class=\"messageframe\">");
|
rsprintf("<tr><td class=\"messageframe\">");
|
||||||
|
|
||||||
if (strieq(encoding, "plain")) {
|
if (strieq(encoding, "html")) {
|
||||||
rsputs("<pre class=\"messagepre\">");
|
|
||||||
rsputs2(lbs, email, text);
|
|
||||||
rsputs("</pre>");
|
|
||||||
} else if (strieq(encoding, "ELCode"))
|
|
||||||
rsputs_elcode(lbs, email, text);
|
|
||||||
else {
|
|
||||||
if (email)
|
if (email)
|
||||||
replace_inline_img(lbs, text);
|
replace_inline_img(lbs, text);
|
||||||
rsputs(text);
|
rsputs(text);
|
||||||
|
} else if (strieq(encoding, "ELCode")) {
|
||||||
|
rsputs_elcode(lbs, email, text);
|
||||||
|
} else {
|
||||||
|
rsputs("<pre class=\"messagepre\">");
|
||||||
|
rsputs2(lbs, email, text);
|
||||||
|
rsputs("</pre>");
|
||||||
}
|
}
|
||||||
|
|
||||||
rsputs("</td></tr>\n");
|
rsputs("</td></tr>\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user