Skip to content

Commit

Permalink
Uses uncensored modified_reason value as default when re-editing
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Sep 22, 2023
1 parent 5e58a89 commit cc20b0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ function Post($post_errors = array())
// When was it last modified?
if (!empty($row['modified_time']))
{
$modified_reason = $row['modified_reason'];
$context['last_modified'] = timeformat($row['modified_time']);
$context['last_modified_reason'] = censorText($row['modified_reason']);
$context['last_modified_name'] = $row['modified_name'];
Expand Down Expand Up @@ -1613,7 +1614,7 @@ function ($val) use ($smcFunc)
'size' => 80,
'maxlength' => 80,
// If same user is editing again, keep the previous edit reason by default.
'value' => isset($context['last_modified_reason']) && isset($context['last_modified_name']) && $context['last_modified_name'] === $user_info['name'] ? $context['last_modified_reason'] : '',
'value' => isset($modified_reason) && isset($context['last_modified_name']) && $context['last_modified_name'] === $user_info['name'] ? $modified_reason : '',
),
// If message has been edited before, show info about that.
'after' => empty($context['last_modified_text']) ? '' : '<div class="smalltext em">' . $context['last_modified_text'] . '</div>',
Expand Down

0 comments on commit cc20b0f

Please sign in to comment.