Removes Google web search from exception page
authorJuan Osorio <osorio.juan@microsoft.com>
Fri, 9 Nov 2018 22:45:55 +0000 (14:45 -0800)
committerReedy <reedy@wikimedia.org>
Thu, 7 Feb 2019 22:59:29 +0000 (22:59 +0000)
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.31
includes/exception/MWExceptionRenderer.php
languages/i18n/en.json
languages/i18n/qqq.json

index a8cc760..5594503 100644 (file)
@@ -52,6 +52,8 @@ THIS IS NOT A RELEASE YET
 * (T210621) User: Bypass repeatable-read when creating an actor_id.
 * (T204531) rdbms: reduce LoadBalancer replication log spam.
 * (T195525) Fix db error outage page.
+* (T208871) The hard-coded Google search form on the database error page was
+  removed.
 
 == MediaWiki 1.31.1 ==
 
index 88b28df..5d75036 100644 (file)
@@ -332,47 +332,7 @@ class MWExceptionRenderer {
                                htmlspecialchars( $e->getTraceAsString() ) . '</pre>';
                }
 
-               $html .= '<hr />';
-               $html .= self::googleSearchForm();
                $html .= '</body></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 = <<<EOT
-<div style="margin: 1.5em">$usegoogle<br />
-<small>$outofdate</small>
-</div>
-<form method="get" action="//www.google.com/search" id="googlesearch">
-       <input type="hidden" name="domains" value="$server" />
-       <input type="hidden" name="num" value="50" />
-       <input type="hidden" name="ie" value="UTF-8" />
-       <input type="hidden" name="oe" value="UTF-8" />
-       <input type="text" name="q" size="31" maxlength="255" value="$search" />
-       <input type="submit" name="btnG" value="$googlesearch" />
-       <p>
-               <label><input type="radio" name="sitesearch" value="$server" checked="checked" />$sitename</label>
-               <label><input type="radio" name="sitesearch" value="" />WWW</label>
-       </p>
-</form>
-EOT;
-               return $trygoogle;
-       }
 }
index 7ebdd5b..ded741d 100644 (file)
        "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.",
index 0067c8f..7058278 100644 (file)
        "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}}",