fix some php8.0 showstoppers

This commit is contained in:
Xkeeper 2024-09-16 23:13:31 -07:00
parent aa9bc5d780
commit eeba015a21
No known key found for this signature in database
GPG Key ID: 397C04773ABE4045
4 changed files with 10 additions and 10 deletions

View File

@ -33,7 +33,7 @@
require 'lib/function.php'; require 'lib/function.php';
require 'lib/layout.php'; require 'lib/layout.php';
if ($x_hacks['smallbrowse'] == 1 and false) { if (false && $x_hacks['smallbrowse'] == 1) {
require 'mobile/index.php'; // alternate markup for mobile clients. require 'mobile/index.php'; // alternate markup for mobile clients.
} else { } else {
if (filter_string($_GET['action']) == 'markforumread' and $log) { if (filter_string($_GET['action']) == 'markforumread' and $log) {
@ -208,7 +208,7 @@
while ($in = $sql->fetch($data, MYSQL_ASSOC)) { while ($in = $sql->fetch($data, MYSQL_ASSOC)) {
$recent_threads .= "<tr> $recent_threads .= "<tr>
$tccell2><a href='forum.php?id=". $in['fid'] ."'>". $in['ftitle'] ."</a></td> $tccell2><a href='forum.php?id=". $in['fid'] ."'>". $in['ftitle'] ."</a></td>
$tccell1l>$newpost<a href='thread.php?id=". $in['id'] ."&end=1'>". $in['title'] ."</a></td> $tccell1l><a href='thread.php?id=". $in['id'] ."&end=1'>". $in['title'] ."</a></td>
$tccell1><a href='profile.php?id=". $in['user'] ."'><font ". getnamecolor($in['usex'], $in['upowerlevel']) .">". $in['uname'] ."</font></a></td> $tccell1><a href='profile.php?id=". $in['user'] ."'><font ". getnamecolor($in['usex'], $in['upowerlevel']) .">". $in['uname'] ."</font></a></td>
$tccell2>". timeunits(ctime() - $in['date']) ."</td> $tccell2>". timeunits(ctime() - $in['date']) ."</td>
</tr>\n"; </tr>\n";

View File

@ -52,14 +52,14 @@
// Bad Design Decisions 2001. // Bad Design Decisions 2001.
// :( // :(
if (!get_magic_quotes_gpc()) { if (!function_exists("get_magic_quotes_gpc")) {
$_GET = addslashes_array($_GET); $_GET = addslashes_array($_GET);
$_POST = addslashes_array($_POST); $_POST = addslashes_array($_POST);
$_COOKIE = addslashes_array($_COOKIE); $_COOKIE = addslashes_array($_COOKIE);
} }
if(!ini_get('register_globals')){ if(!ini_get('register_globals')){
$supers=array('_ENV', '_SERVER', '_GET', '_POST', '_COOKIE',); $supers=array('_ENV', '_SERVER', '_GET', '_POST', '_COOKIE',);
foreach($supers as $__s) if (is_array($$__s)) extract($$__s, EXTR_SKIP); foreach($supers as $__s) if (isset($$__s) && is_array($$__s)) extract($$__s, EXTR_SKIP);
unset($supers); unset($supers);
} }
} }
@ -188,7 +188,7 @@
$log = 0; $log = 0;
} }
if ($x_hacks['superadmin']) $loguser['powerlevel'] = 4; if ($x_hacks['superadmin'] ?? false) $loguser['powerlevel'] = 4;
$power = $loguser['powerlevel']; $power = $loguser['powerlevel'];
$banned = ($power<0); $banned = ($power<0);
@ -382,7 +382,7 @@ function generatenumbergfx($num,$minlen=0,$double=false){
} }
for($i=0;$i<strlen($num);$i++) { for($i=0;$i<strlen($num);$i++) {
$code = $num{$i}; $code = $num[$i];
switch ($code) { switch ($code) {
case "/": case "/":
$code = "slash"; $code = "slash";

View File

@ -100,7 +100,7 @@
background: #$bgcolor$bgimage; background: #$bgcolor$bgimage;
} }
". ($loguser['fontsize'] ? " ". (($loguser['fontsize'] ?? false) ? "
body { font-size: $loguser[fontsize]%; } body { font-size: $loguser[fontsize]%; }
" : "") ." " : "") ."
@ -444,7 +444,7 @@
<form action='login.php' method='post' name='logout'><input type='hidden' name='action' value='logout'></form> <form action='login.php' method='post' name='logout'><input type='hidden' name='action' value='logout'></form>
<td class='tbl tdbg1 center' colspan=3>$boardtitle"; <td class='tbl tdbg1 center' colspan=3>$boardtitle";
$header2=" $header2="
". (!$x_hacks['smallbrowse'] ? " ". (!($x_hacks['smallbrowse'] ?? false) ? "
</td><tr> </td><tr>
<td width='120px' class='tbl tdbg2 center fonts'><nobr>Views: $dispviews<br><img src=images/_.gif width=120 height=1></td> <td width='120px' class='tbl tdbg2 center fonts'><nobr>Views: $dispviews<br><img src=images/_.gif width=120 height=1></td>
<td width='100%' class='tbl tdbg2 center fonts'>$headlinks2</td> <td width='100%' class='tbl tdbg2 center fonts'>$headlinks2</td>

View File

@ -55,7 +55,7 @@ namespace {
$hash = sha1($hostname . $username . $flags); $hash = sha1($hostname . $username . $flags);
/* persistent connections start with p: */ /* persistent connections start with p: */
if ($hostname{1} !== ':' && isset(\Dshafik\MySQL::$connections[$hash])) { if ($hostname[1] !== ':' && isset(\Dshafik\MySQL::$connections[$hash])) {
\Dshafik\MySQL::$last_connection = \Dshafik\MySQL::$connections[$hash]['conn']; \Dshafik\MySQL::$last_connection = \Dshafik\MySQL::$connections[$hash]['conn'];
\Dshafik\MySQL::$connections[$hash]['refcount'] += 1; \Dshafik\MySQL::$connections[$hash]['refcount'] += 1;
return \Dshafik\MySQL::$connections[$hash]['conn']; return \Dshafik\MySQL::$connections[$hash]['conn'];
@ -729,7 +729,7 @@ namespace Dshafik {
{ {
$escapedString = ''; $escapedString = '';
for ($i = 0, $max = strlen($unescapedString); $i < $max; $i++) { for ($i = 0, $max = strlen($unescapedString); $i < $max; $i++) {
$escapedString .= self::escapeChar($unescapedString{$i}); $escapedString .= self::escapeChar($unescapedString[$i]);
} }
return $escapedString; return $escapedString;