Fix PHP warnings for PHP 8 compatability

This commit is contained in:
nathangray 2021-05-21 10:43:09 -06:00 committed by Ralf Becker
parent 45d77b594d
commit 16278dd064
4 changed files with 16 additions and 13 deletions

View File

@ -2745,7 +2745,7 @@ class Contacts extends Contacts\Storage
header('Content-length: '.bytes($contact['jpegphoto'])); header('Content-length: '.bytes($contact['jpegphoto']));
echo $contact['jpegphoto']; echo $contact['jpegphoto'];
} }
else elseif ($url)
{ {
header('Content-length: '.$size); header('Content-length: '.$size);
readfile($url); readfile($url);

View File

@ -204,6 +204,7 @@ class File extends Etemplate\Widget
); );
} }
} }
return true;
} }
/** /**
@ -247,7 +248,7 @@ class File extends Etemplate\Widget
} }
fclose($fp); fclose($fp);
} else { } else {
_log('cannot create the destination file'); error_log(__METHOD__ . ' cannot create the destination file "'.$new_file.'"');
return false; return false;
} }
@ -307,7 +308,7 @@ class File extends Etemplate\Widget
if (!$this->is_readonly($cname, $form_name)) if (!$this->is_readonly($cname, $form_name))
{ {
$value = $value_in = self::get_array($content, $form_name); $value = self::get_array($content, $form_name);
$valid =& self::get_array($validated, $form_name, true); $valid =& self::get_array($validated, $form_name, true);
if(!is_array($value)) $value = array(); if(!is_array($value)) $value = array();
@ -317,7 +318,7 @@ class File extends Etemplate\Widget
foreach($value as $tmp => $file) foreach($value as $tmp => $file)
{ {
if(!$file) continue; if(!$file || !is_array($file)) continue;
if (is_dir($GLOBALS['egw_info']['server']['temp_dir']) && is_writable($GLOBALS['egw_info']['server']['temp_dir'])) if (is_dir($GLOBALS['egw_info']['server']['temp_dir']) && is_writable($GLOBALS['egw_info']['server']['temp_dir']))
{ {
$path = $GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmp; $path = $GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmp;

View File

@ -348,9 +348,11 @@ class Sharing
/** /**
* Get the namespaced class for the given share * Get the namespaced class for the given share
* *
* @param string $share * @param array $share
* @return string
* @throws Exception
*/ */
protected static function get_share_class($share) protected static function get_share_class(array $share)
{ {
try try
{ {
@ -698,7 +700,7 @@ class Sharing
* @param String $path * @param String $path
* @param boolean $writable Allow editing the shared entry / folder / file * @param boolean $writable Allow editing the shared entry / folder / file
* @param boolean $files For sharing an application entry, allow access to the linked files * @param boolean $files For sharing an application entry, allow access to the linked files
* @param $extra Additional extra parameters * @param array $extra Additional extra parameters
*/ */
public static function ajax_create($action, $path, $writable = false, $files = false, $extra = array()) public static function ajax_create($action, $path, $writable = false, $files = false, $extra = array())
{ {
@ -721,7 +723,7 @@ class Sharing
); );
// Store share in session so Merge can find this one and not create a read-only one // Store share in session so Merge can find this one and not create a read-only one
\EGroupware\Api\Cache::setSession(__CLASS__, $path, $share); Cache::setSession(__CLASS__, $path, $share);
$arr = array( $arr = array(
'action' => $action, 'action' => $action,
'writable' => $writable, 'writable' => $writable,
@ -745,7 +747,7 @@ class Sharing
/** /**
* Api\Storage\Base instance for egw_sharing table * Api\Storage\Base instance for egw_sharing table
* *
* @var Api\Storage\Base * @var Storage\Base
*/ */
protected static $so; protected static $so;
@ -884,7 +886,7 @@ class Sharing
* Check that the share path is still valid, and if not, delete it. * Check that the share path is still valid, and if not, delete it.
* This should be overridden. * This should be overridden.
* *
* @param Array share * @param array share
* *
* @return boolean Is the share still valid * @return boolean Is the share still valid
*/ */
@ -913,7 +915,7 @@ class Sharing
* *
* @param string $path * @param string $path
* *
* @throws WrongParameter if you try to share a path that needs a password * @throws Exception\WrongParameter if you try to share a path that needs a password
*/ */
public static function path_needs_password($path) public static function path_needs_password($path)
{ {

View File

@ -754,7 +754,7 @@ class TestSharing extends Api\Vfs\Sharing {
return $sessionid; return $sessionid;
} }
public static function get_share_class($share) public static function get_share_class(array $share)
{ {
return __CLASS__; return __CLASS__;
} }
@ -781,7 +781,7 @@ if(!class_exists('TestHiddenSharing'))
return $sessionid; return $sessionid;
} }
public static function get_share_class($share) public static function get_share_class(array $share)
{ {
return __CLASS__; return __CLASS__;
} }