Merge "Move callers away from Title::GAID_FOR_UPDATE"
[lhc/web/wiklou.git] / includes / api / ApiEditPage.php
index 3f63a00..fdf9cf1 100644 (file)
@@ -62,9 +62,7 @@ class ApiEditPage extends ApiBase {
 
                                /** @var Title $newTitle */
                                foreach ( $titles as $id => $newTitle ) {
-                                       if ( !isset( $titles[$id - 1] ) ) {
-                                               $titles[$id - 1] = $oldTitle;
-                                       }
+                                       $titles[ $id - 1 ] = $titles[ $id - 1 ] ?? $oldTitle;
 
                                        $redirValues[] = [
                                                'from' => $titles[$id - 1]->getPrefixedText(),
@@ -380,6 +378,7 @@ class ApiEditPage extends ApiBase {
                $status = $ep->attemptSave( $result );
                $wgRequest = $oldRequest;
 
+               $r = [];
                switch ( $status->value ) {
                        case EditPage::AS_HOOK_ERROR:
                        case EditPage::AS_HOOK_ERROR_EXPECTED: