update
This commit is contained in:
parent
807fbc2279
commit
e366d92950
@ -3,6 +3,5 @@ prismic is a simple messageboard made in python
|
|||||||
|
|
||||||
## Planned features
|
## Planned features
|
||||||
- [ ] user board creation
|
- [ ] user board creation
|
||||||
- [ ] markdown support
|
|
||||||
- [ ] custom profiles
|
- [ ] custom profiles
|
||||||
- [ ] moderation tools
|
- [ ] moderation tools
|
@ -1,13 +1,12 @@
|
|||||||
from flask import Flask, request, render_template, session, redirect
|
from flask import Flask, request, render_template, session, redirect
|
||||||
import database, logging, os, hashlib, html
|
import database, logging, os, hashlib
|
||||||
from flask_session import Session
|
from flask_session import Session
|
||||||
|
|
||||||
|
|
||||||
# Global variables
|
# Global variables
|
||||||
SYSTEMUID = None
|
SYSTEMUID = None
|
||||||
SYSTEMBID = None
|
SYSTEMBID = None
|
||||||
allowed_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%£^&()-_=+[]{};:'\",.<>?/\\|`~ "
|
ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%£^&()-_=+[]{};:'\",.<>?/\\|`~ \n"
|
||||||
|
|
||||||
|
|
||||||
# Configure logging
|
# Configure logging
|
||||||
console_log = logging.StreamHandler()
|
console_log = logging.StreamHandler()
|
||||||
@ -70,8 +69,7 @@ def sanitize_input(input_string):
|
|||||||
if not isinstance(input_string, str):
|
if not isinstance(input_string, str):
|
||||||
logger.error("Input is not a string.")
|
logger.error("Input is not a string.")
|
||||||
return None
|
return None
|
||||||
sanitized = ''.join(c for c in input_string if c in allowed_chars)
|
sanitized = ''.join(c for c in input_string if c in ALLOWED_CHARS)
|
||||||
sanitized = html.escape(sanitized)
|
|
||||||
logger.info("Sanitized input")
|
logger.info("Sanitized input")
|
||||||
return sanitized
|
return sanitized
|
||||||
|
|
||||||
|
@ -179,4 +179,8 @@ div#nav {
|
|||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
white-space:pre;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user