X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FDAO.php;h=02b3d3d1587f72fb0edf5c094bc30a726caa6f89;hb=ac7a239e2050ecd8e7b48ed43138be046b073de0;hp=55a25aeb9abd47d1017943e108912381509a2605;hpb=a66db41ec4eb1dd9c9d8757aaa7234b6a069bad2;p=civicrm-core.git diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 55a25aeb9a..02b3d3d158 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -2542,7 +2542,7 @@ SELECT contact_id // ternary operators case 'BETWEEN': case 'NOT BETWEEN': - if (empty($criteria[0]) || empty($criteria[1])) { + if ((empty($criteria[0]) && !in_array($criteria[0], ['0', 0]))|| (empty($criteria[1]) && !in_array($criteria[1], ['0', 0]))) { throw new Exception("invalid criteria for $operator"); } if (!$returnSanitisedArray) {