CRM-13660 - Core Resources - Fix init of CRM.formatMoney
authorColeman Watts <coleman@civicrm.org>
Mon, 28 Oct 2013 17:52:37 +0000 (10:52 -0700)
committerColeman Watts <coleman@civicrm.org>
Mon, 28 Oct 2013 17:52:37 +0000 (10:52 -0700)
CRM/Core/Resources.php

index de140198491a27aac7ebdfdf1dc5585c7128d89f..d2e79f229eb4cb5824ec91efbafdeefa62cbc26a 100644 (file)
@@ -456,7 +456,7 @@ class CRM_Core_Resources {
       // Initialize CRM.url and CRM.formatMoney
       $url = CRM_Utils_System::url('civicrm/example', 'placeholder', FALSE, NULL, FALSE);
       $js = "CRM.url('init', '$url');\n";
-      $js .= "CRM.formatMoney('init', '" . CRM_Utils_Money::format(1234.56) . "');";
+      $js .= "CRM.formatMoney('init', " . json_encode(CRM_Utils_Money::format(1234.56)) . ");";
       $this->addScript($js, $jsWeight++, $region);
 
       // Add global settings