Merge "Revert "Split editcascadeprotected permission from protect permission""
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 2069638..d474ba5 100644 (file)
@@ -211,8 +211,8 @@ class SpecialSearch extends SpecialPage {
                        return;
                }
                # If there's an exact or very near match, jump right there.
-               $title = $this->newSearchEngine()->
-                       getNearMatcher( $this->getConfig() )->getNearMatch( $term );
+               $title = $this->getSearchEngine()
+                       ->getNearMatcher( $this->getConfig() )->getNearMatch( $term );
 
                if ( !is_null( $title ) &&
                        Hooks::run( 'SpecialSearchGoResult', [ $term, $title, &$url ] )
@@ -684,7 +684,10 @@ class SpecialSearch extends SpecialPage {
                                $user->setOption( 'searchNs' . $n, true );
                        }
 
-                       $user->saveSettings();
+                       DeferredUpdates::addCallableUpdate( function () use ( $user ) {
+                               $user->saveSettings();
+                       } );
+
                        return true;
                }
 
@@ -1235,6 +1238,7 @@ class SpecialSearch extends SpecialPage {
                        'name' => 'search',
                        'autofocus' => trim( $term ) === '',
                        'value' => $term,
+                       'dataLocation' => 'content',
                ] );
 
                $out =