Skip to content

Commit

Permalink
BUGFIX: Fix errors submitting a credit card field
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewandante authored and chillu committed Mar 12, 2012
1 parent 960e342 commit 199dd64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion forms/CreditCardField.php
Expand Up @@ -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
Expand Down

1 comment on commit 199dd64

@halkyon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the coding style here, but you should put if on one line, or in braces as per our coding conventions.

Please sign in to comment.