handle empty or nulled content

Dieser Commit ist enthalten in:
o.pinke 2023-03-03 09:02:11 +01:00
Ursprung 606f48500f
Commit fc6ea7746d
1 geänderte Dateien mit 45 neuen und 49 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -53,25 +54,22 @@ if ($a_content[$type][$typenr]) {
// if not set it is possible to use available content from var $editor_content // if not set it is possible to use available content from var $editor_content
} }
$editor_content = clHtmlSpecialChars($editor_content); $editor_content = is_null($editor_content) ? '' : clHtmlSpecialChars($editor_content);
$cTinyMCEEditor = new cTinyMCEEditor($editor_name, $editor_content); $cTinyMCEEditor = new cTinyMCEEditor($editor_name, $editor_content);
switch ($type) switch ($type) {
{
case "CMS_HTML": case "CMS_HTML":
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-html", false); $editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-html", false);
if ($editor_height == false) if ($editor_height == false) {
{
$editor_height = getEffectiveSetting("tinymce", "contenido_height_html", false); $editor_height = getEffectiveSetting("tinymce", "contenido_height_html", false);
} }
break; break;
case "CMS_HTMLHEAD": case "CMS_HTMLHEAD":
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-head", false); $editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-head", false);
if ($editor_height == false) if ($editor_height == false) {
{
$editor_height = getEffectiveSetting("tinymce", "contenido_height_head", false); $editor_height = getEffectiveSetting("tinymce", "contenido_height_head", false);
} }
break; break;
@ -79,8 +77,7 @@ switch ($type)
$editor_height = false; $editor_height = false;
} }
if ($editor_height !== false) if ($editor_height !== false) {
{
$cTinyMCEEditor->setSetting("height", $editor_height, true); $cTinyMCEEditor->setSetting("height", $editor_height, true);
} }
@ -95,8 +92,7 @@ TODO:
$currentuser = new User; $currentuser = new User;
$currentuser->loadUserByUserID($auth->auth["uid"]); $currentuser->loadUserByUserID($auth->auth["uid"]);
if ($currentuser->getField("wysi") == 1) if ($currentuser->getField("wysi") == 1) {
{
echo $cTinyMCEEditor->getScripts(); echo $cTinyMCEEditor->getScripts();
echo $cTinyMCEEditor->getEditor(); echo $cTinyMCEEditor->getEditor();
} else { } else {