fixes PHP 7.3
Dieser Commit ist enthalten in:
		
							Ursprung
							
								
									4ca038a0df
								
							
						
					
					
						Commit
						06b4a295fb
					
				
					 6 geänderte Dateien mit 508 neuen und 549 gelöschten Zeilen
				
			
		|  | @ -1,31 +1,4 @@ | ||||||
| <?php | <?php | ||||||
| /** |  | ||||||
|  * Project:  |  | ||||||
|  * Contenido Content Management System |  | ||||||
|  *  |  | ||||||
|  * Description:  |  | ||||||
|  * HTML parser for contenido |  | ||||||
|  *  |  | ||||||
|  * Requirements:  |  | ||||||
|  * @con_php_req 5.0 |  | ||||||
|  *  |  | ||||||
|  * |  | ||||||
|  * @package    Contenido Backend classes |  | ||||||
|  * @version    1.0.2 |  | ||||||
|  * @author     Starnetsys, LLC. |  | ||||||
|  * @copyright  Starnetsys, LLC. |  | ||||||
|  * @link       http://starnetsys.com |  | ||||||
|  * @since      file available since contenido release <= 4.6 |  | ||||||
|  *  |  | ||||||
|  * {@internal  |  | ||||||
|  *   created unknown |  | ||||||
|  *   modified 2008-07-02, Frederic Schneider, add security fix |  | ||||||
|  *   modified 2009-10-23, Murat Purc, removed deprecated function (PHP 5.3 ready) |  | ||||||
|  * |  | ||||||
|  *   $Id$: |  | ||||||
|  * }} |  | ||||||
|  *  |  | ||||||
|  */ |  | ||||||
| 
 | 
 | ||||||
| if (!defined('CON_FRAMEWORK')) { | if (!defined('CON_FRAMEWORK')) { | ||||||
|     die('Illegal call'); |     die('Illegal call'); | ||||||
|  | @ -79,7 +52,6 @@ class HtmlParser { | ||||||
|      * of the current node. Indexes are always lowercase. |      * of the current node. Indexes are always lowercase. | ||||||
|      */ |      */ | ||||||
|     var $iNodeAttributes; |     var $iNodeAttributes; | ||||||
| 
 |  | ||||||
|     // The following fields should be 
 |     // The following fields should be 
 | ||||||
|     // considered private:
 |     // considered private:
 | ||||||
| 
 | 
 | ||||||
|  | @ -87,7 +59,6 @@ class HtmlParser { | ||||||
|     var $iHtmlTextLength; |     var $iHtmlTextLength; | ||||||
|     var $iHtmlTextIndex = 0; |     var $iHtmlTextIndex = 0; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     /** |     /** | ||||||
|      * Constructor. |      * Constructor. | ||||||
|      * Constructs an HtmlParser instance with |      * Constructs an HtmlParser instance with | ||||||
|  | @ -132,8 +103,7 @@ class HtmlParser { | ||||||
|             $this->iNodeType = NODE_TYPE_ENDELEMENT; |             $this->iNodeType = NODE_TYPE_ENDELEMENT; | ||||||
|             $this->iNodeName = substr($name, 1); |             $this->iNodeName = substr($name, 1); | ||||||
|             $this->iNodeValue = ""; |             $this->iNodeValue = ""; | ||||||
|         }  |         } else { | ||||||
|         else { |  | ||||||
|             if (!$this->isValidTagIdentifier($name)) { |             if (!$this->isValidTagIdentifier($name)) { | ||||||
|                 $comment = false; |                 $comment = false; | ||||||
|                 if ($name == "!--") { |                 if ($name == "!--") { | ||||||
|  | @ -151,15 +121,13 @@ class HtmlParser { | ||||||
|                     $this->iNodeValue = "<" . $name; |                     $this->iNodeValue = "<" . $name; | ||||||
|                 } |                 } | ||||||
|                 return true; |                 return true; | ||||||
|             } |             } else { | ||||||
|             else { |  | ||||||
|                 $this->iNodeType = NODE_TYPE_ELEMENT; |                 $this->iNodeType = NODE_TYPE_ELEMENT; | ||||||
|                 $this->iNodeValue = ""; |                 $this->iNodeValue = ""; | ||||||
|                 $nameLength = strlen($name); |                 $nameLength = strlen($name); | ||||||
|                 if ($nameLength > 0 && substr($name, $nameLength - 1, 1) == "/") { |                 if ($nameLength > 0 && substr($name, $nameLength - 1, 1) == "/") { | ||||||
|                     $this->iNodeName = substr($name, 0, $nameLength - 1); |                     $this->iNodeName = substr($name, 0, $nameLength - 1); | ||||||
|                 } |                 } else { | ||||||
|                 else { |  | ||||||
|                     $this->iNodeName = $name; |                     $this->iNodeName = $name; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  | @ -173,8 +141,7 @@ class HtmlParser { | ||||||
|                     $this->skipBlanksInTag(); |                     $this->skipBlanksInTag(); | ||||||
|                     $value = $this->readValueInTag(); |                     $value = $this->readValueInTag(); | ||||||
|                     $this->iNodeAttributes[strtolower($attrName)] = $value; |                     $this->iNodeAttributes[strtolower($attrName)] = $value; | ||||||
|                 } |                 } else { | ||||||
|                 else { |  | ||||||
|                     $this->iNodeAttributes[strtolower($attrName)] = ""; |                     $this->iNodeAttributes[strtolower($attrName)] = ""; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  | @ -210,13 +177,11 @@ class HtmlParser { | ||||||
|             $this->skipInTag(array("\"")); |             $this->skipInTag(array("\"")); | ||||||
|             $value = $this->skipToInTag(array("\"")); |             $value = $this->skipToInTag(array("\"")); | ||||||
|             $this->skipInTag(array("\"")); |             $this->skipInTag(array("\"")); | ||||||
|         } |         } else if ($ch == "\'") { | ||||||
|         else if ($ch == "\'") { |  | ||||||
|             $this->skipInTag(array("\'")); |             $this->skipInTag(array("\'")); | ||||||
|             $value = $this->skipToInTag(array("\'")); |             $value = $this->skipToInTag(array("\'")); | ||||||
|             $this->skipInTag(array("\'")); |             $this->skipInTag(array("\'")); | ||||||
|         }                 |         } else { | ||||||
|         else { |  | ||||||
|             $value = $this->skipToBlanksInTag(); |             $value = $this->skipToBlanksInTag(); | ||||||
|         } |         } | ||||||
|         return $value; |         return $value; | ||||||
|  | @ -233,8 +198,7 @@ class HtmlParser { | ||||||
|         if ($this->iHtmlTextIndex < $this->iHtmlTextLength) { |         if ($this->iHtmlTextIndex < $this->iHtmlTextLength) { | ||||||
|             $this->iHtmlTextIndex++; |             $this->iHtmlTextIndex++; | ||||||
|             return true; |             return true; | ||||||
|         } |         } else { | ||||||
|         else { |  | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -259,7 +223,12 @@ class HtmlParser { | ||||||
|                 return $sb; |                 return $sb; | ||||||
|             } else { |             } else { | ||||||
|                 $match = false; |                 $match = false; | ||||||
|                 for ($idx = 0; $idx < count($chars); $idx++) { |                 if(is_countable($chars)) { | ||||||
|  |                     $int_cnt_chars = count($chars); | ||||||
|  |                 } else { | ||||||
|  |                     $int_cnt_chars = strlen($chars); | ||||||
|  |                 } | ||||||
|  |                 for ($idx = 0; $idx < $int_cnt_chars; $idx++) { | ||||||
|                     if ($ch == $chars[$idx]) { |                     if ($ch == $chars[$idx]) { | ||||||
|                         $match = true; |                         $match = true; | ||||||
|                         break; |                         break; | ||||||
|  | @ -280,7 +249,12 @@ class HtmlParser { | ||||||
|         while (($ch = $this->currentChar()) !== -1) { |         while (($ch = $this->currentChar()) !== -1) { | ||||||
|             $match = $ch == ">"; |             $match = $ch == ">"; | ||||||
|             if (!$match) { |             if (!$match) { | ||||||
|                 for ($idx = 0; $idx < count($chars); $idx++) { |                 if(is_countable($chars)) { | ||||||
|  |                     $int_cnt_chars = count($chars); | ||||||
|  |                 } else { | ||||||
|  |                     $int_cnt_chars = strlen($chars); | ||||||
|  |                 } | ||||||
|  |                 for ($idx = 0; $idx < $int_cnt_chars; $idx++) { | ||||||
|                     if ($ch == $chars[$idx]) { |                     if ($ch == $chars[$idx]) { | ||||||
|                         $match = true; |                         $match = true; | ||||||
|                         break; |                         break; | ||||||
|  | @ -324,6 +298,5 @@ class HtmlParser { | ||||||
|         $this->iHtmlTextIndex = $top; |         $this->iHtmlTextIndex = $top; | ||||||
|         return $retvalue; |         return $retvalue; | ||||||
|     } |     } | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| ?>
 | } | ||||||
|  |  | ||||||
|  | @ -328,7 +328,9 @@ class PropertyCollection extends ItemCollection | ||||||
|     public function getAllValues($field, $fieldValue, $auth=NULL) |     public function getAllValues($field, $fieldValue, $auth=NULL) | ||||||
|     { |     { | ||||||
|         $authString = ''; |         $authString = ''; | ||||||
|         if (!is_null($auth) && sizeof($auth) > 0) { |         if (!is_null($auth) | ||||||
|  |                 && is_countable($auth) | ||||||
|  |                 && sizeof($auth) > 0) { | ||||||
|             $authString .= " AND author = '" . $auth->auth["uid"] . "'"; |             $authString .= " AND author = '" . $auth->auth["uid"] . "'"; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -56,7 +56,7 @@ class cTinyMCEEditor extends cWYSIWYGEditor { | ||||||
|      */ |      */ | ||||||
|     var $_bUseGZIP = false; |     var $_bUseGZIP = false; | ||||||
| 
 | 
 | ||||||
|     function cTinyMCEEditor($sEditorName, $sEditorContent) { |     public function __construct($sEditorName, $sEditorContent) { | ||||||
|         global $belang, $cfg, $cfgClient, $client, $lang, $idart; |         global $belang, $cfg, $cfgClient, $client, $lang, $idart; | ||||||
| 
 | 
 | ||||||
|         parent::__construct($sEditorName, $sEditorContent); |         parent::__construct($sEditorName, $sEditorContent); | ||||||
|  |  | ||||||
|  | @ -1,6 +1,38 @@ | ||||||
| <?php | <?php | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * PHP 7.3 functions for older PHP versions | ||||||
|  |  *  | ||||||
|  |  * @package Core | ||||||
|  |  * @subpackage functions | ||||||
|  |  * @version $Rev$ | ||||||
|  |  * @since 2.0.3 | ||||||
|  |  * @author Ortwin Pinke <o.pinke@conlite.org> | ||||||
|  |  * @copyright (c) 2019, conlite.org | ||||||
|  |  * @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version) | ||||||
|  |  * @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version) | ||||||
|  |  * @link http://www.conlite.org ConLite.org | ||||||
|  |  *  | ||||||
|  |  * $Id$ | ||||||
|  |  */ | ||||||
|  | // security check
 | ||||||
|  | defined('CON_FRAMEWORK') or die('Illegal call'); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| if (!function_exists('is_countable')) { | if (!function_exists('is_countable')) { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Verify that the contents of a variable is a countable value | ||||||
|  |      * <p>Verify that the contents of a variable is an <code>array</code> or an object implementing Countable</p> | ||||||
|  |      * @param mixed $var <p>The value to check</p> | ||||||
|  |      * @return bool <p>Returns <b><code>TRUE</code></b> if <code>var</code> is countable, <b><code>FALSE</code></b> otherwise.</p> | ||||||
|  |      * @link http://php.net/manual/en/function.is-countable.php | ||||||
|  |      *  | ||||||
|  |      * @param Countable $var | ||||||
|  |      * @return boolean | ||||||
|  |      */ | ||||||
|     function is_countable($var) { |     function is_countable($var) { | ||||||
|         return (is_array($var) || $var instanceof Countable); |         return (is_array($var) || $var instanceof Countable); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | @ -1,4 +1,5 @@ | ||||||
| <?php | <?php | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * Project:  |  * Project:  | ||||||
|  * Contenido Content Management System |  * Contenido Content Management System | ||||||
|  | @ -29,7 +30,6 @@ | ||||||
|  * }} |  * }} | ||||||
|  *  |  *  | ||||||
|  */ |  */ | ||||||
| 
 |  | ||||||
| if (!defined('CON_FRAMEWORK')) { | if (!defined('CON_FRAMEWORK')) { | ||||||
|     die('Illegal call'); |     die('Illegal call'); | ||||||
| } | } | ||||||
|  | @ -43,8 +43,7 @@ cInclude ("includes", "functions.con.php"); | ||||||
|  * @author Jan Lengowski <Jan.Lengowski@4fb.de> |  * @author Jan Lengowski <Jan.Lengowski@4fb.de> | ||||||
|  * @copyright four for business AG <www.4fb.de> |  * @copyright four for business AG <www.4fb.de> | ||||||
|  */ |  */ | ||||||
| function tplEditTemplate($changelayout, $idtpl, $name, $description, $idlay, $c, $default) | function tplEditTemplate($changelayout, $idtpl, $name, $description, $idlay, $c, $default) { | ||||||
| { |  | ||||||
| 
 | 
 | ||||||
|     global $db; |     global $db; | ||||||
|     global $sess; |     global $sess; | ||||||
|  | @ -89,7 +88,6 @@ function tplEditTemplate($changelayout, $idtpl, $name, $description, $idlay, $c, | ||||||
|         // set correct rights for element
 |         // set correct rights for element
 | ||||||
|         cInclude("includes", "functions.rights.php"); |         cInclude("includes", "functions.rights.php"); | ||||||
|         createRightsForElement("tpl", $idtpl); |         createRightsForElement("tpl", $idtpl); | ||||||
| 
 |  | ||||||
|     } else { |     } else { | ||||||
| 
 | 
 | ||||||
|         /* Update */ |         /* Update */ | ||||||
|  | @ -113,17 +111,14 @@ function tplEditTemplate($changelayout, $idtpl, $name, $description, $idlay, $c, | ||||||
|                 $sql .= "'" . Contenido_Security::toInteger($c[$idcontainer]) . "'"; |                 $sql .= "'" . Contenido_Security::toInteger($c[$idcontainer]) . "'"; | ||||||
|                 $sql .= ") "; |                 $sql .= ") "; | ||||||
|                 $db->query($sql); |                 $db->query($sql); | ||||||
| 
 |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         /* Generate code */ |         /* Generate code */ | ||||||
|         conGenerateCodeForAllartsUsingTemplate($idtpl); |         conGenerateCodeForAllartsUsingTemplate($idtpl); | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 		if ($default == 1) |     if ($default == 1) { | ||||||
| 		{ |  | ||||||
|         $sql = "UPDATE " . $cfg["tab"]["tpl"] . " SET defaulttemplate = '0' WHERE idclient = '" . Contenido_Security::toInteger($client) . "'"; |         $sql = "UPDATE " . $cfg["tab"]["tpl"] . " SET defaulttemplate = '0' WHERE idclient = '" . Contenido_Security::toInteger($client) . "'"; | ||||||
|         $db->query($sql); |         $db->query($sql); | ||||||
| 
 | 
 | ||||||
|  | @ -142,7 +137,6 @@ function tplEditTemplate($changelayout, $idtpl, $name, $description, $idlay, $c, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return $idtpl; |     return $idtpl; | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | @ -181,15 +175,12 @@ function tplDeleteTemplate($idtpl) { | ||||||
| 
 | 
 | ||||||
|         $sql = "DELETE FROM " . $cfg["tab"]["container_conf"] . " WHERE idtplcfg = '" . Contenido_Security::toInteger($id) . "'"; |         $sql = "DELETE FROM " . $cfg["tab"]["container_conf"] . " WHERE idtplcfg = '" . Contenido_Security::toInteger($id) . "'"; | ||||||
|         $db->query($sql); |         $db->query($sql); | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     cInclude("includes", "functions.rights.php"); |     cInclude("includes", "functions.rights.php"); | ||||||
|     deleteRightsForElement("tpl", $idtpl); |     deleteRightsForElement("tpl", $idtpl); | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| /** | /** | ||||||
|  * Browse a specific layout for containers |  * Browse a specific layout for containers | ||||||
|  * |  * | ||||||
|  | @ -256,16 +247,13 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) { | ||||||
|  * |  * | ||||||
|  * @return string Container name |  * @return string Container name | ||||||
|  */ |  */ | ||||||
| function tplGetContainerName($idlay, $container)  | function tplGetContainerName($idlay, $container) { | ||||||
| { |  | ||||||
|     global $db; |     global $db; | ||||||
|     global $cfg; |     global $cfg; | ||||||
|     global $containerinf; |     global $containerinf; | ||||||
| 
 | 
 | ||||||
| 		if (is_array($containerinf[$idlay])) |     if (is_array($containerinf[$idlay])) { | ||||||
| 		{ |         if (array_key_exists($container, $containerinf[$idlay])) { | ||||||
|     		if (array_key_exists($container, $containerinf[$idlay])) |  | ||||||
|     		{ |  | ||||||
|             return $containerinf[$idlay][$container]["name"]; |             return $containerinf[$idlay][$container]["name"]; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -279,16 +267,13 @@ function tplGetContainerName($idlay, $container) | ||||||
|  * |  * | ||||||
|  * @return string Container name |  * @return string Container name | ||||||
|  */ |  */ | ||||||
| function tplGetContainerMode($idlay, $container)  | function tplGetContainerMode($idlay, $container) { | ||||||
| { |  | ||||||
|     global $db; |     global $db; | ||||||
|     global $cfg; |     global $cfg; | ||||||
|     global $containerinf; |     global $containerinf; | ||||||
| 
 | 
 | ||||||
| 		if (is_array($containerinf[$idlay])) |     if (is_array($containerinf[$idlay])) { | ||||||
| 		{ |         if (array_key_exists($container, $containerinf[$idlay])) { | ||||||
|     		if (array_key_exists($container, $containerinf[$idlay])) |  | ||||||
|     		{ |  | ||||||
|             return $containerinf[$idlay][$container]["mode"]; |             return $containerinf[$idlay][$container]["mode"]; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -302,22 +287,17 @@ function tplGetContainerMode($idlay, $container) | ||||||
|  * |  * | ||||||
|  * @return array Allowed container types |  * @return array Allowed container types | ||||||
|  */ |  */ | ||||||
| function tplGetContainerTypes($idlay, $container)  | function tplGetContainerTypes($idlay, $container) { | ||||||
| { |  | ||||||
|     global $db; |     global $db; | ||||||
|     global $cfg; |     global $cfg; | ||||||
|     global $containerinf; |     global $containerinf; | ||||||
| 
 | 
 | ||||||
| 		if (is_array($containerinf[$idlay])) |     if (is_array($containerinf[$idlay])) { | ||||||
| 		{ |         if (array_key_exists($container, $containerinf[$idlay])) { | ||||||
|     		if (array_key_exists($container, $containerinf[$idlay])) |             if ($containerinf[$idlay][$container]["types"] != "") { | ||||||
|     		{ |  | ||||||
|     			if ($containerinf[$idlay][$container]["types"] != "") |  | ||||||
|     			{ |  | ||||||
|                 $list = explode(",", $containerinf[$idlay][$container]["types"]); |                 $list = explode(",", $containerinf[$idlay][$container]["types"]); | ||||||
| 
 | 
 | ||||||
|         			foreach ($list as $key => $value) |                 foreach ($list as $key => $value) { | ||||||
|         			{ |  | ||||||
|                     $list[$key] = trim($value); |                     $list[$key] = trim($value); | ||||||
|                 } |                 } | ||||||
|                 return $list; |                 return $list; | ||||||
|  | @ -334,16 +314,13 @@ function tplGetContainerTypes($idlay, $container) | ||||||
|  * |  * | ||||||
|  * @return array Allowed container types |  * @return array Allowed container types | ||||||
|  */ |  */ | ||||||
| function tplGetContainerDefault($idlay, $container)  | function tplGetContainerDefault($idlay, $container) { | ||||||
| { |  | ||||||
|     global $db; |     global $db; | ||||||
|     global $cfg; |     global $cfg; | ||||||
|     global $containerinf; |     global $containerinf; | ||||||
| 
 | 
 | ||||||
| 		if (is_array($containerinf[$idlay])) |     if (is_array($containerinf[$idlay])) { | ||||||
| 		{ |         if (array_key_exists($container, $containerinf[$idlay])) { | ||||||
|     		if (array_key_exists($container, $containerinf[$idlay])) |  | ||||||
|     		{ |  | ||||||
|             return $containerinf[$idlay][$container]["default"]; |             return $containerinf[$idlay][$container]["default"]; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -372,20 +349,17 @@ function tplPreparseLayout ($idlay, $raw_code = NULL) { | ||||||
| 
 | 
 | ||||||
|     $parser = new HtmlParser($code); |     $parser = new HtmlParser($code); | ||||||
|     $bIsBody = false; |     $bIsBody = false; | ||||||
| 	while ($parser->parse()) |     while ($parser->parse()) { | ||||||
| 	{ |  | ||||||
|         if (strtolower($parser->iNodeName) == 'body') { |         if (strtolower($parser->iNodeName) == 'body') { | ||||||
|             $bIsBody = true; |             $bIsBody = true; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 		if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) |         if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) { | ||||||
| 		{ |  | ||||||
|             $idcontainer = $parser->iNodeAttributes["id"]; |             $idcontainer = $parser->iNodeAttributes["id"]; | ||||||
| 
 | 
 | ||||||
|             $mode = $parser->iNodeAttributes["mode"]; |             $mode = $parser->iNodeAttributes["mode"]; | ||||||
| 
 | 
 | ||||||
| 			if ($mode == "") |             if ($mode == "") { | ||||||
| 			{ |  | ||||||
|                 $mode = "optional"; |                 $mode = "optional"; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  | @ -473,7 +447,6 @@ function tplDuplicateTemplate($idtpl) { | ||||||
|                 (idcontainer, idtpl, number, idmod) VALUES ('" . Contenido_Security::toInteger($nextid) . "', '" . Contenido_Security::toInteger($new_idtpl) . "', '" . Contenido_Security::toInteger($key) . "', '" . Contenido_Security::toInteger($value) . "')";
 |                 (idcontainer, idtpl, number, idmod) VALUES ('" . Contenido_Security::toInteger($nextid) . "', '" . Contenido_Security::toInteger($new_idtpl) . "', '" . Contenido_Security::toInteger($key) . "', '" . Contenido_Security::toInteger($value) . "')";
 | ||||||
| 
 | 
 | ||||||
|         $db->query($sql); |         $db->query($sql); | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     //modified (added) 2008-06-30 timo.trautmann added fix module settings were also copied
 |     //modified (added) 2008-06-30 timo.trautmann added fix module settings were also copied
 | ||||||
|  | @ -502,7 +475,6 @@ function tplDuplicateTemplate($idtpl) { | ||||||
| 					   (idcontainerc, idtplcfg, number, container) VALUES ('" . Contenido_Security::toInteger($nextid) . "', '" . Contenido_Security::toInteger($new_idtpl_conf) . "', '" . Contenido_Security::escapeDB($key, $db) . "', '" . Contenido_Security::escapeDB($value, $db) . "')";
 | 					   (idcontainerc, idtplcfg, number, container) VALUES ('" . Contenido_Security::toInteger($nextid) . "', '" . Contenido_Security::toInteger($new_idtpl_conf) . "', '" . Contenido_Security::escapeDB($key, $db) . "', '" . Contenido_Security::escapeDB($value, $db) . "')";
 | ||||||
| 
 | 
 | ||||||
|             $db->query($sql); |             $db->query($sql); | ||||||
|     |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     //modified (added) 2008-06-30 end
 |     //modified (added) 2008-06-30 end
 | ||||||
|  | @ -511,7 +483,6 @@ function tplDuplicateTemplate($idtpl) { | ||||||
|     copyRightsForElement("tpl", $idtpl, $new_idtpl); |     copyRightsForElement("tpl", $idtpl, $new_idtpl); | ||||||
| 
 | 
 | ||||||
|     return $new_idtpl; |     return $new_idtpl; | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | @ -566,7 +537,6 @@ function tplIsTemplateInUse($idtpl) { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return false; |     return false; | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | @ -634,7 +604,6 @@ function tplGetInUsedData($idtpl) { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return $aUsedData; |     return $aUsedData; | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | @ -645,8 +614,7 @@ function tplGetInUsedData($idtpl) { | ||||||
|  * @return int new template configuration ID |  * @return int new template configuration ID | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
| function tplcfgDuplicate ($idtplcfg) | function tplcfgDuplicate($idtplcfg) { | ||||||
| { |  | ||||||
|     global $cfg; |     global $cfg; | ||||||
| 
 | 
 | ||||||
|     $db = new DB_ConLite; |     $db = new DB_ConLite; | ||||||
|  | @ -661,8 +629,7 @@ function tplcfgDuplicate ($idtplcfg) | ||||||
| 
 | 
 | ||||||
|     $db->query($sql); |     $db->query($sql); | ||||||
| 
 | 
 | ||||||
| 	if ($db->next_record()) |     if ($db->next_record()) { | ||||||
| 	{ |  | ||||||
|         $newidtplcfg = $db2->nextid($cfg["tab"]["tpl_conf"]); |         $newidtplcfg = $db2->nextid($cfg["tab"]["tpl_conf"]); | ||||||
|         $idtpl = $db->f("idtpl"); |         $idtpl = $db->f("idtpl"); | ||||||
|         $status = $db->f("status"); |         $status = $db->f("status"); | ||||||
|  | @ -688,8 +655,7 @@ function tplcfgDuplicate ($idtplcfg) | ||||||
| 
 | 
 | ||||||
|         $db->query($sql); |         $db->query($sql); | ||||||
| 
 | 
 | ||||||
|     	while ($db->next_record()) |         while ($db->next_record()) { | ||||||
|     	{ |  | ||||||
|             $newidcontainerc = $db2->nextid($cfg["tab"]["container_conf"]); |             $newidcontainerc = $db2->nextid($cfg["tab"]["container_conf"]); | ||||||
|             $number = $db->f("number"); |             $number = $db->f("number"); | ||||||
|             $container = $db->f("container"); |             $container = $db->f("container"); | ||||||
|  | @ -704,7 +670,6 @@ function tplcfgDuplicate ($idtplcfg) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return ($newidtplcfg); |     return ($newidtplcfg); | ||||||
| 	 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /* | /* | ||||||
|  | @ -719,52 +684,44 @@ function tplcfgDuplicate ($idtplcfg) | ||||||
|  *       is empty. We need a better logic for handling "changes".  |  *       is empty. We need a better logic for handling "changes".  | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| function tplAutoFillModules ($idtpl) | function tplAutoFillModules($idtpl) { | ||||||
| { |  | ||||||
|     global $cfg; |     global $cfg; | ||||||
|     global $db_autofill; |     global $db_autofill; | ||||||
|     global $containerinf; |     global $containerinf; | ||||||
|     global $_autoFillcontainerCache; |     global $_autoFillcontainerCache; | ||||||
| 
 | 
 | ||||||
| 	if (!is_object($db_autofill)) |     if (!is_object($db_autofill)) { | ||||||
| 	{ |  | ||||||
|         $db_autofill = new DB_ConLite; |         $db_autofill = new DB_ConLite; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     $sql = "SELECT idlay FROM " . $cfg["tab"]["tpl"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "'"; |     $sql = "SELECT idlay FROM " . $cfg["tab"]["tpl"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "'"; | ||||||
|     $db_autofill->query($sql); |     $db_autofill->query($sql); | ||||||
| 
 | 
 | ||||||
| 	if (!$db_autofill->next_record()) |     if (!$db_autofill->next_record()) { | ||||||
| 	{ |  | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     $idlay = $db_autofill->f("idlay"); |     $idlay = $db_autofill->f("idlay"); | ||||||
| 
 | 
 | ||||||
| 	if (!(is_array($containerinf) && array_key_exists($idlay, $containerinf) && array_key_exists($idlay, $_autoFillcontainerCache))) |     if (!(is_array($containerinf) && array_key_exists($idlay, $containerinf) && array_key_exists($idlay, $_autoFillcontainerCache))) { | ||||||
| 	{ |  | ||||||
|         tplPreparseLayout($idlay); |         tplPreparseLayout($idlay); | ||||||
|         $_autoFillcontainerCache[$idlay] = tplBrowseLayoutForContainers($idlay); |         $_autoFillcontainerCache[$idlay] = tplBrowseLayoutForContainers($idlay); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     $a_container = explode("&", $_autoFillcontainerCache[$idlay]); |     $a_container = explode("&", $_autoFillcontainerCache[$idlay]); | ||||||
| 
 | 
 | ||||||
| 	foreach ($a_container as $container) |     foreach ($a_container as $container) { | ||||||
| 	{ |         switch ($containerinf[$idlay][$container]["mode"]) { | ||||||
| 		switch ($containerinf[$idlay][$container]["mode"]) |  | ||||||
| 		{ |  | ||||||
|             /* Fixed mode */ |             /* Fixed mode */ | ||||||
|             case "fixed": |             case "fixed": | ||||||
| 			if ($containerinf[$idlay][$container]["default"] != "") |                 if ($containerinf[$idlay][$container]["default"] != "") { | ||||||
| 			{ |  | ||||||
|                     $sql = "SELECT idmod FROM " . $cfg["tab"]["mod"] |                     $sql = "SELECT idmod FROM " . $cfg["tab"]["mod"] | ||||||
|                             . " WHERE name = '" . |                             . " WHERE name = '" . | ||||||
|                             Contenido_Security::escapeDB($containerinf[$idlay][$container]["default"], $db_autofill) . "'"; |                             Contenido_Security::escapeDB($containerinf[$idlay][$container]["default"], $db_autofill) . "'"; | ||||||
| 
 | 
 | ||||||
|                     $db_autofill->query($sql); |                     $db_autofill->query($sql); | ||||||
| 
 | 
 | ||||||
| 				if ($db_autofill->next_record()) |                     if ($db_autofill->next_record()) { | ||||||
| 				{ |  | ||||||
|                         $idmod = $db_autofill->f("idmod"); |                         $idmod = $db_autofill->f("idmod"); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -772,8 +729,7 @@ function tplAutoFillModules ($idtpl) | ||||||
| 
 | 
 | ||||||
|                         $db_autofill->query($sql); |                         $db_autofill->query($sql); | ||||||
| 
 | 
 | ||||||
| 					if ($db_autofill->next_record()) |                         if ($db_autofill->next_record()) { | ||||||
| 					{ |  | ||||||
|                             $sql = "UPDATE " . $cfg["tab"]["container"] . |                             $sql = "UPDATE " . $cfg["tab"]["container"] . | ||||||
|                                     " SET idmod = '" . Contenido_Security::toInteger($idmod) . "' WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "'" . |                                     " SET idmod = '" . Contenido_Security::toInteger($idmod) . "' WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "'" . | ||||||
|                                     " AND number = '" . Contenido_Security::toInteger($container) . "' AND " . |                                     " AND number = '" . Contenido_Security::toInteger($container) . "' AND " . | ||||||
|  | @ -792,16 +748,14 @@ function tplAutoFillModules ($idtpl) | ||||||
| 
 | 
 | ||||||
|             case "mandatory": |             case "mandatory": | ||||||
| 
 | 
 | ||||||
| 			if ($containerinf[$idlay][$container]["default"] != "") |                 if ($containerinf[$idlay][$container]["default"] != "") { | ||||||
| 			{ |  | ||||||
|                     $sql = "SELECT idmod FROM " . $cfg["tab"]["mod"] |                     $sql = "SELECT idmod FROM " . $cfg["tab"]["mod"] | ||||||
|                             . " WHERE name = '" . |                             . " WHERE name = '" . | ||||||
|                             Contenido_Security::escapeDB($containerinf[$idlay][$container]["default"], $db) . "'"; |                             Contenido_Security::escapeDB($containerinf[$idlay][$container]["default"], $db) . "'"; | ||||||
| 
 | 
 | ||||||
|                     $db_autofill->query($sql); |                     $db_autofill->query($sql); | ||||||
| 
 | 
 | ||||||
| 				if ($db_autofill->next_record()) |                     if ($db_autofill->next_record()) { | ||||||
| 				{ |  | ||||||
|                         $idmod = $db_autofill->f("idmod"); |                         $idmod = $db_autofill->f("idmod"); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -810,8 +764,7 @@ function tplAutoFillModules ($idtpl) | ||||||
| 
 | 
 | ||||||
|                         $db_autofill->query($sql); |                         $db_autofill->query($sql); | ||||||
| 
 | 
 | ||||||
| 					if ($db_autofill->next_record()) |                         if ($db_autofill->next_record()) { | ||||||
| 					{ |  | ||||||
|                              |                              | ||||||
|                         } else { |                         } else { | ||||||
|                             $sql = "INSERT INTO " . $cfg["tab"]["container"] . |                             $sql = "INSERT INTO " . $cfg["tab"]["container"] . | ||||||
|  | @ -824,7 +777,6 @@ function tplAutoFillModules ($idtpl) | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| ?>
 | ?>
 | ||||||
|  | @ -347,7 +347,7 @@ class MetaTagCreatorHtml5 { | ||||||
|      */ |      */ | ||||||
|     protected function _checkCacheFile() { |     protected function _checkCacheFile() { | ||||||
|         if(file_exists($this->_sCacheFile)) { |         if(file_exists($this->_sCacheFile)) { | ||||||
|             $iDiff = mktime() - filemtime($this->_sCacheFile); |             $iDiff = time() - filemtime($this->_sCacheFile); | ||||||
|             if($iDiff < $this->_aConfig['cachetime']) { |             if($iDiff < $this->_aConfig['cachetime']) { | ||||||
|                 return true; |                 return true; | ||||||
|             } |             } | ||||||
|  |  | ||||||
		Laden …
	
	Tabelle hinzufügen
		
		In neuem Issue referenzieren