diff --git a/api/src/Asyncservice.php b/api/src/Asyncservice.php index 5dcaffd7fa..e618cf1dd0 100644 --- a/api/src/Asyncservice.php +++ b/api/src/Asyncservice.php @@ -557,7 +557,7 @@ class Asyncservice { $row['async_times'] = json_php_unserialize($row['async_times']); // check for broken value during migration - if ($row['async_data'][0] == '"' && substr($row['async_data'], 0, 7) == '"\\"\\\\\\"') + if (($row['async_data'][0]??null) === '"' && substr($row['async_data'], 0, 7) == '"\\"\\\\\\"') { $row['async_data'] = null; $this->write(Db::strip_array_keys($row,'async_'), true); @@ -786,4 +786,4 @@ class Asyncservice } return $times !== False ? $this->installed() : ' '; } -} +} \ No newline at end of file diff --git a/api/src/Categories.php b/api/src/Categories.php index c0d4ea494d..7be694e1fc 100644 --- a/api/src/Categories.php +++ b/api/src/Categories.php @@ -232,7 +232,7 @@ class Categories if ($parent_id && !in_array($cat['parent'],(array)$parent_id)) continue; // return global categories just if $globals is set - if (!$globals && $cat['appname'] == self::GLOBAL_APPNAME) + if (!$globals && !empty($cat['appname']) && $cat['appname'] === self::GLOBAL_APPNAME) { continue; } @@ -525,9 +525,9 @@ class Categories } // Read access to global categories - if ($needed == Acl::READ && (($is_global=array_intersect(explode(',',$category['owner']),$this->global_owners)) || + if ($needed == Acl::READ && (($is_global=isset($category['owner']) && array_intersect(explode(',',$category['owner']),$this->global_owners)) || $no_acl_check && $category['access'] == 'public') && // no_acl_check only means public cats - ($category['appname'] == self::GLOBAL_APPNAME || $category['appname'] == $this->app_name || + (($category['appname'] ?? null) === self::GLOBAL_APPNAME || ($category['appname'] ?? null) == $this->app_name || $is_global && $allow_global_read)) { //echo "
".__METHOD__."($needed,$category[name]) access because global via memberships
\n"; @@ -535,7 +535,7 @@ class Categories } // Full access to own categories - if ($category['appname'] == $this->app_name && $category['owner'] == $this->account_id) + if (($category['appname'] ?? null) == $this->app_name && $category['owner'] == $this->account_id) { return true; } @@ -547,15 +547,15 @@ class Categories } // Load the application grants - if ($category['appname'] == $this->app_name && is_null($this->grants)) + if (($category['appname'] ?? null) == $this->app_name && isset($this->grants)) { $this->grants = $GLOBALS['egw']->acl->get_grants($this->app_name,true); } // Check for ACL granted access, the self::GLOBAL_ACCOUNT user must not get access by ACL to keep old behaviour - $acl_grant = $this->account_id != self::GLOBAL_ACCOUNT && $category['appname'] == $this->app_name; + $acl_grant = $this->account_id != self::GLOBAL_ACCOUNT && ($category['appname'] ?? null) == $this->app_name; $owner_grant = false; - foreach(explode(',',$category['owner']) as $owner) + foreach(!empty($category['owner']) ? explode(',',$category['owner']) : [] as $owner) { $owner_grant = $owner_grant || (is_array($this->grants) && !empty($this->grants[$owner]) && ($this->grants[$owner] & $needed) && ($category['access'] === 'public' || ($this->grants[$owner] & Acl::PRIVAT))); @@ -1152,4 +1152,4 @@ class Categories } return $deleted; } -} +} \ No newline at end of file diff --git a/api/src/Db.php b/api/src/Db.php index 6a3af68686..ce03aa0303 100644 --- a/api/src/Db.php +++ b/api/src/Db.php @@ -1648,7 +1648,7 @@ class Db throw new Db\Exception\InvalidSql("db::column_data_implode('$glue',".print_r($array,True).",'$use_key',".print_r($only,True).",".print_r($column_definitions,True)."nothing known about column '$key'!"); } } - $column_type = is_array($column_definitions) ? @$column_definitions[$col]['type'] : False; + $column_type = is_array($column_definitions) ? ($column_definitions[$col]['type'] ?? false) : False; $not_null = is_array($column_definitions) && isset($column_definitions[$col]['nullable']) ? !$column_definitions[$col]['nullable'] : false; $maxlength = null; diff --git a/api/src/Etemplate/Widget.php b/api/src/Etemplate/Widget.php index 0cdff5a233..d0d1710cf8 100644 --- a/api/src/Etemplate/Widget.php +++ b/api/src/Etemplate/Widget.php @@ -710,6 +710,7 @@ class Widget $row_cont = $cont[$row] ?? null; $col_row_cont = $cont[$col.$row] ?? null; + $er = error_reporting(0); try { eval('$name = "' . str_replace('"', '\\"', $name) . '";'); } @@ -717,6 +718,7 @@ class Widget error_log(__METHOD__."() eval('\$name = \"".str_replace('"', '\\"', $name) . "\";)"); _egw_log_exception($e); } + error_reporting($er); unset($col_, $row_, $row_cont, $col_row_cont); // quieten IDE warning about used vars, they might be used in above eval! } if ($is_index_in_content) diff --git a/api/src/Framework.php b/api/src/Framework.php index 41bf0bdcd7..6d212ce163 100644 --- a/api/src/Framework.php +++ b/api/src/Framework.php @@ -498,9 +498,9 @@ abstract class Framework extends Framework\Extra } $app = $GLOBALS['egw_info']['flags']['currentapp']; - $app_title = isset($GLOBALS['egw_info']['apps'][$app]) ? $GLOBALS['egw_info']['apps'][$app]['title'] : lang($app); + $app_title = $GLOBALS['egw_info']['apps'][$app]['title'] ?? lang($app); $app_header = $GLOBALS['egw_info']['flags']['app_header'] ?? $app_title; - $site_title = strip_tags($GLOBALS['egw_info']['server']['site_title'].' ['.($app_header ? $app_header : $app_title).']'); + $site_title = strip_tags(($GLOBALS['egw_info']['server']['site_title']??'').' ['.$app_header.']'); // send appheader to clientside $extra['app-header'] = $app_header; diff --git a/api/src/Vfs/Sharing.php b/api/src/Vfs/Sharing.php index 411e334184..8ef8a676fc 100644 --- a/api/src/Vfs/Sharing.php +++ b/api/src/Vfs/Sharing.php @@ -352,7 +352,7 @@ class Sharing extends \EGroupware\Api\Sharing { throw new Api\Exception\AssertionFailed("Could NOT create temp. file '$tmp_file'!"); } - if ($fp) fclose($fp); + if (isset($fp)) fclose($fp); if (is_dir($path) && !Vfs::copy_files(array($path), $tmp_file) || !is_dir($path) && !copy($path, Vfs::PREFIX.$tmp_file))