r100960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100959‎ | r100960 | r100961 >
Date:11:34, 27 October 2011
Author:johnduhart
Status:ok
Tags:
Comment:
Followup 100813, use Xml::encodeJsVar and Html::inlineScript
Modified paths:
  • /trunk/extensions/ConfirmEdit/ReCaptcha.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ReCaptcha.php
@@ -74,10 +74,9 @@
7575 function getForm() {
7676 global $wgReCaptchaPublicKey, $wgReCaptchaTheme;
7777 $useHttps = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' );
78 - $escapedTheme = Xml::escapeJsString( $wgReCaptchaTheme );
 78+ $js = 'var RecaptchaOptions = ' . Xml::encodeJsVar( array( 'theme' => $wgReCaptchaTheme, 'tabindex' => 1 ) );
7979
80 - return "<script>var RecaptchaOptions = { theme : '$escapedTheme', tabindex : 1 }; </script> " .
81 - recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps);
 80+ return Html::inlineScript( $js ) . recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps);
8281 }
8382
8483 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100813Bug 31609 - Option to change reCAPTCHA theme...johnduhart14:51, 26 October 2011

Status & tagging log