From: Eileen McNaughton Date: Wed, 11 Jun 2014 01:34:35 +0000 (+1200) Subject: CRM-14838 tokens not working when value is rendered as an integer X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=785374a68289d770aa670c31db95ed9d88b01d74;p=civicrm-core.git CRM-14838 tokens not working when value is rendered as an integer --- diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index 83ccea7cd2..f4a66683a1 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -202,7 +202,7 @@ class CRM_Utils_Address { // for every token, replace {fooTOKENbar} with fooVALUEbar if // the value is not empty, otherwise drop the whole {fooTOKENbar} foreach ($replacements as $token => $value) { - if ($value && is_string($value)) { + if ($value && is_string($value) || is_numeric($value)) { $formatted = preg_replace("/{([^{}]*)\b{$token}\b([^{}]*)}/u", "\${1}{$value}\${2}", $formatted); } else {