diff --git a/lib/db.php b/lib/db.php index e70d66fc2ba..dd48c329490 100644 --- a/lib/db.php +++ b/lib/db.php @@ -344,7 +344,7 @@ class OC_DB { $result = self::executeAudited('SELECT lastval() AS id'); $row = $result->fetchRow(); self::raiseExceptionOnError($row, 'fetching row for insertid failed'); - return $row['id']; + return (int)$row['id']; } else if( $type === 'mssql') { if($table !== null) { $prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); @@ -368,7 +368,7 @@ class OC_DB { $result = self::$connection->lastInsertId($table); } self::raiseExceptionOnError($result, 'insertid failed'); - return $result; + return (int)$result; } /**