fix php 8.0 errors in backend

Dieser Commit ist enthalten in:
o.pinke 2021-01-12 19:46:45 +01:00
Ursprung b3f4d9ee27
Commit 586188c2cc
6 geänderte Dateien mit 20 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -133,6 +133,8 @@ function dbUpgradeTable($db, $table, $field, $type, $null, $key, $default, $extr
} else {
$parameter['DEFAULT'] = "DEFAULT '" . Contenido_Security::escapeDB($default, $db) . "'";
}
} else {
$parameter['DEFAULT'] = '';
}
if (!dbTableExists($db, $table)) {
@ -145,7 +147,7 @@ function dbUpgradeTable($db, $table, $field, $type, $null, $key, $default, $extr
// Remove auto_increment
$structure = dbGetColumns($db, $table);
if ($structure[$field]["Extra"] == "auto_increment") {
if (isset($structure[$field]) && !empty($structure[$field]["Extra"]) && $structure[$field]["Extra"] == "auto_increment") {
if ($structure[$field]['NULL'] == "") {
$structure[$field]['NULL'] = "NOT NULL";
}

Datei anzeigen

@ -396,6 +396,7 @@ function getLanguagesByClient($client) {
function getLanguageNamesByClient($client) {
global $db;
global $cfg;
$list = [];
$sql = "SELECT
a.idlang AS idlang,
@ -1238,7 +1239,7 @@ function buildCategorySelect($sName, $sValue, $sLevel = 0, $sStyle = "") {
foreach ($categories as $tmpidcat => $props) {
$spaces = "  ";
for ($i = 0; $i < $props["level"]; $i ++) {
for ($i = 0; $i < $props["level"]; $i++) {
$spaces .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}
@ -1282,7 +1283,7 @@ function human_readable_size($number) {
$n = (float) $number; //Appears to be necessary to avoid rounding
while ($n >= $base) {
$n /= (float) $base;
$usesuf ++;
$usesuf++;
}
$places = 2 - floor(log10($n));
@ -1315,7 +1316,7 @@ function array_csort() { //coded by Ichier2003
$msortline = "return(array_multisort(";
$i = 0;
foreach ($args as $arg) {
$i ++;
$i++;
if (is_string($arg)) {
foreach ($marray as $row) {
$a = strtoupper($row[$arg]);
@ -1327,7 +1328,9 @@ function array_csort() { //coded by Ichier2003
$msortline .= "\$sortarr[" . $i . "],";
}
$msortline .= "\$marray));";
@ eval($msortline);
if(is_array($marray) && count($marray) > 0) {
@ eval($msortline);
}
return $marray;
}
@ -1689,7 +1692,7 @@ function createRandomName($nameLength) {
$Vouel = 'aeiou';
$Name = "";
for ($index = 1; $index <= $nameLength; $index ++) {
for ($index = 1; $index <= $nameLength; $index++) {
if ($index % 3 == 0) {
$randomNumber = rand(1, strlen($Vouel));
$Name .= substr($Vouel, $randomNumber - 1, 1);

Datei anzeigen

@ -754,7 +754,7 @@ if (isset($bDebug) && $bDebug === true) {
var_dump($navigationTree);
echo '</pre>';
}
if (count($navigationTree[0])) {
if (is_array($navigationTree[0]) && count($navigationTree[0])) {
$sCategories = showTree(0, $aWholelist);
}

Datei anzeigen

@ -57,6 +57,9 @@ $currentstep = (empty($_GET['step'])) ? 1 : filter_input(INPUT_GET, "step", FILT
// Count DB Chunks
$file = fopen('data/tables.txt', 'r');
$step = 1;
$count = 1;
$fullcount = 1;
while (($data = fgetcsv($file, 4000, ';')) !== false) {
if ($count == 50) {
$count = 1;
@ -71,7 +74,7 @@ while (($data = fgetcsv($file, 4000, ';')) !== false) {
}
dbUpgradeTable($db, $_SESSION['dbprefix'] . '_' . $data[0], $data[1], $data[2], $data[3], $data[4], $data[5], $data[6], '', $drop);
if ($db->errno != 0) {
if ($db->getErrorNumber() != 0) {
$_SESSION['install_failedupgradetable'] = true;
}
}

Datei anzeigen

@ -107,7 +107,7 @@ function remove_remarks($sql) {
for ($i = 0; $i < $linecount; $i++) {
if (($i != ($linecount - 1)) || (strlen($lines[$i]) > 0)) {
if ($lines[$i][0] != "#") {
if (!empty($lines[$i][0]) && $lines[$i][0] != "#") {
$output .= $lines[$i] . "\n";
} else {
$output .= "\n";

Datei anzeigen

@ -97,13 +97,13 @@ class cSetupSetupSummary extends cSetupMask {
public function _getSelectedAdditionalPlugins() {
$aPlugins = array();
if ($_SESSION['plugin_newsletter'] == 'true') {
if (isset($_SESSION['plugin_newsletter']) && $_SESSION['plugin_newsletter'] == 'true') {
$aPlugins[] = i18n_setup('Newsletter');
}
if ($_SESSION['plugin_content_allocation'] == 'true') {
if (isset($_SESSION['plugin_content_allocation']) && $_SESSION['plugin_content_allocation'] == 'true') {
$aPlugins[] = i18n_setup('Content Allocation');
}
if ($_SESSION['plugin_mod_rewrite'] == 'true') {
if (isset($_SESSION['plugin_mod_rewrite']) && $_SESSION['plugin_mod_rewrite'] == 'true') {
$aPlugins[] = i18n_setup('Mod Rewrite');
}
return $aPlugins;