dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add meta=userinfo&uiprop=latestcontrib"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialSearch.php
diff --git
a/includes/specials/SpecialSearch.php
b/includes/specials/SpecialSearch.php
index
e6d0632
..
f27a736
100644
(file)
--- a/
includes/specials/SpecialSearch.php
+++ b/
includes/specials/SpecialSearch.php
@@
-102,7
+102,7
@@
class SpecialSearch extends SpecialPage {
/**
* Entry point
*
/**
* Entry point
*
- * @param string $par
+ * @param string
|null
$par
*/
public function execute( $par ) {
$request = $this->getRequest();
*/
public function execute( $par ) {
$request = $this->getRequest();
@@
-115,7
+115,7
@@
class SpecialSearch extends SpecialPage {
// parameter, but also as part of the primary url. This can have PII implications
// in releasing page view data. As such issue a 301 redirect to the correct
// URL.
// parameter, but also as part of the primary url. This can have PII implications
// in releasing page view data. As such issue a 301 redirect to the correct
// URL.
- if (
strlen( $par ) && !strlen( $term )
) {
+ if (
$par !== null && $par !== '' && $term === ''
) {
$query = $request->getValues();
unset( $query['title'] );
// Strip underscores from title parameter; most of the time we'll want
$query = $request->getValues();
unset( $query['title'] );
// Strip underscores from title parameter; most of the time we'll want
@@
-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.
$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
$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' );
}
$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'
$url = $this->goResult( $term );
if ( $url !== null ) {
// successful 'go'
@@
-246,14
+243,12
@@
class SpecialSearch extends SpecialPage {
$this->namespaces = $nslist;
} elseif ( $profile === 'advanced' ) {
$this->namespaces = $nslist;
$this->namespaces = $nslist;
} elseif ( $profile === 'advanced' ) {
$this->namespaces = $nslist;
+ } elseif ( isset( $profiles[$profile]['namespaces'] ) ) {
+ $this->namespaces = $profiles[$profile]['namespaces'];
} else {
} else {
- if ( isset( $profiles[$profile]['namespaces'] ) ) {
- $this->namespaces = $profiles[$profile]['namespaces'];
- } else {
- // Unknown profile requested
- $profile = 'default';
- $this->namespaces = $profiles['default']['namespaces'];
- }
+ // Unknown profile requested
+ $profile = 'default';
+ $this->namespaces = $profiles['default']['namespaces'];
}
$this->fulltext = $request->getVal( 'fulltext' );
}
$this->fulltext = $request->getVal( 'fulltext' );
@@
-474,8
+469,7
@@
class SpecialSearch extends SpecialPage {
$offset = $this->offset;
}
$offset = $this->offset;
}
- $prevnext = $this->getLanguage()->viewPrevNext(
- $this->getPageTitle(),
+ $prevnext = $this->buildPrevNextNavigation(
$offset,
$this->limit,
$this->powerSearchOptions() + [ 'search' => $term ],
$offset,
$this->limit,
$this->powerSearchOptions() + [ 'search' => $term ],