diff --git a/.gitignore b/.gitignore index 50ed16c..9ddeb8a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ /cms/js/firstlevel/ /conlite/external/**/.git /dievino/ +/conlite/logs/debug.log +/cms/data/config/production/config.mod_rewrite.php +/cms/data/config/production/config.local.php diff --git a/cms/front_content.php b/cms/front_content.php index 9e847bd..d9686b8 100644 --- a/cms/front_content.php +++ b/cms/front_content.php @@ -93,7 +93,7 @@ if ($cfg["use_pseudocron"] == true) { * PHPLIB application development toolkit * @see http://sourceforge.net/projects/phplib */ -if ($contenido) { +if (!empty($contenido)) { //Backend page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang); @@ -123,12 +123,12 @@ $sess->register("errsite_idcat"); $sess->register("errsite_idart"); $sess->register("encoding"); -if ($cfgClient["set"] != "set") { +if (empty($cfgClient["set"]) || $cfgClient["set"] != "set") { rereadClients(); } # Check if this request is for a compressed file -if ($_GET['action'] == 'get_compressed') { +if (isset($_GET['action']) && $_GET['action'] == 'get_compressed') { # Get the calling parameters $sFilename = ((isset($_GET['f'])) ? $_GET['f'] : $_GET['amp;f']); $sContentType = ((isset($_GET['c'])) ? $_GET['c'] : $_GET['amp;c']); @@ -264,9 +264,9 @@ if ($idart && !$idcat && !$idcatart) { unset($code); unset($markscript); -if (!$idcatart) { - if (!$idart) { - if (!$idcat) { +if (empty($idcatart)) { + if (empty($idart)) { + if (empty($idcat)) { # Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored # in relation con_cat_art. if ($cfg["is_start_compatible"] == true) { @@ -313,7 +313,7 @@ if (!$idcatart) { $idart = $db->f("idart"); $idcat = $db->f("idcat"); } else { - if ($contenido) { + if (!empty($contenido)) { cInclude("includes", "functions.i18n.php"); die(i18n("No start article for this category")); } else { @@ -525,7 +525,7 @@ if ($contenido) { /* If mode is 'edit' and user has permission to edit articles in the current category */ -if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) { +if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) { cInclude("includes", "functions.tpl.php"); cInclude("includes", "functions.con.php"); include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php"); @@ -606,10 +606,12 @@ if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_ar } /* Add mark Script to code if user is in the backend */ - $code = preg_replace("/<\/head>/i", "$markscript\n", $code, 1); + if(!empty($markscript)) { + $code = preg_replace("/<\/head>/i", "$markscript\n", $code, 1); + } /* If article is in use, display notification */ - if ($sHtmlInUseCss && $sHtmlInUseMessage) { + if (!empty($sHtmlInUseCss) && !empty($sHtmlInUseMessage)) { $code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n", $code, 1); $code = preg_replace("/(
]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1); } diff --git a/conlite/classes/cHTML5/class.chtml5.common.php b/conlite/classes/cHTML5/class.chtml5.common.php index 6a58c10..f741852 100644 --- a/conlite/classes/cHTML5/class.chtml5.common.php +++ b/conlite/classes/cHTML5/class.chtml5.common.php @@ -525,7 +525,8 @@ abstract class cHTML5Common implements ArrayAccess * @return boolean Returns true on success or false on failure. * @link http://php.net/manual/en/arrayaccess.offsetexists.php */ - public function offsetExists(mixed $offset): bool + #[\ReturnTypeWillChange] + public function offsetExists($offset) { return isset($this->attributes[strtolower($offset)]); } diff --git a/conlite/classes/class.article.php b/conlite/classes/class.article.php index bee4669..b4fc1cc 100644 --- a/conlite/classes/class.article.php +++ b/conlite/classes/class.article.php @@ -283,7 +283,7 @@ class Article extends Item */ public function getContent($type, $id = NULL) { - if ($type == '') { + if (empty($type)) { return 'Class ' . get_class($this) . ': content-type must be specified!'; } @@ -295,7 +295,7 @@ class Article extends Item if (is_null($id)) { // return Array - return $this->content[$type]; + return (empty($this->content[$type]))?'':$this->content[$type]; } // return String diff --git a/conlite/classes/class.ui.php b/conlite/classes/class.ui.php index 0125de3..4139941 100644 --- a/conlite/classes/class.ui.php +++ b/conlite/classes/class.ui.php @@ -174,10 +174,10 @@ class UI_Menu { foreach ($this->link as $key => $value) { if ($value != NULL) { - if ($this->imagewidth[$key] != 0) { + if (!empty($this->imagewidth[$key]) && !empty ($this->image[$key])) { $value->setContent(''); $img = $value->render(); - } else { + } else if(!empty ($this->image[$key])) { $value->setContent(''); $img = $value->render(); } @@ -186,14 +186,12 @@ class UI_Menu { } else { $link = $this->title[$key]; - if ($this->image[$key] != "") { + if (!empty($this->image[$key])) { if ($this->imagewidth[$key] != 0) { $img = ''; } else { $img = ''; } - } else { - $img = " "; } } @@ -212,21 +210,24 @@ class UI_Menu { $bgColor = $cfg["color"]["table_light_active"]; } - if ($this->extra[$key] == 'id="marked" ') { + if (!empty($this->extra[$key]) && $this->extra[$key] == 'id="marked" ') { $bgColor = $cfg["color"]["table_light_active"]; } } $tpl->set('d', 'NAME', $link); - if ($this->image[$key] == "") { + if (empty($this->image[$key])) { $tpl->set('d', 'ICON', ''); } else { $tpl->set('d', 'ICON', $img); } - if ($this->extra[$key] != "" || $this->rowmark == true) { + if (!empty($this->extra[$key]) || $this->rowmark == true) { $extraadd = ""; + if(empty($this->extra[$key])) { + $this->extra[$key] = ''; + } if ($this->rowmark == true) { $extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"'; @@ -439,7 +440,7 @@ class UI_Table_Form { if (is_array($this->items)) { foreach ($this->items as $key => $value) { - if ($this->itemType[$key] == 'subheader') { + if (isset($this->itemType[$key]) && $this->itemType[$key] == 'subheader') { $subheader = '