fixes while checking backend on php 7.4

Dieser Commit ist enthalten in:
o.pinke 2022-05-17 15:57:15 +02:00
Ursprung 59cb72faef
Commit 1c01dca90a
10 geänderte Dateien mit 857 neuen und 1021 gelöschten Zeilen

Datei anzeigen

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -102,21 +102,12 @@ if (!empty($contenido)) {
page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
} }
/**
* Bugfix
* @see http://contenido.org/forum/viewtopic.php?t=18291
*
* added by H. Librenz (2007-12-07)
*/
//includePluginConf();
/**
* fixed bugfix - using functions brokes variable scopes!
*
* added by H. Librenz (2007-12-21) based on an idea of A. Lindner
*/
require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php'; require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php';
$db = new DB_Contenido; // Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
$db = new DB_ConLite();
$sess->register("cfgClient"); $sess->register("cfgClient");
$sess->register("errsite_idcat"); $sess->register("errsite_idcat");
@ -654,7 +645,7 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p
WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "' WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "'
AND A.idarea = C.idarea AND B.idaction = A.idaction"; AND A.idarea = C.idarea AND B.idaction = A.idaction";
$db2 = new DB_Contenido; $db2 = new DB_ConLite();
$db2->query($sql); $db2->query($sql);
if ($db2->num_rows() > 0) { if ($db2->num_rows() > 0) {
@ -854,5 +845,4 @@ if (isset($savedlang)) {
} }
$db->disconnect(); $db->disconnect();
page_close(); page_close();
?>

Datei anzeigen

@ -1,18 +1,18 @@
<!-- developer design for file list --> <!-- developer design for file list test -->
<h3>{TITLE}</h3> <h3>{TITLE}</h3>
<!-- <!--
Possible place holders for entries: Possible place holders for entries:
FILELINK, FILENAME, FILEEXTENSION, FILESIZE, FILESIZE_UNIT, FILELINK, FILENAME, FILEEXTENSION, FILESIZE, FILESIZE_UNIT,
FILECREATIONDATE, FILEMODIFYDATE, FILEDIRCTORY, FILECREATIONDATE, FILEMODIFYDATE, FILEDIRCTORY,
FILEMETA_DESCRIPTION, FILEMETA_KEYWORDS, FILEMETA_MEDIANAME, FILEMETA_DESCRIPTION, FILEMETA_KEYWORDS, FILEMETA_MEDIANAME,
FILEMETA_INTERNAL_NOTICE, FILEMETA_COPYRIGHT FILEMETA_INTERNAL_NOTICE, FILEMETA_COPYRIGHT
--> -->
<!-- BEGIN:BLOCK --> <!-- BEGIN:BLOCK -->
<div style="float: left;margin-bottom: 20px;width:47%;padding-right:5px"> <div style="float: left;margin-bottom: 20px;width:47%;padding-right:5px">
<b><a href="{FILELINK}">{FILENAME}</a></b> ({FILEEXTENSION})<br /> <b><a href="{FILELINK}">{FILENAME}</a></b> ({FILEEXTENSION})<br />
<span style="color: rgb(170, 170, 170);">{LABEL_FILESIZE}</span> {FILESIZE} {FILESIZE_UNIT}<br /> <span style="color: rgb(170, 170, 170);">{LABEL_FILESIZE}</span> {FILESIZE} {FILESIZE_UNIT}<br />
<span style="color: rgb(170, 170, 170);">{LABEL_UPLOAD_DATE}</span> {FILECREATIONDATE}<br /> <span style="color: rgb(170, 170, 170);">{LABEL_UPLOAD_DATE}</span> {FILECREATIONDATE}<br />
{FILEMETA_DESCRIPTION} {FILEMETA_DESCRIPTION}
</div> </div>
<!-- END:BLOCK --> <!-- END:BLOCK -->
<br style="clear:both" /> <br style="clear:both" />

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -210,7 +210,8 @@ function fileEdit($filename, $sCode, $path) {
if (is_writable($path . $filename)) { if (is_writable($path . $filename)) {
if (strlen(stripslashes(trim($sCode))) > 0) { if (strlen(stripslashes(trim($sCode))) > 0) {
if (!empty($sCode)) { if (!empty($sCode)) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING'); mb_detect_encoding($sCode);
$sCode = mb_convert_encoding($sCode, 'UTF-8',mb_detect_encoding($sCode));
} }
cFileHandler::write($path . $filename, $sCode); cFileHandler::write($path . $filename, $sCode);
return true; return true;
@ -235,7 +236,8 @@ function fileEdit($filename, $sCode, $path) {
function getFileContent($filename, $path) { function getFileContent($filename, $path) {
$sCode = cFileHandler::read($path . $filename); $sCode = cFileHandler::read($path . $filename);
if (!empty($sCode)) { if (!empty($sCode)) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING'); mb_detect_encoding($sCode);
$sCode = mb_convert_encoding($sCode, 'UTF-8', mb_detect_encoding($sCode));
} }
return $sCode; return $sCode;
} }

Datei anzeigen

@ -158,7 +158,7 @@ if ($fegroup->virgin == false && $fegroup->get("idclient") == $client)
$fegroup->store(); $fegroup->store();
} }
if (count($messages) > 0) if (is_array($messages) && count($messages) > 0)
{ {
$notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>"; $notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>";
} }

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -29,111 +30,93 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
// @TODO: check the code beneath is necessary // @TODO: check the code beneath is necessary
if ($_REQUEST['useplugin'] != "category") { if ($_REQUEST['useplugin'] != "category") {
die ('Illegal call!'); die('Illegal call!');
} }
$page = new cPage; $page = new cPage;
if (!in_array($useplugin, $cfg['plugins']['frontendlogic'])) if (!in_array($useplugin, $cfg['plugins']['frontendlogic'])) {
{ $page->setContent(i18n("Invalid plugin"));
$page->setContent(i18n("Invalid plugin"));
} else { } else {
cInclude("plugins", "frontendlogic/$useplugin/".$useplugin.".php"); cInclude("plugins", "frontendlogic/$useplugin/" . $useplugin . ".php");
$className = "frontendlogic_".$useplugin; $className = "frontendlogic_" . $useplugin;
$class = new $className; $class = new $className;
$perms = new FrontendPermissionCollection; $perms = new FrontendPermissionCollection;
$rights = new UI_Table_Form("rights");
$rights->setVar("area", $area);
$rights->setVar("frame", $frame);
$rights->setVar("useplugin", $useplugin);
$rights->setVar("idfrontendgroup", $idfrontendgroup);
$rights->setVar("action", "fegroups_save_perm");
$rights = new UI_Table_Form("rights"); $actions = $class->listActions();
$rights->setVar("area", $area); $items = $class->listItems();
$rights->setVar("frame", $frame);
$rights->setVar("useplugin", $useplugin);
$rights->setVar("idfrontendgroup", $idfrontendgroup);
$rights->setVar("action", "fegroups_save_perm");
$actions = $class->listActions(); if ($action == "fegroups_save_perm") {
$items = $class->listItems(); $myitems = $items;
$myitems["__GLOBAL__"] = "__GLOBAL__";
if ($action == "fegroups_save_perm") foreach ($actions as $action => $text) {
{ foreach ($myitems as $item => $text) {
$myitems = $items;
$myitems["__GLOBAL__"] = "__GLOBAL__";
foreach ($actions as $action => $text) if ($item === "__GLOBAL__") {
{ $varname = "action_$action";
foreach ($myitems as $item => $text) } else {
{ $varname = "item_" . $item . "_$action";
}
if ($item === "__GLOBAL__") if ($_POST[$varname] == 1) {
{ $perms->setPerm($idfrontendgroup, $useplugin, $action, $item);
$varname = "action_$action"; } else {
} else { $perms->removePerm($idfrontendgroup, $useplugin, $action, $item);
$varname = "item_".$item."_$action"; }
} }
}
if ($_POST[$varname] == 1)
{
$perms->setPerm($idfrontendgroup, $useplugin, $action, $item);
} else {
$perms->removePerm($idfrontendgroup, $useplugin, $action, $item);
}
}
}
}
$rights->addHeader(sprintf(i18n("Permissions for plugin '%s'"), $class->getFriendlyName()));
foreach ($actions as $key => $action)
{
$check[$key] = new cHTMLCheckbox("action_$key", 1);
$check[$key]->setLabelText($action." ".i18n("(All)"));
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__"))
{
$check[$key]->setChecked(true);
}
}
$rights->add(i18n("Global rights"), $check);
foreach ($actions as $key => $action)
{
unset($check);
if (count($items) > 0)
{
foreach ($items as $item => $value)
{
$check[$item] = new cHTMLCheckbox("item_".$item."_".$key, 1);
$check[$item]->setLabelText($value);
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item))
{
$check[$item]->setChecked(true);
}
}
$rights->add($action, $check);
} else {
$rights->add($action, i18n("No items found"));
}
} }
$page->setContent($rights->render()); $rights->addHeader(sprintf(i18n("Permissions for plugin '%s'"), $class->getFriendlyName()));
foreach ($actions as $key => $action) {
$check[$key] = new cHTMLCheckbox("action_$key", 1);
$check[$key]->setLabelText($action . " " . i18n("(All)"));
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__")) {
$check[$key]->setChecked(true);
}
}
$rights->add(i18n("Global rights"), $check);
foreach ($actions as $key => $action) {
unset($check);
if (is_array($items) && count($items) > 0) {
foreach ($items as $item => $value) {
$check[$item] = new cHTMLCheckbox("item_" . $item . "_" . $key, 1);
$check[$item]->setLabelText($value);
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item)) {
$check[$item]->setChecked(true);
}
}
$rights->add($action, $check);
} else {
$rights->add($action, i18n("No items found"));
}
}
$page->setContent($rights->render());
} }
$page->render(); $page->render();
?>

Datei anzeigen

@ -162,7 +162,7 @@ if ($oFeUser->virgin == false && $oFeUser->get("idclient") == $client) {
if($bStore) $oFeUser->store(); if($bStore) $oFeUser->store();
} }
if (count($messages) > 0) { if (is_array($messages) && count($messages) > 0) {
$notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>"; $notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>";
} }

Datei anzeigen

@ -107,7 +107,7 @@ if (!$layout->virgin) {
} }
$types = array_unique($types); $types = array_unique($types);
if (version_compare(PHP_VERSION, '8.0.0', '>=')) { if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
$layout->setProperty("layout", "used-types", implode(";", $types)); $layout->setProperty("layout", "used-types", implode(";", $types));
} else { } else {
$layout->setProperty("layout", "used-types", implode($types, ";")); $layout->setProperty("layout", "used-types", implode($types, ";"));