aboutsummaryrefslogtreecommitdiffstats
path: root/includes/specials/SpecialSearch.php
diff options
context:
space:
mode:
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>2019-03-11 09:40:36 +0100
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>2019-03-11 09:50:52 +0100
commita2c1d8c0431ad111126f6cc22a51e7ecf2a45a1b (patch)
tree844145201ccbabd1f7ee88b08cd93e1dd2d705c6 /includes/specials/SpecialSearch.php
parent278ac40e9609b0b226a85e020f5e574054e1d78f (diff)
downloadmediawikicore-a2c1d8c0431ad111126f6cc22a51e7ecf2a45a1b.tar.gz
mediawikicore-a2c1d8c0431ad111126f6cc22a51e7ecf2a45a1b.zip
Use the WebRequest::getCheck() shortcut where possible
This is inspired by Ib117e05. As far as I can tell this is functionally identical. Even arrays should behave the same, as both the getVal() and getCheck() methods do have a special case that returns the `null` default in case the user tried to pass multiple values instead of a single scalar. Change-Id: Id4e4ec91f39d3c39461bd41673bdafc3bde11737
Diffstat (limited to 'includes/specials/SpecialSearch.php')
-rw-r--r--includes/specials/SpecialSearch.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php
index e6d06329ad74..e2114a11554b 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -129,7 +129,7 @@ class SpecialSearch extends SpecialPage {
$this->load();
// TODO: This performs database actions on GET request, which is going to
// be a problem for our multi-datacenter work.
- if ( !is_null( $request->getVal( 'nsRemember' ) ) ) {
+ if ( $request->getCheck( 'nsRemember' ) ) {
$this->saveNamespaces();
// Remove the token from the URL to prevent the user from inadvertently
// exposing it (e.g. by pasting it into a public wiki page) or undoing
@@ -141,10 +141,7 @@ class SpecialSearch extends SpecialPage {
}
$this->searchEngineType = $request->getVal( 'srbackend' );
- if (
- !$request->getVal( 'fulltext' ) &&
- $request->getVal( 'offset' ) === null
- ) {
+ if ( !$request->getVal( 'fulltext' ) && !$request->getCheck( 'offset' ) ) {
$url = $this->goResult( $term );
if ( $url !== null ) {
// successful 'go'