From 1d930860cc19513c1d6b3d4b325f77ab939c2973 Mon Sep 17 00:00:00 2001 From: Juan Osorio Date: Fri, 9 Nov 2018 14:45:55 -0800 Subject: [PATCH] Removes Google web search from exception page When a wiki is down, it is not necessarily useful to be able to search the web. Additionally, there is general consensus that the hard-coded Google search form should be removed. Bug: T208871 Change-Id: I5bcae848de1144d4fc1116c475b2e2ab1ccc3f7d --- RELEASE-NOTES-1.33 | 2 ++ includes/exception/MWExceptionRenderer.php | 40 ---------------------- languages/i18n/en.json | 3 -- languages/i18n/qqq.json | 3 -- 4 files changed, 2 insertions(+), 46 deletions(-) diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index a16968eb36..4e0f112a10 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -151,6 +151,8 @@ because of Phabricator reports. * … === Other changes in 1.33 === +* (T208871) The hard-coded Google search form on the database error page was + removed. * … == Compatibility == diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index f99ce1cf9e..22be2be05e 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -323,47 +323,7 @@ class MWExceptionRenderer { htmlspecialchars( $e->getTraceAsString() ) . ''; } - $html .= '
'; - $html .= self::googleSearchForm(); $html .= ''; echo $html; } - - /** - * @return string - */ - private static function googleSearchForm() { - global $wgSitename, $wgCanonicalServer, $wgRequest; - - $usegoogle = htmlspecialchars( self::msg( - 'dberr-usegoogle', - 'You can try searching via Google in the meantime.' - ) ); - $outofdate = htmlspecialchars( self::msg( - 'dberr-outofdate', - 'Note that their indexes of our content may be out of date.' - ) ); - $googlesearch = htmlspecialchars( self::msg( 'searchbutton', 'Search' ) ); - $search = htmlspecialchars( $wgRequest->getVal( 'search' ) ); - $server = htmlspecialchars( $wgCanonicalServer ); - $sitename = htmlspecialchars( $wgSitename ); - $trygoogle = <<$usegoogle
-$outofdate - -
- - - - - - -

- - -

-
-EOT; - return $trygoogle; - } } diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 39ba360957..2ea3986f78 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -4076,9 +4076,6 @@ "dberr-again": "Try waiting a few minutes and reloading.", "dberr-info": "(Cannot access the database: $1)", "dberr-info-hidden": "(Cannot access the database)", - "dberr-usegoogle": "You can try searching via Google in the meantime.", - "dberr-outofdate": "Note that their indexes of our content may be out of date.", - "dberr-cachederror": "This is a cached copy of the requested page, and may not be up to date.", "htmlform-invalid-input": "There are problems with some of your input.", "htmlform-select-badoption": "The value you specified is not a valid option.", "htmlform-int-invalid": "The value you specified is not an integer.", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index d02dabe3f8..2a0e00ab87 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -4279,9 +4279,6 @@ "dberr-again": "This message does not allow any wiki nor html markup.", "dberr-info": "This message does not allow any wiki nor html markup. Parameters:\n* $1 - database server name\nSee also:\n* {{msg-mw|Dberr-info-hidden}} - hides database server name", "dberr-info-hidden": "This message does not allow any wiki nor html markup.\n\nSee also:\n* {{msg-mw|Dberr-info}} - shows database server name", - "dberr-usegoogle": "This message does not allow any wiki nor html markup.", - "dberr-outofdate": "{{doc-singularthey}}\nIn this sentence, '''their''' indexes refers to '''Google's''' indexes. This message does not allow any wiki nor html markup.", - "dberr-cachederror": "Used as error message at the bottom of the page.", "htmlform-invalid-input": "Used as error message in HTML forms.\n\n* {{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-float-invalid}}\n* {{msg-mw|Htmlform-int-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}\n* {{msg-mw|Htmlform-select-badoption}}", "htmlform-select-badoption": "Used as error message in HTML forms.\n\n* {{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-float-invalid}}\n* {{msg-mw|Htmlform-int-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}", "htmlform-int-invalid": "Used as error message in HTML forms.\n\n* {{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-float-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}\n* {{msg-mw|Htmlform-select-badoption}}", -- 2.20.1