BUGFIX: Fix errors submitting a credit card field

This commit is contained in:
Andrew O'Neil 2012-03-12 16:27:41 +13:00 committed by Ingo Schommer
parent 960e3428b6
commit 199dd648da

View File

@ -7,7 +7,9 @@
class CreditCardField extends TextField {
function Field() {
$parts = explode("\n", chunk_split($this->value,4,"\n"));
$parts = $this->value;
if(!is_array($parts))
$parts = explode("\n", chunk_split($parts,4,"\n"));
$parts = array_pad($parts, 4, "");
// TODO Mark as disabled/readonly