Avoid some more PHP warnings

"Trying to access array offset on value of type null"
This commit is contained in:
nathan 2023-12-05 13:27:26 -07:00
parent 673ac0a14a
commit b99f7dc8c4
2 changed files with 4 additions and 4 deletions

View File

@ -1863,11 +1863,11 @@ abstract class Merge
protected function prefix($prefix, $placeholder, $wrap = null)
{
$marker = ['', ''];
if($placeholder[0] == '{' && is_null($wrap) || $wrap[0] == '{')
if($placeholder && $placeholder[0] == '{' && is_null($wrap) || $wrap && $wrap[0] == '{')
{
$marker = ['{{', '}}'];
}
elseif($placeholder[0] == '$' && is_null($wrap) || $wrap[0] == '$')
elseif($placeholder && $placeholder[0] == '$' && is_null($wrap) || $wrap && $wrap[0] == '$')
{
$marker = ['$$', '$$'];
}
@ -2883,7 +2883,7 @@ abstract class Merge
);
// Check for a configured preferred directory
if(!empty($pref = $GLOBALS['egw_info']['user']['preferences'][$this->get_app()][Merge::PREF_STORE_LOCATION]) && Vfs::is_writable($pref))
if(!empty($pref = $GLOBALS['egw_info']['user']['preferences'][$this->get_app()][Merge::PREF_STORE_LOCATION] ?? false) && Vfs::is_writable($pref))
{
$target = $pref;
}

View File

@ -1900,7 +1900,7 @@ class Vfs extends Vfs\Base
$start = '/home/'.$GLOBALS['egw_info']['user']['account_lid'];
// check if user specified a valid startpath in his prefs --> use it
if (($path = $GLOBALS['egw_info']['user']['preferences']['filemanager']['startfolder']) &&
if(($path = $GLOBALS['egw_info']['user']['preferences']['filemanager']['startfolder'] ?? '') &&
$path[0] == '/' && self::is_dir($path) && self::check_access($path, self::READABLE))
{
$start = $path;