public function validateValue($value = null) { if (!parent::validateValue($value)) { return false; } if (!isset($value)) { $value = $this->value; } $value = ereg_replace('[^0-9]', '', $value); // Check if the number itself is valid if (!$this->validnumber($value)) { if (!empty($this->validation_ccnumber_invalid)) { $this->invalid = xarML($this->validation_ccnumber_invalid); } else { $this->invalid = xarML('#(1) #(2): is not a valid credit card', $this->name, $this->desc); } $this->value = null; return false; } return true; }