Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksejs Cikuns <aleksejs.cikuns@zabbix.com>2022-03-03 15:04:20 +0300
committerAleksejs Cikuns <aleksejs.cikuns@zabbix.com>2022-03-03 15:04:20 +0300
commit707e2608f206d77722d2377da09f7c79a629e11a (patch)
treeeba10c4c3a4078ab75eb53a9390465f422302a06
parent3afda2e67cb9d4da28e2df0b923c7572bd9fed22 (diff)
..F....... [ZBXNEXT-7485] fixed debug_backtrace function usage for php8
-rw-r--r--ChangeLog.d/feature/ZBXNEXT-74851
-rw-r--r--ui/include/classes/debug/CProfiler.php8
-rw-r--r--ui/tests/templates/zabbix.conf.php2
3 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog.d/feature/ZBXNEXT-7485 b/ChangeLog.d/feature/ZBXNEXT-7485
new file mode 100644
index 00000000000..21f66f42b1d
--- /dev/null
+++ b/ChangeLog.d/feature/ZBXNEXT-7485
@@ -0,0 +1 @@
+A.F....... [ZBXNEXT-7485] fixed debug_backtrace function usage for php8 (acikuns)
diff --git a/ui/include/classes/debug/CProfiler.php b/ui/include/classes/debug/CProfiler.php
index cdcf4bf326a..53ac4507914 100644
--- a/ui/include/classes/debug/CProfiler.php
+++ b/ui/include/classes/debug/CProfiler.php
@@ -258,7 +258,7 @@ class CProfiler {
$this->sqlQueryLog[] = [
$time,
$sql,
- array_slice(debug_backtrace(), 1)
+ array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), 1)
];
}
@@ -271,7 +271,7 @@ class CProfiler {
* @param array $result
*/
public function profileApiCall($class, $method, array $params, $result) {
- $backtrace = debug_backtrace();
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
// Use the file name and line number from the first call to the API wrapper object.
// Due to a bug earlier versions of PHP 5.3 did not provide the file name and line number
@@ -317,7 +317,7 @@ class CProfiler {
$method,
$endpoint,
$query,
- array_slice(debug_backtrace(), 1)
+ array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), 1)
];
}
@@ -342,7 +342,7 @@ class CProfiler {
*/
public function formatCallStack(array $callStack = null) {
if (!$callStack) {
- $callStack = debug_backtrace(false);
+ $callStack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
// never show the call to this method
array_shift($callStack);
diff --git a/ui/tests/templates/zabbix.conf.php b/ui/tests/templates/zabbix.conf.php
index b44d90f80f2..23eb8a125a5 100644
--- a/ui/tests/templates/zabbix.conf.php
+++ b/ui/tests/templates/zabbix.conf.php
@@ -36,7 +36,7 @@ if (!defined('PHPUNIT_BASEDIR')) {
}
function formatCallStack() {
- $calls = debug_backtrace(0);
+ $calls = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
// never show the call to this method
array_shift($calls);