Mwalker has uploaded a new change for review.

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


Change subject: CC Numbers are at least 12 digits long
......................................................................

CC Numbers are at least 12 digits long

So lets not deny people with less than that -- otherwise
personal emails may get denied...

Change-Id: I1b16e080ca28f84724dc2ff744f2ee076a89a0e7
---
M gateway_common/DataValidator.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/90/55290/1

diff --git a/gateway_common/DataValidator.php b/gateway_common/DataValidator.php
index 46f1240..f2036b6 100644
--- a/gateway_common/DataValidator.php
+++ b/gateway_common/DataValidator.php
@@ -812,6 +812,10 @@
         * @return bool True if the number was valid according to the algorithm
         */
        public static function luhn_check( $str ) {
+               if ( count( $str ) < 12 ) {
+                       return false;
+               }
+
                $odd = !strlen( $str ) % 2;
                $sum = 0;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b16e080ca28f84724dc2ff744f2ee076a89a0e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Mwalker <[email protected]>

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

Reply via email to