/** * Sanitize the card number . * * @param string $card * @return string|false */ public static function sanitize($card) { if (Master::isValid($card)) { return Master::sanitize($card); } elseif (Visa::isValid($card)) { return Visa::sanitize($card); } elseif (Amex::isValid($card)) { return Amex::sanitize($card); } return false; }
/** * @see \Tbs\Helper\CreditCard\Master::sanitize() * @dataProvider providerValidUnMasked */ public function testSanitizeTagsUnMasked($card) { $rs = Master::sanitize($card . '<script>alert("some content");</script>'); $this->assertEquals(Master::mask($card), $rs); }