Attempt to strip html

This commit is contained in:
Andrew Pamment 2016-08-21 19:32:09 +10:00
parent 8330b03eb1
commit 824cec337d
2 changed files with 11 additions and 0 deletions

View File

@ -340,6 +340,10 @@ char *www_email_display(struct user_record *user, int email) {
for (i=0;i<strlen(body);i++) { for (i=0;i<strlen(body);i++) {
if (body[i] == '\r') { if (body[i] == '\r') {
sprintf(buffer, "<br />"); sprintf(buffer, "<br />");
} else if (body[z] == '<') {
sprintf(buffer, "&lt;");
} else if (body[z] == '>') {
sprintf(buffer, "&gt;");
} else { } else {
sprintf(buffer, "%c", body[i]); sprintf(buffer, "%c", body[i]);
} }

View File

@ -7,6 +7,9 @@
#include "bbs.h" #include "bbs.h"
#include "jamlib/jam.h" #include "jamlib/jam.h"
#define IN 0
#define OUT 1
extern struct bbs_config conf; extern struct bbs_config conf;
static int new_messages(struct user_record *user, int conference, int area) { static int new_messages(struct user_record *user, int conference, int area) {
@ -454,6 +457,10 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
for (z=0;z<jmh.TxtLen;z++) { for (z=0;z<jmh.TxtLen;z++) {
if (body[z] == '\r') { if (body[z] == '\r') {
sprintf(buffer, "<br />"); sprintf(buffer, "<br />");
} else if (body[z] == '<') {
sprintf(buffer, "&lt;");
} else if (body[z] == '>') {
sprintf(buffer, "&gt;");
} else { } else {
sprintf(buffer, "%c", body[z]); sprintf(buffer, "%c", body[z]);
} }