summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/libraries/MY_ORM.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/libraries/MY_ORM.php b/modules/gallery/libraries/MY_ORM.php
index ac61e75b..4194162b 100644
--- a/modules/gallery/libraries/MY_ORM.php
+++ b/modules/gallery/libraries/MY_ORM.php
@@ -23,10 +23,10 @@ class ORM extends ORM_Core {
* Make sure that we're only using integer ids.
*/
static function factory($model, $id=null) {
- if ($id && !is_int($id)) {
+ if ($id && !is_int($id) && !is_string($id)) {
throw new Exception("@todo ORM::factory requires integer ids");
}
- return ORM_Core::factory($model, $id);
+ return ORM_Core::factory($model, (int) $id);
}
public function save() {