Fo0bar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/51028


Change subject: Add $wgGoogleSiteSearchCharset for HTML templating
......................................................................

Add $wgGoogleSiteSearchCharset for HTML templating

Default 'UTF-8', used in htmlentities() when inserting strings into the
HTML template.  Thanks to mediawiki.org user Dmitry Rud for suggesting
this.

Change-Id: Iae12f5fb516fb1d0b008570443f9456faa24c0cf
---
M GoogleSiteSearch.php
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleSiteSearch 
refs/changes/28/51028/1

diff --git a/GoogleSiteSearch.php b/GoogleSiteSearch.php
index e386930..300754c 100644
--- a/GoogleSiteSearch.php
+++ b/GoogleSiteSearch.php
@@ -49,6 +49,9 @@
 if ( !isset( $wgGoogleSiteSearchOnly ) ) {
        $wgGoogleSiteSearchOnly = false;
 }
+if ( !isset( $wgGoogleSiteSearchCharset ) ) {
+       $wgGoogleSiteSearchCharset = 'UTF-8';
+}
 
 $dir = dirname( __FILE__ ) . '/';
 
@@ -83,10 +86,10 @@
        }
 
        # Replace variable data in the HTML
-       $outhtml = str_replace( '_GSS_CSE_ID_', htmlentities( 
$wgGoogleSiteSearchCSEID, ENT_QUOTES ), $outhtml );
-       $outhtml = str_replace( '_GSS_TERM_ESCAPE_', htmlentities( $term, 
ENT_QUOTES ), $outhtml );
-       $outhtml = str_replace( '_GSS_LANG_', htmlentities( $lang->getCode(), 
ENT_QUOTES ), $outhtml );
-       $outhtml = str_replace( '_GSS_LOADING_', htmlentities( wfMessage( 
'googlesitesearch-loading' ) ), $outhtml );
+       $outhtml = str_replace( '_GSS_CSE_ID_', htmlentities( 
$wgGoogleSiteSearchCSEID, ENT_QUOTES, $wgGoogleSiteSearchCharset ), $outhtml );
+       $outhtml = str_replace( '_GSS_TERM_ESCAPE_', htmlentities( $term, 
ENT_QUOTES, $wgGoogleSiteSearchCharset ), $outhtml );
+       $outhtml = str_replace( '_GSS_LANG_', htmlentities( $lang->getCode(), 
ENT_QUOTES, $wgGoogleSiteSearchCharset ), $outhtml );
+       $outhtml = str_replace( '_GSS_LOADING_', htmlentities( wfMessage( 
'googlesitesearch-loading', $wgGoogleSiteSearchCharset ) ), $outhtml );
 
        # Add it!
        $out->addWikiText( '== ' . wfMessage( 'googlesitesearch-google-results' 
) . ' ==' );

-- 
To view, visit https://gerrit.wikimedia.org/r/51028
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae12f5fb516fb1d0b008570443f9456faa24c0cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GoogleSiteSearch
Gerrit-Branch: master
Gerrit-Owner: Fo0bar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to