diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-02-21 13:05:48 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-02-21 13:05:48 -0800 |
commit | cb57c3912aef6bed394a4693f94e9c97001aff34 (patch) | |
tree | 05bd48c953e11e7b18a0182202a062b4b1a914b7 | |
parent | f116af5287f7809e907ee56dbfa582f474738ae6 (diff) |
Fix random queries (such as for the random image block) for locales that don't use a period as decimal separator of floating point numbers (such as de_DE).
(Integrating a fix Kohana's SQL generation for floating point numbers. See http://dev.kohanaframework.org/issues/2636.)
-rw-r--r-- | system/libraries/Database.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/system/libraries/Database.php b/system/libraries/Database.php index 98e33fa0..253bb152 100644 --- a/system/libraries/Database.php +++ b/system/libraries/Database.php @@ -420,6 +420,11 @@ abstract class Database_Core { { return (string) $value; } + elseif (is_float($value)) + { + // Convert to non-locale aware float to prevent possible commas + return sprintf('%F', $value); + } return '\''.$this->escape($value).'\''; } |