]> git.mxchange.org Git - friendica.git/blobdiff - include/dba.php
Merge pull request #5328 from annando/item-activities
[friendica.git] / include / dba.php
index 9d828f8b440e40ac8147662eefc32acd328bd4ff..b95589970edd5f3c48e91a12051de29174d311bd 100644 (file)
@@ -955,6 +955,8 @@ class dba {
         * @return boolean Was the command executed successfully?
         */
        public static function rollback() {
+               $ret = false;
+
                switch (self::$driver) {
                        case 'pdo':
                                if (!self::$db->inTransaction()) {
@@ -1109,7 +1111,7 @@ class dba {
 
                                        // Split the SQL queries in chunks of 100 values
                                        // We do the $i stuff here to make the code better readable
-                                       $i = $counter[$key_table][$key_condition];
+                                       $i = isset($counter[$key_table][$key_condition]) ? $counter[$key_table][$key_condition] : 0;
                                        if (isset($compacted[$key_table][$key_condition][$i]) && count($compacted[$key_table][$key_condition][$i]) > 100) {
                                                ++$i;
                                        }