Avoid some PHP warnings about doing things to arrays that aren't arrays

This commit is contained in:
nathangray 2021-05-25 11:35:19 -06:00
parent d3d8ff3493
commit a261ce8556
2 changed files with 2 additions and 2 deletions

View File

@ -2984,7 +2984,7 @@ class addressbook_ui extends addressbook_bo
if(is_array($content))
{
$button = key($content['button']);
$button = is_array($content['button']) ? key($content['button']) : "";
switch ($button)
{
case 'vcard':

View File

@ -609,7 +609,7 @@ class infolog_bo
function &read($info_id,$run_link_id2from=true,$date_format='ts',$ignore_acl=false)
{
//error_log(__METHOD__.'('.array2string($info_id).', '.array2string($run_link_id2from).", '$date_format') ".function_backtrace());
if (is_scalar($info_id) || isset($info_id[count($info_id)-1]))
if (is_scalar($info_id) || is_array($info_id) && isset($info_id[count($info_id)-1]))
{
if (is_scalar($info_id) && !is_numeric($info_id))
{