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

Change subject: DonationData::sanitizeValue: drop extra args
......................................................................


DonationData::sanitizeValue: drop extra args

HHVM currently has a bug whereby if a callback function passed to array_walk
has an arity greater than two, the names of arguments past the second argument
aren't bound. It's a bug in HHVM rather than DonationData. However, you're only
calling this function once, and you're not passing it the extra args, so it
costs us nothing, really, to hard-code them in.

Also change a bare '$matches;' declaration to actually declare the var by
assigning it null.

Change-Id: I0261979fde9bbdb6f3791b9decbd9928c8f7d796
---
M gateway_common/DonationData.php
M gateway_forms/RapidHtml.php
2 files changed, 3 insertions(+), 5 deletions(-)

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



diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index c1d4f67..0d0ed10 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -595,11 +595,9 @@
         *
         * @param $value string The value of the array
         * @param $key string The key of the array
-        * @param $flags int The flag constant for htmlspecialchars
-        * @param $double_encode bool Whether or not to double-encode strings
         */
-       protected function sanitizeInput( &$value, $key, $flags=ENT_COMPAT, 
$double_encode=false ) {
-               $value = htmlspecialchars( $value, $flags, 'UTF-8', 
$double_encode );
+       protected function sanitizeInput( &$value, $key ) {
+               $value = htmlspecialchars( $value, ENT_COMPAT, 'UTF-8', false );
        }
 
        /**
diff --git a/gateway_forms/RapidHtml.php b/gateway_forms/RapidHtml.php
index 330ca52..fba46d1 100644
--- a/gateway_forms/RapidHtml.php
+++ b/gateway_forms/RapidHtml.php
@@ -381,7 +381,7 @@
         * @return string
         */
        public function fix_dropdowns( $html ) {
-               $matches;
+               $matches = null;
                preg_match_all( '|<select.*>.*?</select>|is', $html, $matches );
 
                $numMatches = count( $matches[0] );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0261979fde9bbdb6f3791b9decbd9928c8f7d796
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: deploy-payments_1.22
Gerrit-Owner: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Mwalker <mwal...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to