CRM-14838 tokens not working when value is rendered as an integer
authorEileen McNaughton <eileen@fuzion.co.nz>
Wed, 11 Jun 2014 01:34:35 +0000 (13:34 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Wed, 11 Jun 2014 03:06:06 +0000 (15:06 +1200)
CRM/Utils/Address.php

index 83ccea7cd201a7983e6c9bc05cb5ba7dff5f80c8..f4a66683a14d8ab248ef5ee88429ea5b6ead85f1 100644 (file)
@@ -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 {