From 199dd648da538cd307e8153c651bee5bbdb7d5a6 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Mon, 12 Mar 2012 16:27:41 +1300 Subject: [PATCH] BUGFIX: Fix errors submitting a credit card field --- forms/CreditCardField.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/forms/CreditCardField.php b/forms/CreditCardField.php index 2af91fef6..f9c90752e 100644 --- a/forms/CreditCardField.php +++ b/forms/CreditCardField.php @@ -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