From 33dcc58748d4341877605afaa0e133ba3132e58d Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Sun, 19 Feb 2023 10:00:57 +0100 Subject: [PATCH] always return string --- conlite/includes/functions.con2.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/conlite/includes/functions.con2.php b/conlite/includes/functions.con2.php index 7183c4c..b424656 100644 --- a/conlite/includes/functions.con2.php +++ b/conlite/includes/functions.con2.php @@ -237,7 +237,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) { $a_container = explode("&", $tmp_returnstring); foreach ($a_container as $key => $value) { - + if (is_numeric($a_d[$value])) { $thisModule = ''; $thisContainer = ''; @@ -573,21 +573,18 @@ function conGetAvailableMetaTagTypes() { * @return string tag value or empty string */ function conGetMetaValue($idartlang, $idmetatype) { + $sRet = ""; + if (!empty($idartlang)) { + $oMetaTags = new cApiMetaTagCollection(); + $oMetaTags->setWhere('idartlang', Contenido_Security::toInteger($idartlang)); + $oMetaTags->setWhere('idmetatype', Contenido_Security::toInteger($idmetatype)); + $oMetaTags->query(); - if ($idartlang == 0) - return; - - $oMetaTags = new cApiMetaTagCollection(); - $oMetaTags->setWhere('idartlang', Contenido_Security::toInteger($idartlang)); - $oMetaTags->setWhere('idmetatype', Contenido_Security::toInteger($idmetatype)); - $oMetaTags->query(); - - if ($oMetaTags->count() > 0) { - $sRet = $oMetaTags->next()->get('metavalue'); - } else { - $sRet = ""; + if ($oMetaTags->count() > 0) { + $sRet = $oMetaTags->next()->get('metavalue'); + } + unset($oMetaTags); // save mem } - unset($oMetaTags); // save mem return $sRet; }