diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-08-27 16:11:47 -0700 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-08-27 16:11:47 -0700 |
| commit | 74363ced870d4114e7570729636875e0258917b3 (patch) | |
| tree | 61bc27831a362994fc96ea90172d50e25d5c76cb /system/libraries | |
| parent | 98e9a96ba4d2419e02717369be8c0d886bc35ef7 (diff) | |
| parent | 4828db003f3ee505eb9e6d056cdb142da34b78ff (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3 into HEAD
Conflicts:
modules/slideshow/helpers/slideshow_event.php
Diffstat (limited to 'system/libraries')
| -rw-r--r-- | system/libraries/Database.php | 9 | ||||
| -rw-r--r-- | system/libraries/ORM.php | 4 | ||||
| -rw-r--r-- | system/libraries/drivers/Database.php | 4 |
3 files changed, 12 insertions, 5 deletions
diff --git a/system/libraries/Database.php b/system/libraries/Database.php index 6267f63a..2039371c 100644 --- a/system/libraries/Database.php +++ b/system/libraries/Database.php @@ -2,7 +2,7 @@ /** * Provides database access in a platform agnostic way, using simple query building blocks. * - * $Id: Database.php 4342 2009-05-08 16:56:01Z jheathco $ + * $Id: Database.php 4438 2009-07-06 04:11:16Z kiall $ * * @package Core * @author Kohana Team @@ -1144,7 +1144,12 @@ class Database_Core { $query = $this->select('COUNT(*) AS '.$this->escape_column('records_found'))->get()->result(TRUE); - return (int) $query->current()->records_found; + $query = $query->current(); + + if ( ! $query) + return 0; + else + return (int) $query->records_found; } /** diff --git a/system/libraries/ORM.php b/system/libraries/ORM.php index c1048604..5196ba27 100644 --- a/system/libraries/ORM.php +++ b/system/libraries/ORM.php @@ -1295,7 +1295,9 @@ class ORM_Core { $value = (float) $value; break; case 'boolean': - $value = (bool) $value; + if ($value === "t") $value = true; // For PgSQL + else if ($value === "f") $value = false; // For PgSQL + else $value = (bool) $value; break; case 'string': $value = (string) $value; diff --git a/system/libraries/drivers/Database.php b/system/libraries/drivers/Database.php index 807469f6..27f6ea8e 100644 --- a/system/libraries/drivers/Database.php +++ b/system/libraries/drivers/Database.php @@ -120,7 +120,7 @@ abstract class Database_Driver { $key .= ' ='; } - $value = ($value == TRUE) ? ' 1' : ' 0'; + $value = ($value == TRUE) ? ' TRUE' : ' FALSE'; } else { @@ -310,7 +310,7 @@ abstract class Database_Driver { $value = '\''.$this->escape_str($value).'\''; break; case 'boolean': - $value = (int) $value; + $value = ($value == TRUE) ? 'TRUE' : 'FALSE'; break; case 'double': // Convert to non-locale aware float to prevent possible commas |
