mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Fix type error when third-party program passes array into getExtraKeys() or getExtraVars() #2355
This commit is contained in:
parent
ff057034ee
commit
c4fabb6182
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue