projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5577184
)
CRM-20970 - avoid MySQL error caused by long numeric postal codes
author
mark burdett
<mfburdett@gmail.com>
Wed, 26 Jul 2017 02:13:05 +0000
(19:13 -0700)
committer
mark burdett
<mfburdett@gmail.com>
Wed, 26 Jul 2017 02:13:05 +0000
(19:13 -0700)
CRM/Contact/BAO/Query.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Contact/BAO/Query.php
b/CRM/Contact/BAO/Query.php
index 2e4d34c0745219ebd5eb10e14db59bf41ade3b07..5d1eeff495975c9c672275c94b3007b056f3c1c4 100644
(file)
--- a/
CRM/Contact/BAO/Query.php
+++ b/
CRM/Contact/BAO/Query.php
@@
-3625,7
+3625,7
@@
WHERE $smartGroupClause
// Handle numeric postal code range searches properly by casting the column as numeric
if (is_numeric($value)) {
- $field = "IF (civicrm_address.postal_code REGEXP '^[0-9]
+
$', CAST(civicrm_address.postal_code AS UNSIGNED), 0)";
+ $field = "IF (civicrm_address.postal_code REGEXP '^[0-9]
{1,10}
$', CAST(civicrm_address.postal_code AS UNSIGNED), 0)";
$val = CRM_Utils_Type::escape($value, 'Integer');
}
else {