Skip to content

Commit 527f397

Browse files
authored
Merge pull request #1072 from whitevast/patch-5
Update xray.class.php
2 parents 6a15b2c + 6855852 commit 527f397

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

modules/xray/xray.class.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -973,11 +973,14 @@ function admin(&$out)
973973
if($this->mode == 'chart') {
974974
$arrayDB = array_slice(array_reverse($responce['LIST']), 0, 7);
975975
echo json_encode($arrayDB);
976-
} else if($this->mode == 'showdbload' && isset($GLOBALS['db']->dbh->stat)) {
977-
$DBstat = $GLOBALS['db']->dbh->stat;
978-
$DBstat = explode(' ', $DBstat);
979-
$DBstat_PerSec = preg_replace('/[^0-9.]/', '', $DBstat[7]);
980-
$DBstat_PerSecType = 'main';
976+
} else if($this->mode == 'showdbload') {
977+
if(isset($GLOBALS['db']->dbh->stat)) {
978+
$DBstat = $GLOBALS['db']->dbh->stat;
979+
$DBstat = explode(' ', $DBstat);
980+
$DBstat_PerSec = preg_replace('/[^0-9.]/', '', $DBstat[7]);
981+
$DBstat_PerSecType = 'main';
982+
}
983+
else $DBstat_PerSec = 0;
981984

982985
if(round($DBstat_PerSec) == 0) {
983986
$select = SQLSelect("SHOW GLOBAL STATUS");

0 commit comments

Comments
 (0)