Skip to content

Commit aa06cc4

Browse files
committed
php 8 compatibility fixes
1 parent 906f70c commit aa06cc4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/db/mysqli.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function query($sql, $stack=0) { // call with query($sql, 1) to store multiple
175175
return false;
176176
}
177177

178-
if (v($this->result[$stack]))
178+
if (v($this->result[$stack]) && gettype($this->result[$stack]) == 'object')
179179
@mysqli_free_result($this->result[$stack]);
180180

181181
$this->result[$stack] = "";
@@ -530,7 +530,7 @@ function getTruncateCommand( $table ) {
530530
function getFieldValues($table, $name) {
531531
$sql = 'show full fields from `'.$table.'` where `Field` = \''.$this->escape($name).'\'';
532532
$res = mysqli_query($this->conn, $sql);
533-
if (mysqli_num_rows($res) == 0)
533+
if (gettype($res) != 'object' || mysqli_num_rows($res) == 0)
534534
return ( (object) array('list' => array()) );
535535
$row = mysqli_fetch_array($res);
536536
$type = $row['Type'];
@@ -828,4 +828,4 @@ function set_constraint( $constraint, $value ) {
828828
}
829829
}
830830
}
831-
?>
831+
?>

lib/external/jcryption.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private function _bin2int($str) {
119119
$result = '0';
120120
$n = strlen($str);
121121
do {
122-
$result = bcadd(bcmul($result, '256'), ord($str {--$n} ));
122+
$result = bcadd(bcmul($result, '256'), ord($str [--$n] ));
123123
} while ($n > 0);
124124
return $result;
125125
}
@@ -196,7 +196,7 @@ private function _invmod($num, $mod) {
196196
private function _bitLen($num) {
197197
$tmp = $this->_int2bin($num);
198198
$bit_len = strlen($tmp) * 8;
199-
$tmp = ord($tmp {strlen($tmp) - 1} );
199+
$tmp = ord($tmp [strlen($tmp) - 1] );
200200
if (!$tmp) {
201201
$bit_len -= 8;
202202
} else {

0 commit comments

Comments
 (0)