diff --git a/Sources/Post.php b/Sources/Post.php index 750f90c957..bd4a59e8a2 100644 --- a/Sources/Post.php +++ b/Sources/Post.php @@ -3171,7 +3171,6 @@ function JavaScriptModify() 'subject' => isset($_POST['subject']) ? $_POST['subject'] : null, 'body' => isset($_POST['message']) ? $_POST['message'] : null, 'icon' => isset($_REQUEST['icon']) ? preg_replace('~[\./\\\\*\':"<>]~', '', $_REQUEST['icon']) : null, - 'modify_reason' => (isset($_POST['modify_reason']) ? $_POST['modify_reason'] : ''), 'approved' => (isset($row['approved']) ? $row['approved'] : null), ); $topicOptions = array( @@ -3188,14 +3187,15 @@ function JavaScriptModify() 'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'], ); - // Only consider marking as editing if they have edited the subject, message or icon. - if ((isset($_POST['subject']) && $_POST['subject'] != $row['subject']) || (isset($_POST['message']) && $_POST['message'] != $row['body']) || (isset($_REQUEST['icon']) && $_REQUEST['icon'] != $row['icon'])) + // Only consider marking as editing if they have edited the subject, modify reason, message or icon. + if ((isset($_POST['subject']) && $_POST['subject'] != $row['subject']) || (isset($_POST['message']) && $_POST['message'] != $row['body']) || (isset($_REQUEST['icon']) && $_REQUEST['icon'] != $row['icon']) || (isset($_POST['modify_reason']) && $_POST['modify_reason'] != $row['modified_reason'])) { // And even then only if the time has passed... if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member']) { $msgOptions['modify_time'] = time(); $msgOptions['modify_name'] = $user_info['name']; + $msgOptions['modify_reason'] = (isset($_POST['modify_reason']) ? $_POST['modify_reason'] : ''); } } // If nothing was changed there's no need to add an entry to the moderation log. @@ -3257,7 +3257,7 @@ function JavaScriptModify() 'time' => isset($msgOptions['modify_time']) ? timeformat($msgOptions['modify_time']) : '', 'timestamp' => isset($msgOptions['modify_time']) ? $msgOptions['modify_time'] : 0, 'name' => isset($msgOptions['modify_time']) ? $msgOptions['modify_name'] : '', - 'reason' => $msgOptions['modify_reason'], + 'reason' => isset($msgOptions['modify_reason']) ? $msgOptions['modify_reason'] : '', ), 'subject' => $msgOptions['subject'], 'first_in_topic' => $row['id_msg'] == $row['id_first_msg'],