- if (defined $dest && ! $attachment) {
- # They renamed the page they were editing. This requires
- # fixups to the edit form state.
- # Tweak the edit form to be editing the new page.
- $postrename->param("page", $dest);
- }
+ if (defined $dest) {
+ if (! $attachment) {
+ # They renamed the page they were editing. This requires
+ # fixups to the edit form state.
+ # Tweak the edit form to be editing the new page.
+ $postrename->param("page", $dest);
+ }
+
+ # Update edit form content to fix any links present
+ # on it.
+ $postrename->param("editcontent",
+ renamepage_hook($dest, $src, $dest,
+ $postrename->param("editcontent")));