Merge latest PHP8 changes to develop #31

Zusammengeführt
Oldperl hat 27 Commits von dev_php8 nach develop 2022-05-23 17:18:44 +00:00 zusammengeführt
10 geänderte Dateien mit 857 neuen und 1021 gelöschten Zeilen
Nur Änderungen aus Commit 1c01dca90a werden angezeigt - Alle Commits anzeigen

Datei anzeigen

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

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
Simple Responsive Template v 1.2 Simple Responsive Template v 1.2 test
primary styles primary styles

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) {
@ -855,4 +846,3 @@ if (isset($savedlang)) {
$db->disconnect(); $db->disconnect();
page_close(); page_close();
?>

Datei anzeigen

@ -1,4 +1,4 @@
<!-- 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:

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,32 +30,28 @@
* }} * }}
* *
*/ */
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 = new UI_Table_Form("rights");
$rights->setVar("area", $area); $rights->setVar("area", $area);
$rights->setVar("frame", $frame); $rights->setVar("frame", $frame);
@ -65,65 +62,52 @@ if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
$actions = $class->listActions(); $actions = $class->listActions();
$items = $class->listItems(); $items = $class->listItems();
if ($action == "fegroups_save_perm") if ($action == "fegroups_save_perm") {
{
$myitems = $items; $myitems = $items;
$myitems["__GLOBAL__"] = "__GLOBAL__"; $myitems["__GLOBAL__"] = "__GLOBAL__";
foreach ($actions as $action => $text) foreach ($actions as $action => $text) {
{ foreach ($myitems as $item => $text) {
foreach ($myitems as $item => $text)
{
if ($item === "__GLOBAL__") if ($item === "__GLOBAL__") {
{
$varname = "action_$action"; $varname = "action_$action";
} else { } else {
$varname = "item_".$item."_$action"; $varname = "item_" . $item . "_$action";
} }
if ($_POST[$varname] == 1) if ($_POST[$varname] == 1) {
{
$perms->setPerm($idfrontendgroup, $useplugin, $action, $item); $perms->setPerm($idfrontendgroup, $useplugin, $action, $item);
} else { } else {
$perms->removePerm($idfrontendgroup, $useplugin, $action, $item); $perms->removePerm($idfrontendgroup, $useplugin, $action, $item);
} }
} }
} }
} }
$rights->addHeader(sprintf(i18n("Permissions for plugin '%s'"), $class->getFriendlyName())); $rights->addHeader(sprintf(i18n("Permissions for plugin '%s'"), $class->getFriendlyName()));
foreach ($actions as $key => $action) foreach ($actions as $key => $action) {
{
$check[$key] = new cHTMLCheckbox("action_$key", 1); $check[$key] = new cHTMLCheckbox("action_$key", 1);
$check[$key]->setLabelText($action." ".i18n("(All)")); $check[$key]->setLabelText($action . " " . i18n("(All)"));
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__")) if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__")) {
{
$check[$key]->setChecked(true); $check[$key]->setChecked(true);
} }
} }
$rights->add(i18n("Global rights"), $check); $rights->add(i18n("Global rights"), $check);
foreach ($actions as $key => $action) foreach ($actions as $key => $action) {
{
unset($check); unset($check);
if (count($items) > 0) if (is_array($items) && count($items) > 0) {
{ foreach ($items as $item => $value) {
foreach ($items as $item => $value) $check[$item] = new cHTMLCheckbox("item_" . $item . "_" . $key, 1);
{
$check[$item] = new cHTMLCheckbox("item_".$item."_".$key, 1);
$check[$item]->setLabelText($value); $check[$item]->setLabelText($value);
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item)) if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item)) {
{
$check[$item]->setChecked(true); $check[$item]->setChecked(true);
} }
} }
$rights->add($action, $check); $rights->add($action, $check);
@ -136,4 +120,3 @@ if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
} }
$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, ";"));