fix php 8.0 errors in backend
Dieser Commit ist enthalten in:
Ursprung
b3f4d9ee27
Commit
586188c2cc
|
@ -133,6 +133,8 @@ function dbUpgradeTable($db, $table, $field, $type, $null, $key, $default, $extr
|
||||||
} else {
|
} else {
|
||||||
$parameter['DEFAULT'] = "DEFAULT '" . Contenido_Security::escapeDB($default, $db) . "'";
|
$parameter['DEFAULT'] = "DEFAULT '" . Contenido_Security::escapeDB($default, $db) . "'";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$parameter['DEFAULT'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dbTableExists($db, $table)) {
|
if (!dbTableExists($db, $table)) {
|
||||||
|
@ -145,7 +147,7 @@ function dbUpgradeTable($db, $table, $field, $type, $null, $key, $default, $extr
|
||||||
// Remove auto_increment
|
// Remove auto_increment
|
||||||
$structure = dbGetColumns($db, $table);
|
$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'] == "") {
|
if ($structure[$field]['NULL'] == "") {
|
||||||
$structure[$field]['NULL'] = "NOT NULL";
|
$structure[$field]['NULL'] = "NOT NULL";
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,6 +396,7 @@ function getLanguagesByClient($client) {
|
||||||
function getLanguageNamesByClient($client) {
|
function getLanguageNamesByClient($client) {
|
||||||
global $db;
|
global $db;
|
||||||
global $cfg;
|
global $cfg;
|
||||||
|
$list = [];
|
||||||
|
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
a.idlang AS idlang,
|
a.idlang AS idlang,
|
||||||
|
@ -1238,7 +1239,7 @@ function buildCategorySelect($sName, $sValue, $sLevel = 0, $sStyle = "") {
|
||||||
foreach ($categories as $tmpidcat => $props) {
|
foreach ($categories as $tmpidcat => $props) {
|
||||||
$spaces = " ";
|
$spaces = " ";
|
||||||
|
|
||||||
for ($i = 0; $i < $props["level"]; $i ++) {
|
for ($i = 0; $i < $props["level"]; $i++) {
|
||||||
$spaces .= " ";
|
$spaces .= " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1282,7 +1283,7 @@ function human_readable_size($number) {
|
||||||
$n = (float) $number; //Appears to be necessary to avoid rounding
|
$n = (float) $number; //Appears to be necessary to avoid rounding
|
||||||
while ($n >= $base) {
|
while ($n >= $base) {
|
||||||
$n /= (float) $base;
|
$n /= (float) $base;
|
||||||
$usesuf ++;
|
$usesuf++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$places = 2 - floor(log10($n));
|
$places = 2 - floor(log10($n));
|
||||||
|
@ -1315,7 +1316,7 @@ function array_csort() { //coded by Ichier2003
|
||||||
$msortline = "return(array_multisort(";
|
$msortline = "return(array_multisort(";
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($args as $arg) {
|
foreach ($args as $arg) {
|
||||||
$i ++;
|
$i++;
|
||||||
if (is_string($arg)) {
|
if (is_string($arg)) {
|
||||||
foreach ($marray as $row) {
|
foreach ($marray as $row) {
|
||||||
$a = strtoupper($row[$arg]);
|
$a = strtoupper($row[$arg]);
|
||||||
|
@ -1327,7 +1328,9 @@ function array_csort() { //coded by Ichier2003
|
||||||
$msortline .= "\$sortarr[" . $i . "],";
|
$msortline .= "\$sortarr[" . $i . "],";
|
||||||
}
|
}
|
||||||
$msortline .= "\$marray));";
|
$msortline .= "\$marray));";
|
||||||
@ eval($msortline);
|
if(is_array($marray) && count($marray) > 0) {
|
||||||
|
@ eval($msortline);
|
||||||
|
}
|
||||||
return $marray;
|
return $marray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1689,7 +1692,7 @@ function createRandomName($nameLength) {
|
||||||
$Vouel = 'aeiou';
|
$Vouel = 'aeiou';
|
||||||
$Name = "";
|
$Name = "";
|
||||||
|
|
||||||
for ($index = 1; $index <= $nameLength; $index ++) {
|
for ($index = 1; $index <= $nameLength; $index++) {
|
||||||
if ($index % 3 == 0) {
|
if ($index % 3 == 0) {
|
||||||
$randomNumber = rand(1, strlen($Vouel));
|
$randomNumber = rand(1, strlen($Vouel));
|
||||||
$Name .= substr($Vouel, $randomNumber - 1, 1);
|
$Name .= substr($Vouel, $randomNumber - 1, 1);
|
||||||
|
|
|
@ -754,7 +754,7 @@ if (isset($bDebug) && $bDebug === true) {
|
||||||
var_dump($navigationTree);
|
var_dump($navigationTree);
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
}
|
}
|
||||||
if (count($navigationTree[0])) {
|
if (is_array($navigationTree[0]) && count($navigationTree[0])) {
|
||||||
$sCategories = showTree(0, $aWholelist);
|
$sCategories = showTree(0, $aWholelist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,9 @@ $currentstep = (empty($_GET['step'])) ? 1 : filter_input(INPUT_GET, "step", FILT
|
||||||
// Count DB Chunks
|
// Count DB Chunks
|
||||||
$file = fopen('data/tables.txt', 'r');
|
$file = fopen('data/tables.txt', 'r');
|
||||||
$step = 1;
|
$step = 1;
|
||||||
|
$count = 1;
|
||||||
|
$fullcount = 1;
|
||||||
|
|
||||||
while (($data = fgetcsv($file, 4000, ';')) !== false) {
|
while (($data = fgetcsv($file, 4000, ';')) !== false) {
|
||||||
if ($count == 50) {
|
if ($count == 50) {
|
||||||
$count = 1;
|
$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);
|
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;
|
$_SESSION['install_failedupgradetable'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ function remove_remarks($sql) {
|
||||||
|
|
||||||
for ($i = 0; $i < $linecount; $i++) {
|
for ($i = 0; $i < $linecount; $i++) {
|
||||||
if (($i != ($linecount - 1)) || (strlen($lines[$i]) > 0)) {
|
if (($i != ($linecount - 1)) || (strlen($lines[$i]) > 0)) {
|
||||||
if ($lines[$i][0] != "#") {
|
if (!empty($lines[$i][0]) && $lines[$i][0] != "#") {
|
||||||
$output .= $lines[$i] . "\n";
|
$output .= $lines[$i] . "\n";
|
||||||
} else {
|
} else {
|
||||||
$output .= "\n";
|
$output .= "\n";
|
||||||
|
|
|
@ -97,13 +97,13 @@ class cSetupSetupSummary extends cSetupMask {
|
||||||
|
|
||||||
public function _getSelectedAdditionalPlugins() {
|
public function _getSelectedAdditionalPlugins() {
|
||||||
$aPlugins = array();
|
$aPlugins = array();
|
||||||
if ($_SESSION['plugin_newsletter'] == 'true') {
|
if (isset($_SESSION['plugin_newsletter']) && $_SESSION['plugin_newsletter'] == 'true') {
|
||||||
$aPlugins[] = i18n_setup('Newsletter');
|
$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');
|
$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');
|
$aPlugins[] = i18n_setup('Mod Rewrite');
|
||||||
}
|
}
|
||||||
return $aPlugins;
|
return $aPlugins;
|
||||||
|
|
Laden…
In neuem Issue referenzieren