pages.php: set ban and warning messages
This commit is contained in:
parent
a7fef25e61
commit
67aeda60bb
1 changed files with 16 additions and 4 deletions
|
|
@ -2227,6 +2227,20 @@ function mod_edit_post(Context $ctx, $board, $edit_raw_html, $postID) {
|
|||
|
||||
// Add back modifiers in the original post
|
||||
$modifiers = extract_modifiers($post['body_nomarkup']);
|
||||
|
||||
if ($ban_msg_access) {
|
||||
if (empty($_POST['ban-message'])) {
|
||||
unset($modifiers['ban message']);
|
||||
} else {
|
||||
$modifiers['ban message'] = $edit_raw_html ? $_POST['ban-message'] : \htmlspecialchars(\htmlspecialchars($_POST['ban-message']));
|
||||
}
|
||||
if (empty($_POST['warn-message'])) {
|
||||
unset($modifiers['warning message']);
|
||||
} else {
|
||||
$modifiers['warning message'] = $edit_raw_html ? $_POST['warn-message'] : \htmlspecialchars(\htmlspecialchars($_POST['warn-message']));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($modifiers as $key => $value) {
|
||||
$_POST['body'] .= "<tinyboard $key>$value</tinyboard>";
|
||||
}
|
||||
|
|
@ -2265,12 +2279,10 @@ function mod_edit_post(Context $ctx, $board, $edit_raw_html, $postID) {
|
|||
$modifiers = extract_modifiers($post['body_nomarkup']);
|
||||
|
||||
if (isset($modifiers['ban message'])) {
|
||||
$post['modifiers']['ban message'] = \strip_tags($modifiers['ban message']);
|
||||
error_log($post['modifiers']['ban message']);
|
||||
$post['modifiers']['ban message'] = $modifiers['ban message'];
|
||||
}
|
||||
if (isset($modifiers['warning message'])) {
|
||||
$post['modifiers']['warning message'] = \strip_tags($modifiers['warning message']);
|
||||
error_log($post['modifiers']['warning message']);
|
||||
$post['modifiers']['warning message'] = $modifiers['warning message'];
|
||||
}
|
||||
}
|
||||
// Remove modifiers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue