X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMovePage.php;h=614ea7daa5457f83a8f3f76f8b43bdff0fb315fe;hb=9dfc1941bc1820b72d74c65c6a83ad9925c42e7a;hp=8d0c33dcc286bd77a284e7e4f5250a1caacdd1dd;hpb=5d4099246e49ff3e2b369e329aaaf3286f883bcd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MovePage.php b/includes/MovePage.php index 8d0c33dcc2..614ea7daa5 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -57,7 +57,7 @@ class MovePage { // Convert into a Status object if ( $errors ) { foreach ( $errors as $error ) { - call_user_func_array( [ $status, 'fatal' ], $error ); + $status->fatal( ...$error ); } } @@ -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 ); } ) @@ -442,7 +444,6 @@ class MovePage { private function moveToInternal( User $user, &$nt, $reason = '', $createRedirect = true, array $changeTags = [] ) { - global $wgContLang; if ( $nt->exists() ) { $moveOverRedirect = true; $logType = 'move_redir'; @@ -511,7 +512,7 @@ class MovePage { $logEntry->setComment( $reason ); $logEntry->setParameters( [ '4::target' => $nt->getPrefixedText(), - '5::noredir' => $redirectContent ? '0': '1', + '5::noredir' => $redirectContent ? '0' : '1', ] ); $formatter = LogFormatter::newFromEntry( $logEntry ); @@ -520,8 +521,6 @@ class MovePage { if ( $reason ) { $comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason; } - # Truncate for whole multibyte characters. - $comment = $wgContLang->truncate( $comment, 255 ); $dbw = wfGetDB( DB_MASTER ); @@ -600,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 ); } }