X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FMovePage.php;h=1e9570d2f7eed9b49c32567fd8bc5046e16a74f3;hp=2f8255ba388e3f9dfbdbbec95acf1d355e6daa19;hb=631e8695b15412ec16c31623cbd6e5aa3d6efb1e;hpb=13e59687c81b6bdd9b7fab8a49aee8ffd68e0a21 diff --git a/includes/MovePage.php b/includes/MovePage.php index 2f8255ba38..1e9570d2f7 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -310,7 +310,7 @@ class MovePage { # Protect the redirect title as the title used to be... $res = $dbw->select( 'page_restrictions', - '*', + [ 'pr_type', 'pr_level', 'pr_cascade', 'pr_user', 'pr_expiry' ], [ 'pr_page' => $pageid ], __METHOD__, 'FOR UPDATE' @@ -415,7 +415,9 @@ class MovePage { new AtomicSectionUpdate( $dbw, __METHOD__, - function () use ( $params ) { + // Hold onto $user to avoid HHVM bug where it no longer + // becomes a reference (T118683) + function () use ( $params, &$user ) { Hooks::run( 'TitleMoveComplete', $params ); } ) @@ -597,7 +599,12 @@ class MovePage { $redirectArticle->doEditUpdates( $redirectRevision, $user, [ 'created' => true ] ); - ChangeTags::addTags( $changeTags, null, $redirectRevId, null ); + // make a copy because of log entry below + $redirectTags = $changeTags; + if ( in_array( 'mw-new-redirect', ChangeTags::getSoftwareTags() ) ) { + $redirectTags[] = 'mw-new-redirect'; + } + ChangeTags::addTags( $redirectTags, null, $redirectRevId, null ); } }