Fix JS key in object check function
instead of using "in" which could return true for other entries in the object use the proper hasOwnProperty call
This commit is contained in:
@@ -78,7 +78,7 @@ $cms->DATA['ADMIN'] = $login->acl['admin'];
|
||||
// the template part to include into the body
|
||||
$cms->DATA['TEMPLATE_NAME'] = $TEMPLATE_NAME;
|
||||
$cms->DATA['CONTENT_INCLUDE'] = $CONTENT_INCLUDE;
|
||||
$cms->DATA['TEMPLATE_TRANSLATE'] = $TEMPLATE_TRANSLATE;
|
||||
$cms->DATA['TEMPLATE_TRANSLATE'] = isset($TEMPLATE_TRANSLATE) ? $TEMPLATE_TRANSLATE : null;
|
||||
$cms->DATA['PAGE_FILE_NAME'] = $PAGE_FILE_NAME;
|
||||
// LANG
|
||||
$cms->DATA['LANG'] = $lang;
|
||||
|
||||
@@ -295,10 +295,12 @@ function isObject(val) {
|
||||
* @param {Object} object object to search key in
|
||||
* @return {Boolean} true/false if key exists in object
|
||||
*/
|
||||
const keyInObject = (key, object) => (key in object) ? true : false;
|
||||
// const keyInObject = (key, object) => (key in object) ? true : false;
|
||||
const keyInObject = (key, object) => (Object.prototype.hasOwnProperty.call(object, key)) ? true : false;
|
||||
/*function keyInObject(key, object)
|
||||
{
|
||||
return (key in object) ? true : false;
|
||||
// return (key in object) ? true : false;
|
||||
return (Object.prototype.hasOwnProperty.call(object, key)) ? true : false;
|
||||
}*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user