objectcache: add setMockTime() method to BagOStuff/WANObjectCache
[lhc/web/wiklou.git] / includes / MovePage.php
index fe82465..1e9570d 100644 (file)
@@ -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 );
                        }
                }