Increase develop-branch to PHP8 #47

Zusammengeführt
Oldperl hat 110 Commits von dev_php82 nach develop 2023-10-16 16:09:02 +00:00 zusammengeführt
14 geänderte Dateien mit 198 neuen und 170 gelöschten Zeilen
Nur Änderungen aus Commit 7ca3bf10bb werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -130,7 +130,7 @@ class cI18n {
// Is emulator to use?
if (!$cfg['native_i18n']) {
return htmlentities(self::emulateGettext($string, $domain));
return self::emulateGettext($string, $domain);
}
// Try to use native gettext implementation

Datei anzeigen

@ -320,9 +320,13 @@ class cPage extends cHTML {
}
$meta = '';
if ($this->_encoding != "" && !$this->_isHtml5) {
if(!empty($this->_encoding)) {
if($this->_isHtml5) {
$meta .= '<meta charset="' . $this->_encoding . '">' . "\n";
} else {
$meta .= '<meta http-equiv="Content-type" content="text/html;charset=' . $this->_encoding . '">' . "\n";
}
}
if ($this->_object !== false && method_exists($this->_object, "render")) {
$this->_content = $this->_object->render();

0
conlite/external/endroid/qr-code/composer.json gevendort Ausführbare Datei → Normale Datei
Datei anzeigen

0
conlite/external/endroid/qr-code/src/QrCode.php gevendort Ausführbare Datei → Normale Datei
Datei anzeigen

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -30,7 +31,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -73,8 +73,7 @@ if (!defined('CON_FRAMEWORK')) {
* @param string $bReturnPath Flag to return the path instead of including the file
* @return void
*/
function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = false)
{
function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = false) {
global $client, $cfg, $cfgClient;
// Sanity check for $sWhat
@ -196,7 +195,6 @@ function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = fals
}
}
/**
* Shortcut to contenido_include.
*
@ -207,8 +205,7 @@ function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = fals
* @param bool $bForce If true, force the file to be included
* @return void
*/
function cInclude($sWhere, $sWhat, $bForce = false)
{
function cInclude($sWhere, $sWhat, $bForce = false) {
contenido_include($sWhere, $sWhat, $bForce);
}
@ -239,6 +236,3 @@ function plugin_include($sWhere, $sWhat) {
trigger_error("Function " . __METHOD__ . ": Can't include $sInclude in " . $sCaller, E_USER_WARNING);
}
}
?>

Datei anzeigen

@ -2221,4 +2221,66 @@ function IP_match($network, $mask, $ip) {
}
}
?>
/**
* Wrapper for php-function htmlspecialchars
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @since 2.3.0
* @uses htmlspecialchars php-function
*
* @param string $value
* @param int $flags
* @param string $encoding default UTF-8
* @return string Returns the converted string
*/
function clHtmlSpecialChars(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') {
return htmlspecialchars($value, $flags, $encoding);
}
/**
* Wrapper for php-function html_entity_decode
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @since 2.3.0
* @uses html_entity_decode php-function
*
* @param string $value
* @param int $flags
* @param string $encoding default UTF-8
* @return string Returns the decoded string
*/
function clHtmlEntityDecode(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') {
return html_entity_decode($value, $flags, $encoding);
}
/**
* Wrapper for php-function htmlentities
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @since 2.3.0
* @uses htmlentities php-function
*
* @param string $value
* @param int $flags
* @param string $encoding default UTF-8
* @return string Returns the converted string
*/
function clHtmlEntities(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') {
return htmlentities($value, $flags, $encoding);
}
/**
* Wrapper for php-function get_html_translation_table
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @since 2.3.0
* @uses get_html_translation_table php-function
*
* @param int $table
* @param int $flags
* @param string $encoding
* @return array
*/
function clGetHtmlTranslationTable(int $table = HTML_SPECIALCHARS, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = null) {
return get_html_translation_table($table, $flags, $encoding);
}

Datei anzeigen

@ -60,10 +60,11 @@ function clPhp54FixedFunc($funcname, $value, $flags = '', $encoding = '') {
* @param string $encoding
* @return string
*/
/*
function clHtmlSpecialChars($value, $flags = '', $encoding = '') {
return clPhp54FixedFunc("htmlspecialchars", $value, $flags, $encoding);
}
*/
/**
*
* @uses clPhp54FixedFunc multi fix func for PHP5.4
@ -74,9 +75,12 @@ function clHtmlSpecialChars($value, $flags = '', $encoding = '') {
* @param string $encoding
* @return string
*/
/*
function clHtmlEntityDecode($value, $flags = '', $encoding = '') {
return clPhp54FixedFunc("html_entity_decode", $value, $flags, $encoding);
}
*
*/
/**
*
@ -88,9 +92,12 @@ function clHtmlEntityDecode($value, $flags = '', $encoding = '') {
* @param string $encoding
* @return string
*/
/*
function clHtmlEntities($value, $flags = '', $encoding = '') {
return clPhp54FixedFunc("htmlentities", $value, $flags, $encoding);
}
*
*/
/**
*
@ -101,9 +108,12 @@ function clHtmlEntities($value, $flags = '', $encoding = '') {
* @param mixed $flags
* @return string
*/
/*
function clGetHtmlTranslationTable($table = '', $flags = '') {
return clPhp54FixedFunc("get_html_translation_table", $table, $flags);
}
*
*/
// hold old functions from con 4.8 but use new ConLite functions, mark them as deprecated
@ -112,38 +122,11 @@ function clGetHtmlTranslationTable($table = '', $flags = '') {
* Use compatible clHtmlSpecialChars instead
* @deprecated since version 2.0
*/
/**
if (function_exists('conHtmlSpecialChars') == false) {
function conHtmlSpecialChars($value, $flags = '', $encoding = '') {
return clHtmlSpecialChars($value, $flags, $encoding);
}
}
/**
* Use compatible clHtmlEntityDecode instead
* @deprecated since version 2.0
*
*/
if (function_exists('conHtmlEntityDecode') == false) {
function conHtmlEntityDecode($value, $flags = '', $encoding = '') {
return clHtmlEntityDecode($value, $flags, $encoding);
}
}
/**
* Use compatible clHtmlEntities instead
* @deprecated since version 2.0
*/
if (function_exists('conHtmlentities') == false) {
function conHtmlentities($value, $flags = '', $encoding = '') {
return clHtmlEntities($value, $flags, $encoding);
}
}
/**
* Use compatible clGetHtmlTranslationTable instead
* @deprecated since version 2.0
*/
if (function_exists('conGetHtmlTranslationTable') == false) {
function conGetHtmlTranslationTable($table = '', $flags = '') {
return clGetHtmlTranslationTable($table, $flags);
}
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,7 +29,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -41,13 +41,11 @@ $langstring = $langobj->get("name") . ' ('.$lang.')';
$moduletranslations = new cApiModuleTranslationCollection;
$module = new cApiModule($idmod);
if ($action == "mod_translation_save")
{
if ($action == "mod_translation_save") {
$strans = new cApiModuleTranslation;
$strans->loadByPrimaryKey($idmodtranslation);
if ($strans->get("idmod") == $idmod)
{
if ($strans->get("idmod") == $idmod) {
$module->setTranslatedName($translatedname);
$strans->set("translation", stripslashes($t_trans));
@ -56,14 +54,11 @@ if ($action == "mod_translation_save")
/* Increase idmodtranslation */
$moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'");
while ($mitem = $moduletranslations->next())
{
if ($mitem->get("idmodtranslation") == $idmodtranslation)
{
while ($mitem = $moduletranslations->next()) {
if ($mitem->get("idmodtranslation") == $idmodtranslation) {
$mitem2 = $moduletranslations->next();
if (is_object($mitem2))
{
if (is_object($mitem2)) {
$idmodtranslation = $mitem2->get("idmodtranslation");
break;
}
@ -72,42 +67,34 @@ if ($action == "mod_translation_save")
}
}
if ($action == "mod_importexport_translation")
{
if ($mode == "export")
{
if ($action == "mod_importexport_translation") {
if ($mode == "export") {
$sFileName = uplCreateFriendlyName(strtolower($module->get("name") . "_" . $langobj->get("name")));
if ($sFileName != "")
{
if ($sFileName != "") {
$moduletranslations->export($idmod, $lang, $sFileName . ".xml");
}
}
if ($mode == "import")
{
if (file_exists($_FILES["upload"]["tmp_name"]))
{
if ($mode == "import") {
if (file_exists($_FILES["upload"]["tmp_name"])) {
$moduletranslations->import($idmod, $lang, $_FILES["upload"]["tmp_name"]);
}
}
}
if (!isset($idmodtranslation))
{
if (!isset($idmodtranslation)) {
$idmodtranslation = 0;
}
$mtrans = new cApiModuleTranslation;
$mtrans->loadByPrimaryKey($idmodtranslation);
if ($mtrans->get("idmod") != $idmod)
{
if ($mtrans->get("idmod") != $idmod) {
$moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'", '', 'idmodtranslation DESC', '1');
$mtrans = $moduletranslations->next();
if (is_object($mtrans))
{
if (is_object($mtrans)) {
$idmodtranslation = $mtrans->get("idmodtranslation");
} else {
$mtrans = new cApiModuleTranslation;
@ -117,22 +104,21 @@ if ($mtrans->get("idmod") != $idmod)
$strings = $module->parseModuleForStrings();
/* Insert new strings */
foreach ($strings as $string)
{
foreach ($strings as $string) {
$moduletranslations->create($idmod, $lang, $string);
}
$moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'");
while ($d_modtrans = $moduletranslations->next())
{
if (!in_array($d_modtrans->get("original"), $strings))
{
while ($d_modtrans = $moduletranslations->next()) {
if (!in_array($d_modtrans->get("original"), $strings)) {
$moduletranslations->delete($d_modtrans->get("idmodtranslation"));
}
}
$page = new cPage;
$page->setHtml5();
$page->setEncoding('UTF-8');
$form = new UI_Table_Form("translation");
$form->addHeader(sprintf(i18n("Translate module '%s'"), $module->get("name")));
@ -158,7 +144,7 @@ $table = '<table border="0" width="600" border="0"><tr><td width="50%">'.i18n("O
$original = new cHTMLTextarea("t_orig", clHtmlSpecialChars($mtrans->get("original")));
$original->setStyle("width: 300px;");
$translated = new cHTMLTextarea("t_trans",clHtmlSpecialChars($mtrans->get("translation")));
$translated = new cHTMLTextarea("t_trans", $mtrans->get("translation"));
$translated->setStyle("width: 300px;");
$table .= '<tr><td>' . $original->render() . '</td><td>' . $translated->render() . '</td><td width="20">&nbsp;</td></tr></table>';
@ -167,7 +153,6 @@ $form->add(i18n("String list"), $table);
$mark = '<script language="JavaScript">document.translation.t_trans.focus();</script>';
$import = new cHTMLRadiobutton("mode", "import");
$export = new cHTMLRadiobutton("mode", "export");
$export->setLabelText(i18n("Export to file"));
@ -196,8 +181,7 @@ $clang = new cApiLanguage($lang);
$page->setEncoding($clang->get("encoding"));
if (!($action == "mod_importexport_translation" && $mode == "export"))
{
if (!($action == "mod_importexport_translation" && $mode == "export")) {
$page->render();
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,7 +28,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -37,6 +37,8 @@ $translations = new cApiModuleTranslationCollection;
$translations->select("idmod = '$idmod' AND idlang='$lang'");
$page = new cPage;
$page->setHtml5();
$page->setEncoding('UTF-8');
$page->setMargin(0);
$v = '<table cellspacing="0" cellpadding="0" width="600">';
@ -46,10 +48,10 @@ $link->setCLink("mod_translate", 4, "");
$mylink = new cHTMLLink;
while ($translation = $translations->next())
{
$string = $translation->get("original");
$tstring = $translation->get("translation");
while ($translation = $translations->next()) {
$string = utf8_encode($translation->get("original"));
$tstring = utf8_encode($translation->get("translation"));
$link->setCustom("idmod", $idmod);
$link->setCustom("idmodtranslation", $translation->get("idmodtranslation"));
@ -60,18 +62,21 @@ while ($translation = $translations->next())
$dark = !$dark;
if ($dark)
{
if ($dark) {
$bgcol = $cfg["color"]["table_dark"];
} else {
$bgcol = $cfg["color"]["table_light"];
}
if ($idmodtranslation == $translation->get("idmodtranslation"))
{
if ($idmodtranslation == $translation->get("idmodtranslation")) {
$bgcol = $cfg["color"]["table_active"];
}
$v .= '<tr bgcolor="'.$bgcol.'"><td style="padding-left: 2px; padding-top:2px; padding-bottom: 2px;" width="50%"><a name="'.$translation->get("idmodtranslation").'"></a>'.$mylink->render().'</td><td style="padding-left: 2px;">'.$tstring.'</td></tr>';
$v .= '<tr bgcolor="' . $bgcol . '">'."\n"
. '<td style="padding-left: 2px; padding-top:2px; padding-bottom: 2px;" width="50%">'."\n"
. '<a name="' . $translation->get("idmodtranslation") . '"></a>'."\n"
. $mylink->render() . '</td>'."\n"
. '<td style="padding-left: 2px;">' . $tstring . '</td>'."\n"
. '</tr>'."\n";
}
$v .= '</table>';
@ -82,5 +87,4 @@ $clang = new cApiLanguage($lang);
$page->setEncoding($clang->get("encoding"));
$page->render();
?>

Datei anzeigen

@ -50,8 +50,8 @@ $formaction = $sess->url("main.php");
#<input type="hidden" name="action" value="tplcfg_edit">
$hidden = '<input type="hidden" name="area" value="tpl_cfg">
<input type="hidden" name="frame" value="'.$frame.'">
<input type="hidden" name="idcat" value="'.$idcat.'">
<input type="hidden" name="idart" value="'.$idart.'">
<input type="hidden" name="idcat" value="'.cRegistry::getCategoryId().'">
<input type="hidden" name="idart" value="'.cRegistry::getArticleId().'">
<input type="hidden" name="idtpl" value="'.$idtpl.'">
<input type="hidden" name="lang" value="'.$lang.'">
<input type="hidden" name="idtplcfg" value="'.$idtplcfg.'">
@ -154,7 +154,5 @@ $buttons = '<a href="javascript:history.back()"><img src="images/but_cancel.gif"
<input type="image" src="images/but_ok.gif">';
$tpl->set('s', 'BUTTONS', $buttons);
# Generate template
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['tplcfg_edit_form']);
?>

Datei anzeigen

@ -71,7 +71,7 @@ if (!defined('CL_ENVIRONMENT')) {
*/
if (!defined('CL_VERSION')) {
define('CL_VERSION', '2.2.0 beta');
define('CL_VERSION', '2.3.0 RC');
}

@ -1 +1 @@
Subproject commit 91b0fd8c15cdf1b5e9704c8720a40f959e7eb4fe
Subproject commit 4c3d78a0443921bdc3adcaf89c151d94e8f4a876

Datei anzeigen

@ -1,7 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title></title>
{META}
<link rel="stylesheet" type="text/css" href="styles/contenido.css">