]> source.dussan.org Git - nextcloud-server.git/commitdiff
always return int
authorJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 9 Jul 2013 11:17:01 +0000 (13:17 +0200)
committerAndreas Fischer <bantu@owncloud.com>
Mon, 29 Jul 2013 00:17:09 +0000 (02:17 +0200)
lib/db.php

index e70d66fc2ba2f8c6403aba9f8bf951ea1e1f1095..dd48c3294907cd3ddcbaa2f1ae11381778b4438e 100644 (file)
@@ -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;
        }
 
        /**