From 764991d2395e57d4296246d2a8415494a139235b Mon Sep 17 00:00:00 2001 From: Ortwin Pinke Date: Thu, 27 Jul 2023 19:04:46 +0200 Subject: [PATCH] fix not saving javascript in code --- conlite/includes/functions.lay.php | 18 ++++++------------ conlite/includes/include.lay_edit_form.php | 13 ++++--------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/conlite/includes/functions.lay.php b/conlite/includes/functions.lay.php index f40a871..94e38d3 100644 --- a/conlite/includes/functions.lay.php +++ b/conlite/includes/functions.lay.php @@ -49,21 +49,15 @@ cInclude ("includes", "functions.con.php"); */ function layEditLayout($idlay, $name, $description, $code) { - global $client, $auth, $cfg, $sess, $area_tree, $perm, $cfgClient; + global $client, $auth, $cfg, $cfgClient; - $db2= new DB_ConLite; - $db = new DB_ConLite; + $db = new DB_ConLite(); $date = date("Y-m-d H:i:s"); - $author = "".$auth->auth["uname"].""; - $description = (string) stripslashes($description); - - /** - set_magic_quotes_gpc($name); - set_magic_quotes_gpc($description); - set_magic_quotes_gpc($code); - **/ - //$code = addslashes($code); + $author = $auth->auth["uname"]; + $description = stripslashes($description); + + $code = addslashes($code); if (strlen(trim($name)) == 0) { $name = i18n('-- Unnamed Layout --'); } diff --git a/conlite/includes/include.lay_edit_form.php b/conlite/includes/include.lay_edit_form.php index 42c65cb..94c46ac 100644 --- a/conlite/includes/include.lay_edit_form.php +++ b/conlite/includes/include.lay_edit_form.php @@ -84,9 +84,10 @@ if (!$layout->virgin) { $ret = tplBrowseLayoutForContainers($idlay); if (strlen($ret) != 0) { + $container = []; + $types =[]; $containers = explode("&", $ret); - $types = array(); foreach ($containers as $value) { if ($value != "") { @@ -107,11 +108,7 @@ if (!$layout->virgin) { } $types = array_unique($types); - if (version_compare(PHP_VERSION, '7.4.0', '>=')) { - $layout->setProperty("layout", "used-types", implode(";", $types)); - } else { - $layout->setProperty("layout", "used-types", implode($types, ";")); - } + $layout->setProperty("layout", "used-types", implode(";", $types)); $msg = ""; @@ -138,7 +135,6 @@ if (!$layout->virgin) { } foreach ($v->missingNodes as $value) { - $idqualifier = ""; $attr = array(); @@ -236,5 +232,4 @@ if (stripslashes($_REQUEST['idlay'])) { $sReloadScript = ""; } $page->addScript('reload', $sReloadScript); -$page->render(); -?> \ No newline at end of file +$page->render(); \ No newline at end of file