$errors['extends'] = ts('If you plan on using this price set for membership signup and renewal, you can not also use it for Events or Contributions. However, a membership price set may include additional fields for non-membership options that require an additional fee (e.g. magazine subscription).');
}
}
- //checks the given price set doesnot start with digit
- $title = $fields['title'];
- if ($title) {
- // gives the ascii value
- $asciiValue = ord($title{0});
- if ($asciiValue >= 48 && $asciiValue <= 57) {
- $errors['title'] = ts("Name cannot not start with a digit");
- }
+ // Checks the given price set does not start with a digit
+ if (strlen($fields['title']) && is_numeric($fields['title'][0])) {
+ $errors['title'] = ts("Name cannot not start with a digit");
}
return empty($errors) ? TRUE : $errors;
}