* @return string
*/
public function where($includeContactIDs = FALSE) {
- $params = [];
-
$low = CRM_Utils_Array::value('postal_code_low',
$this->_formValues
);
$high = CRM_Utils_Array::value('postal_code_high',
$this->_formValues
);
+ $errorMessage = NULL;
if ($low == NULL || $high == NULL) {
- CRM_Core_Error::statusBounce(ts('Please provide start and end postal codes'),
+ $errorMessage = ts('Please provide start and end postal codes.');
+ }
+
+ if (!is_numeric($low) || !is_numeric($high)) {
+ $errorMessage = ts('This search only supports numeric postal codes.');
+ }
+ if ($errorMessage) {
+ CRM_Core_Error::statusBounce($errorMessage,
CRM_Utils_System::url('civicrm/contact/search/custom',
"reset=1&csid={$this->_formValues['customSearchID']}",
FALSE, NULL, FALSE, TRUE