diff --git a/Sources/Post.php b/Sources/Post.php index 90b21d3cc6..750f90c957 100644 --- a/Sources/Post.php +++ b/Sources/Post.php @@ -748,9 +748,11 @@ 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_text'] = sprintf($txt['last_edit_by'], $context['last_modified'], $row['modified_name']) . empty($row['modified_reason']) ? '' : ' ' . $txt['last_edit_reason'] . ': ' . $row['modified_reason']; + $context['last_modified_name'] = $row['modified_name']; + $context['last_modified_text'] = sprintf($txt['last_edit_by'], $context['last_modified'], $row['modified_name']) . (empty($row['modified_reason']) ? '' : ' ' . sprintf($txt['last_edit_reason'], $row['modified_reason'])); } // Get the stuff ready for the form. @@ -1612,25 +1614,14 @@ function ($val) use ($smcFunc) 'attributes' => array( 'size' => 80, 'maxlength' => 80, - 'value' => isset($context['last_modified_reason']) ? $context['last_modified_reason'] : '', + // If same user is editing again, keep the previous edit reason by default. + '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']) ? '' : '