From e4253ff56d759f4f8151565e2224748ec098f8d9 Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Thu, 27 Oct 2011 11:34:34 +0000 Subject: [PATCH] Followup 100813, use Xml::encodeJsVar and Html::inlineScript --- ReCaptcha.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ReCaptcha.php b/ReCaptcha.php index b7c3d27..a875527 100644 --- a/ReCaptcha.php +++ b/ReCaptcha.php @@ -74,10 +74,9 @@ class ReCaptcha extends SimpleCaptcha { function getForm() { global $wgReCaptchaPublicKey, $wgReCaptchaTheme; $useHttps = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ); - $escapedTheme = Xml::escapeJsString( $wgReCaptchaTheme ); + $js = 'var RecaptchaOptions = ' . Xml::encodeJsVar( array( 'theme' => $wgReCaptchaTheme, 'tabindex' => 1 ) ); - return " " . - recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps); + return Html::inlineScript( $js ) . recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps); } /** -- 2.30.2