This commit is contained in:
Mike Macgirvin 2022-08-15 20:33:19 +10:00
parent 683b3c13a7
commit aa33f6950c
11 changed files with 17 additions and 19 deletions

View file

@ -164,6 +164,6 @@ class AccessControl
*/
public function is_private()
{
return (($this->allow_cid || $this->allow_gid || $this->deny_cid || $this->deny_gid) ? true : false);
return $this->allow_cid || $this->allow_gid || $this->deny_cid || $this->deny_gid;
}
}

View file

@ -77,7 +77,7 @@ class PermissionLimits
*
* @param int $channel_id
* @param string $perm (optional)
* @return
* @return bool|int|array
* * \b false if no perm_limits set for this channel
* * \b int if $perm is set, return one of PERMS_* constants for this permission, default 0
* * \b array with all permission limits, if $perm is not set

View file

@ -18,7 +18,7 @@ class PermissionRoles
*
* This must match the version in Permissions.php before permission updates can run.
*
* @return number
* @return int
*/
public static function version()
{

View file

@ -23,6 +23,10 @@ class Receiver
protected $prvkey;
protected $rawdata;
protected $sigdata;
/**
* @var array|mixed
*/
private mixed $hub;
public function __construct($handler, $localdata = null)
{
@ -74,7 +78,7 @@ class Receiver
logger('received: ' . print_r($this->data, true), LOGGER_DATA);
if ($this->data && is_array($this->data)) {
$this->encrypted = ((array_key_exists('encrypted', $this->data) && intval($this->data['encrypted'])) ? true : false);
$this->encrypted = array_key_exists('encrypted', $this->data) && intval($this->data['encrypted']);
if ($this->encrypted && $this->prvkey) {
$uncrypted = Crypto::unencapsulate($this->data, $this->prvkey);

View file

@ -5,7 +5,6 @@ namespace Code\Render;
use App;
use Code\Lib\Infocon;
use Code\Lib\Addon;
use Code\Render\Theme;
use Code\Lib\Yaml;
@ -197,7 +196,7 @@ class Theme
try {
file_put_contents("view/theme/$theme.yml",Yaml::encode($info));
}
catch (Exception $e) {
catch (\Exception $e) {
}
}

View file

@ -1240,7 +1240,7 @@ class App {
*
* @param string $name Template engine name
*
* @return void Template Engine instance
* @return mixed
*/
public static function template_engine($name = '') {
if ($name !== '') {
@ -1994,7 +1994,7 @@ function is_site_admin() {
return true;
}
// the system channel is by definition an administrator
if (isset(App::$sys_channel) && array_key_exists('channel_id', App::$sys_channel) && intval(App::$sys_channel['channel_id']) === local_channel()) {
if (isset(App::$sys_channel) && is_array(App::$sys_channel) && array_key_exists('channel_id', (array) App::$sys_channel) && intval(App::$sys_channel['channel_id']) === local_channel()) {
return true;
}
}

View file

@ -125,7 +125,7 @@ function api_item_export_page($type)
}
$finish = datetime_convert(date_default_timezone_get(), 'UTC', (($_REQUEST['until']) ? $_REQUEST['until'] : 'now'));
json_return_and_die($Channel::export_items_page(api_user(), $start, $finish, $page, $records));
json_return_and_die(Channel::export_items_page(api_user(), $start, $finish, $page, $records));
}

View file

@ -692,9 +692,7 @@ function bb_ShareAttributes($match)
$headline .= '<span>' . $fmt . '</span></div>';
$text = $headline . '<div class="reshared-content">' . trim($match[2]) . '</div></div>';
return $text;
return $headline . '<div class="reshared-content">' . trim($match[2]) . '</div></div>';
}
function bb_location($match)
@ -1415,7 +1413,7 @@ function bbtopoll($s)
$pl['poll_id'] = $match[1];
$pl['poll_question'] = $match[2];
$match = '';
$match = [];
if (preg_match_all("/\[poll\-answer=(.*?)\](.*?)\[\/poll\-answer\]/is", $s, $match, PREG_SET_ORDER)) {
$pl['answer'] = [];
foreach ($match as $m) {

View file

@ -883,10 +883,7 @@ function vcard_query(&$r)
function contact_profile_assign($current)
{
$o = '';
$o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" class=\"form-control\"/>\r\n";
$o = "<select id=\"contact-profile-selector\" name=\"profile_assign\" class=\"form-control\"/>\r\n";
$r = q(
"SELECT profile_guid, profile_name FROM profile WHERE uid = %d",

View file

@ -550,7 +550,7 @@ function z_birthday($dob, $tz, $format = "Y-m-d H:i:s")
$t_dob = strtotime($bd);
$now = strtotime(datetime_convert($tz, $tz, 'now'));
if ($t_dob < $now) {
$bd = $y + 1 . '-' . $tmp_dob . ' 00:00';
$bd = sprintf("%d-%s 00:00", intval($y) + 1, $tmp_dob);
}
$birthday = datetime_convert($tz, 'UTC', $bd, $format);

View file

@ -202,7 +202,7 @@ function load_translation_table($lang, $install = false)
*
* @param string $s string that should get translated
* @param string $ctx (optional) context to appear in po file
* @return translated string if exists, otherwise return $s
* @return string (translated string if exists, otherwise return $s)
*
*/
function t($s, $ctx = '')