mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
fix diverse undefined array-key or variable warnings
This commit is contained in:
parent
0758e17d24
commit
4fd00df861
@ -557,7 +557,7 @@ class Asyncservice
|
|||||||
{
|
{
|
||||||
$row['async_times'] = json_php_unserialize($row['async_times']);
|
$row['async_times'] = json_php_unserialize($row['async_times']);
|
||||||
// check for broken value during migration
|
// 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;
|
$row['async_data'] = null;
|
||||||
$this->write(Db::strip_array_keys($row,'async_'), true);
|
$this->write(Db::strip_array_keys($row,'async_'), true);
|
||||||
|
@ -232,7 +232,7 @@ class Categories
|
|||||||
if ($parent_id && !in_array($cat['parent'],(array)$parent_id)) continue;
|
if ($parent_id && !in_array($cat['parent'],(array)$parent_id)) continue;
|
||||||
|
|
||||||
// return global categories just if $globals is set
|
// 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;
|
continue;
|
||||||
}
|
}
|
||||||
@ -525,9 +525,9 @@ class Categories
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read access to global 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
|
$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))
|
$is_global && $allow_global_read))
|
||||||
{
|
{
|
||||||
//echo "<p>".__METHOD__."($needed,$category[name]) access because global via memberships</p>\n";
|
//echo "<p>".__METHOD__."($needed,$category[name]) access because global via memberships</p>\n";
|
||||||
@ -535,7 +535,7 @@ class Categories
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Full access to own 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;
|
return true;
|
||||||
}
|
}
|
||||||
@ -547,15 +547,15 @@ class Categories
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the application grants
|
// 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);
|
$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
|
// 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;
|
$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) &&
|
$owner_grant = $owner_grant || (is_array($this->grants) && !empty($this->grants[$owner]) && ($this->grants[$owner] & $needed) &&
|
||||||
($category['access'] === 'public' || ($this->grants[$owner] & Acl::PRIVAT)));
|
($category['access'] === 'public' || ($this->grants[$owner] & Acl::PRIVAT)));
|
||||||
|
@ -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).",<pre>".print_r($column_definitions,True)."</pre><b>nothing known about column '$key'!</b>");
|
throw new Db\Exception\InvalidSql("db::column_data_implode('$glue',".print_r($array,True).",'$use_key',".print_r($only,True).",<pre>".print_r($column_definitions,True)."</pre><b>nothing known about column '$key'!</b>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$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;
|
$not_null = is_array($column_definitions) && isset($column_definitions[$col]['nullable']) ? !$column_definitions[$col]['nullable'] : false;
|
||||||
|
|
||||||
$maxlength = null;
|
$maxlength = null;
|
||||||
|
@ -710,6 +710,7 @@ class Widget
|
|||||||
$row_cont = $cont[$row] ?? null;
|
$row_cont = $cont[$row] ?? null;
|
||||||
$col_row_cont = $cont[$col.$row] ?? null;
|
$col_row_cont = $cont[$col.$row] ?? null;
|
||||||
|
|
||||||
|
$er = error_reporting(0);
|
||||||
try {
|
try {
|
||||||
eval('$name = "' . str_replace('"', '\\"', $name) . '";');
|
eval('$name = "' . str_replace('"', '\\"', $name) . '";');
|
||||||
}
|
}
|
||||||
@ -717,6 +718,7 @@ class Widget
|
|||||||
error_log(__METHOD__."() eval('\$name = \"".str_replace('"', '\\"', $name) . "\";)");
|
error_log(__METHOD__."() eval('\$name = \"".str_replace('"', '\\"', $name) . "\";)");
|
||||||
_egw_log_exception($e);
|
_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!
|
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)
|
if ($is_index_in_content)
|
||||||
|
@ -498,9 +498,9 @@ abstract class Framework extends Framework\Extra
|
|||||||
}
|
}
|
||||||
|
|
||||||
$app = $GLOBALS['egw_info']['flags']['currentapp'];
|
$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;
|
$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
|
// send appheader to clientside
|
||||||
$extra['app-header'] = $app_header;
|
$extra['app-header'] = $app_header;
|
||||||
|
@ -352,7 +352,7 @@ class Sharing extends \EGroupware\Api\Sharing
|
|||||||
{
|
{
|
||||||
throw new Api\Exception\AssertionFailed("Could NOT create temp. file '$tmp_file'!");
|
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) ||
|
if (is_dir($path) && !Vfs::copy_files(array($path), $tmp_file) ||
|
||||||
!is_dir($path) && !copy($path, Vfs::PREFIX.$tmp_file))
|
!is_dir($path) && !copy($path, Vfs::PREFIX.$tmp_file))
|
||||||
|
Loading…
Reference in New Issue
Block a user