Chad has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/390358 )
Change subject: WIP: search.wikimedia.org: Stop supporting non-Wikipedias
......................................................................
WIP: search.wikimedia.org: Stop supporting non-Wikipedias
Best we can tell, there's no evidence these other projects actually
get any traffic at all via this search gateway.
As this is a non-standard gateway that nobody should really use,
let's just simplify things further.
Change-Id: Ibaee5d2aa7270977e10a4c9bbf2ff30d8836d543
---
M docroot/search.wikimedia.org/index.php
1 file changed, 1 insertion(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/58/390358/1
diff --git a/docroot/search.wikimedia.org/index.php
b/docroot/search.wikimedia.org/index.php
index 95f76b8..986289b 100644
--- a/docroot/search.wikimedia.org/index.php
+++ b/docroot/search.wikimedia.org/index.php
@@ -17,23 +17,9 @@
error_reporting( E_ALL );
ini_set( "display_errors", false );
-$site = 'wikipedia';
$lang = 'en';
$search = '';
$limit = 20;
-
-$allowedSites = [
- 'wikipedia',
- 'wiktionary',
- 'wikinews',
- 'wikisource'
-];
-
-if ( isset( $_GET['site'] ) ) {
- if ( is_string( $_GET['site'] ) && in_array( $_GET['site'],
$allowedSites ) ) {
- $site = $_GET['site'];
- }
-}
if ( isset( $_GET['lang'] ) ) {
if ( preg_match( '/^[a-z]+(-[a-z]+)*$/', $_GET['lang'] ) ) {
@@ -61,7 +47,7 @@
$urlSearch = urlencode( $search );
# OpenSearch JSON suggest API
-$url =
"https://$lang.$site.org/w/api.php?action=opensearch&search=$urlSearch&limit=$limit";
+$url =
"https://$lang.wikipedia.org/w/api.php?action=opensearch&search=$urlSearch&limit=$limit";
$c = curl_init( $url );
curl_setopt_array( $c, [
CURLOPT_RETURNTRANSFER => true,
--
To view, visit https://gerrit.wikimedia.org/r/390358
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibaee5d2aa7270977e10a4c9bbf2ff30d8836d543
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits