mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-10 14:54:30 +02:00
Fix forum XSS
This commit is contained in:
parent
98332f1483
commit
d1046ba21d
@ -40,6 +40,10 @@ if(Forum::canPost($account_logged))
|
||||
$smile = isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0;
|
||||
$html = isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0;
|
||||
|
||||
if (!superAdmin()) {
|
||||
$html = 0;
|
||||
}
|
||||
|
||||
$length = strlen($post_topic);
|
||||
if(($length < 1 || $length > 60) && $thread['id'] == $thread['first_post']) {
|
||||
$errors[] = "Too short or too long topic (Length: $length letters). Minimum 1 letter, maximum 60 letters.";
|
||||
|
@ -47,6 +47,10 @@ if(Forum::canPost($account_logged)) {
|
||||
$html = (int)($_REQUEST['html'] ?? 0);
|
||||
$saved = false;
|
||||
|
||||
if (!superAdmin()) {
|
||||
$html = 0;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['quote'])) {
|
||||
$quoted_post = $db->query("SELECT `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $quote)->fetchAll();
|
||||
if(isset($quoted_post[0]['name'])) {
|
||||
|
@ -31,6 +31,11 @@ if(Forum::canPost($account_logged)) {
|
||||
$post_topic = isset($_REQUEST['topic']) ? stripslashes($_REQUEST['topic']) : '';
|
||||
$smile = (isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0);
|
||||
$html = (isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0);
|
||||
|
||||
if (!superAdmin()) {
|
||||
$html = 0;
|
||||
}
|
||||
|
||||
$saved = false;
|
||||
if (isset($_REQUEST['save'])) {
|
||||
$length = strlen($post_topic);
|
||||
|
Loading…
x
Reference in New Issue
Block a user