Fix type error when third-party program passes array into getExtraKeys() or getExtraVars() #2355

This commit is contained in:
Kijin Sung 2024-05-31 13:39:45 +09:00
parent ff057034ee
commit c4fabb6182

View file

@ -362,11 +362,12 @@ class DocumentModel extends Document
*/
public static function getExtraKeys($module_srl)
{
if(!$module_srl)
if (!$module_srl || !is_scalar($module_srl))
{
return [];
}
$module_srl = (int)$module_srl;
if(!isset($GLOBALS['XE_EXTRA_KEYS'][$module_srl]))
{
$keys = Rhymix\Framework\Cache::get("site_and_module:module_document_extra_keys:$module_srl");
@ -445,11 +446,12 @@ class DocumentModel extends Document
*/
public static function getExtraVars($module_srl, $document_srl)
{
if(!$document_srl)
if (!$document_srl || !is_scalar($document_srl))
{
return [];
}
$document_srl = (int)$document_srl;
if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl]))
{
self::getDocument($document_srl);