jenkins-bot has submitted this change and it was merged.

Change subject: Remove usage of deprecated Xml::escapeJsString
......................................................................


Remove usage of deprecated Xml::escapeJsString

* Also add JS encoding in a few places

Change-Id: I0321d7c505148976efccb37820e39ca17c377a92
---
M gateway_forms/Form.php
M globalcollect_gateway/globalcollect_gateway.body.php
2 files changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Awight: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/gateway_forms/Form.php b/gateway_forms/Form.php
index 4ed44e7..52d7f05 100644
--- a/gateway_forms/Form.php
+++ b/gateway_forms/Form.php
@@ -629,7 +629,7 @@
                $form .= '</tr>';
                $form .= '<tr>';
                $form .= '<td class="label"></td>';
-               $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, 
array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', 
$this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 
'clearField( this, \'' . wfMessage( 'donate_interface-other' )->text() . '\' 
)', 'onblur' => 'document.getElementById("otherRadio").value = this.value;if 
(this.value > 0) document.getElementById("otherRadio").checked=true;', 
'maxlength' => '10', 'id' => 'amountOther' ) ) .
+               $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, 
array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', 
$this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 
'clearField( this, ' . Xml::encodeJsVar( wfMessage( 'donate_interface-other' 
)->text() ) . ' )', 'onblur' => 'document.getElementById("otherRadio").value = 
this.value;if (this.value > 0) 
document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'id' 
=> 'amountOther' ) ) .
                        ' ' . $this->generateCurrencyDropdown() . '</td>';
                $form .= '</tr>';
                return $form;
@@ -745,8 +745,8 @@
                $form .= '</tr>';
                $form .= '<tr>';
                $form .= '<td class="label">' . Xml::label( wfMessage( 
'donate_interface-donor-name' )->text(), 'fname' ) . '</td>';
-               $form .= '<td>' . Xml::input( 'fname', '30', 
$this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 
'clearField( this, \'' . Xml::escapeJsString( wfMessage( 
'donate_interface-donor-fname' )->text() ) . '\' )', 'maxlength' => '25', 
'class' => 'required', 'id' => 'fname' ) ) .
-                       Xml::input( 'lname', '30', $this->getEscapedValue( 
'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . 
Xml::escapeJsString( wfMessage( 'donate_interface-donor-lname' )->text() ) . 
'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
+               $form .= '<td>' . Xml::input( 'fname', '30', 
$this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 
'clearField( this, ' . Xml::encodeJsVar( wfMessage( 
'donate_interface-donor-fname' )->text() ) . ' )', 'maxlength' => '25', 'class' 
=> 'required', 'id' => 'fname' ) ) .
+                       Xml::input( 'lname', '30', $this->getEscapedValue( 
'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, ' . 
Xml::encodeJsVar( wfMessage( 'donate_interface-donor-lname' )->text() ) . ' )', 
'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
                $form .= "</tr>";
                return $form;
        }
diff --git a/globalcollect_gateway/globalcollect_gateway.body.php 
b/globalcollect_gateway/globalcollect_gateway.body.php
index 11329d7..926a4d9 100644
--- a/globalcollect_gateway/globalcollect_gateway.body.php
+++ b/globalcollect_gateway/globalcollect_gateway.body.php
@@ -249,9 +249,9 @@
 
                $queryString = '?payment_method=' . 
$this->adapter->getPaymentMethod() . '&payment_submethod=' . 
$this->adapter->getPaymentSubmethod();
 
-               $url = $this->adapter->getThankYouPage() . $queryString;
+               $encUrl = Xml::encodeJsVar( $this->adapter->getThankYouPage() . 
$queryString );
 
-               $link = HTML::input('MyButton', $this->msg( 
'donate_interface-bt-finished')->text(), 'button', array( 'onclick' => 
"window.location = '$url'" ) );
+               $link = HTML::input('MyButton', $this->msg( 
'donate_interface-bt-finished')->text(), 'button', array( 'onclick' => 
"window.location = $encUrl" ) );
 
                $return .= Xml::tags( 'p', array( 'style' => 
'text-align:center;' ), $link );
                $return .= Xml::closeElement( 'div' );  // $id
@@ -313,9 +313,9 @@
 
                $queryString = '?payment_method=' . 
$this->adapter->getPaymentMethod() . '&payment_submethod=' . 
$this->adapter->getPaymentSubmethod();
 
-               $url = $this->adapter->getThankYouPage() . $queryString;
+               $encUrl = Xml::encodeJsVar( $this->adapter->getThankYouPage() . 
$queryString );
 
-               $link = HTML::input('MyButton', 'finished', 'button', array( 
'onclick' => "window.location = '$url'" ) );
+               $link = HTML::input('MyButton', 'finished', 'button', array( 
'onclick' => "window.location = $encUrl" ) );
 
                $return .= Xml::tags( 'p', array(), $link );
                $return .= Xml::closeElement( 'div' );  // $id

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0321d7c505148976efccb37820e39ca17c377a92
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: PleaseStand <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to