Skip to content

Commit

Permalink
Merge pull request SimpleMachines#7774 from DiegoAndresCortes/quicked…
Browse files Browse the repository at this point in the history
…it-modifyreason

[2.1] Set quick edit to have same behavior as modify
  • Loading branch information
Sesquipedalian committed Mar 16, 2024
2 parents 7e8fca8 + a744eaa commit ddf71e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Post.php
Expand Up @@ -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(
Expand All @@ -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.
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit ddf71e9

Please sign in to comment.