[Solar-svn] Revision 2822

pmjones at solarphp.com pmjones at solarphp.com
Sat Oct 6 10:49:24 CDT 2007


Solar_Locale
------------

*  [FIX] When inserting values for name placeholders, cast the replacement value to a string



Modified: trunk/Solar/Locale.php
===================================================================
--- trunk/Solar/Locale.php	2007-10-06 15:48:38 UTC (rev 2821)
+++ trunk/Solar/Locale.php	2007-10-06 15:49:24 UTC (rev 2822)
@@ -237,7 +237,7 @@
         
         // get the translation of the key and force to an array.
         $trans = (array) $this->trans[$class][$key];
-
+        
         // find the number-appropriate version of the
         // translated key, if multiple values exist.
         if ($num != 1 && ! empty($trans[1])) {
@@ -259,7 +259,7 @@
             } else {
                 // associative array, use str_replace()
                 foreach ($replace as $key => $val) {
-                    $string = str_replace("{:$key}", $val, $string);
+                    $string = str_replace("{:$key}", (string) $val, $string);
                 }
             }
         }
@@ -285,7 +285,7 @@
         $base = str_replace('_', '/', $class);
         $file = Solar::fixdir($base . '/Locale/')
               . $this->_code . '.php';
-
+        
         // can we find the file?
         $target = Solar::fileExists($file);
         if ($target) {




More information about the Solar-svn mailing list