diff --git a/main/inc/lib/log.class.php b/main/inc/lib/log.class.php index 4e99beae17..92b0cd1631 100644 --- a/main/inc/lib/log.class.php +++ b/main/inc/lib/log.class.php @@ -72,11 +72,7 @@ class Log public static function frame($index) { $result = debug_backtrace(); - array_shift($result); - for ($i = 0; $i++; $i < $index) { - array_shift($result); - } - return $result; + return isset($result[$index]) ? $result[$index] : array(); } public static function write($level, $message, $context = array()) diff --git a/main/install/i_database.class.php b/main/install/i_database.class.php index b5f58060f4..174402f140 100644 --- a/main/install/i_database.class.php +++ b/main/install/i_database.class.php @@ -12,13 +12,13 @@ class iDatabase extends Database static function select_db($database_name, $connection = null) { - Log::notice(__FUNCTION__ . ' ' . $database_name, Log::get_frame(1)); + Log::notice(__FUNCTION__ . ' ' . $database_name, Log::frame(1)); parent::select_db($database_name, $connection); } static function query($query, $connection = null, $file = null, $line = null) { - Log::notice(__FUNCTION__ . ' ' . $database_name, Log::get_frame(1)); + Log::notice(__FUNCTION__ . ' ' . $database_name, Log::frame(1)); parent::query($query, $connection, $file, $line); }