fix some php8 fatal errors

(cherry picked from commit 2522d42c71)
This commit is contained in:
Mario
2021-01-09 19:22:47 +00:00
parent 39c5e85564
commit fa41527f85
6 changed files with 17 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ define ( 'NWIKI_ITEM_RESOURCE_TYPE', 'nwiki' );
class NativeWiki {
static public function listwikis($channel, $observer_hash) {
public static function listwikis($channel, $observer_hash) {
$sql_extra = item_permissions_sql($channel['channel_id'], $observer_hash);
$wikis = q("SELECT * FROM item
@@ -40,7 +40,7 @@ class NativeWiki {
}
function create_wiki($channel, $observer_hash, $wiki, $acl) {
public static function create_wiki($channel, $observer_hash, $wiki, $acl) {
$resource_id = new_uuid();
$uuid = new_uuid();
@@ -101,7 +101,7 @@ class NativeWiki {
}
}
function update_wiki($channel_id, $observer_hash, $arr, $acl) {
public static function update_wiki($channel_id, $observer_hash, $arr, $acl) {
$w = self::get_wiki($channel_id, $observer_hash, $arr['resource_id']);
$item = $w['wiki'];
@@ -156,7 +156,7 @@ class NativeWiki {
}
}
static public function sync_a_wiki_item($uid,$id,$resource_id) {
public static function sync_a_wiki_item($uid,$id,$resource_id) {
$r = q("SELECT * from item WHERE uid = %d AND ( id = %d OR ( resource_type = '%s' and resource_id = '%s' )) ",
@@ -185,7 +185,7 @@ class NativeWiki {
}
}
function delete_wiki($channel_id,$observer_hash,$resource_id) {
public static function delete_wiki($channel_id,$observer_hash,$resource_id) {
$w = self::get_wiki($channel_id,$observer_hash,$resource_id);
$item = $w['wiki'];
@@ -202,7 +202,7 @@ class NativeWiki {
}
static public function get_wiki($channel_id, $observer_hash, $resource_id) {
public static function get_wiki($channel_id, $observer_hash, $resource_id) {
$sql_extra = item_permissions_sql($channel_id,$observer_hash);
@@ -236,7 +236,7 @@ class NativeWiki {
}
static public function exists_by_name($uid, $urlName) {
public static function exists_by_name($uid, $urlName) {
$sql_extra = item_permissions_sql($uid);
@@ -258,7 +258,7 @@ class NativeWiki {
}
static public function get_permissions($resource_id, $owner_id, $observer_hash) {
public static function get_permissions($resource_id, $owner_id, $observer_hash) {
// TODO: For now, only the owner can edit
$sql_extra = item_permissions_sql($owner_id, $observer_hash);

View File

@@ -123,7 +123,7 @@ class Sse_bs extends Controller {
$mids[] = '\'' . dbesc(@base64url_decode(substr($a,4))) . '\'';
}
$str = implode($mids, ',');
$str = implode(',', $mids);
$x = [ 'channel_id' => self::$uid, 'update' => 'unset' ];
call_hooks('update_unseen',$x);

View File

@@ -82,11 +82,11 @@ define ( 'DIRECTORY_MODE_STANDALONE', 0x0100); // A detached (off the grid) hub
define ( 'DIRECTORY_REALM', 'RED_GLOBAL');
define ( 'DIRECTORY_FALLBACK_MASTER', 'https://hub.netzgemeinde.eu');
$DIRECTORY_FALLBACK_SERVERS = array(
$DIRECTORY_FALLBACK_SERVERS = [
'https://hub.netzgemeinde.eu',
'https://zotsite.net',
'https://hub.libranet.de'
);
];
/**
@@ -2017,7 +2017,7 @@ function proc_run(){
}
$args = array_map('escapeshellarg',$args);
$cmdline = implode($args," ");
$cmdline = implode(' ', $args);
if(is_windows()) {
$cwd = getcwd();

View File

@@ -299,7 +299,7 @@ function load_context_help() {
break;
array_pop($args);
$path = implode($args,'/');
$path = implode('/', $args);
}
return $context_help;

View File

@@ -40,7 +40,7 @@ function breaklines($line, $level, $wraplength = 75)
$newlines[] = $line;
return(implode($newlines, "\n"));
return(implode("\n", $newlines));
}
function quotelevel($message, $wraplength = 75)
@@ -73,7 +73,7 @@ function quotelevel($message, $wraplength = 75)
if (!$startquote or ($line != ''))
$newlines[] = breaklines($line, $currlevel, $wraplength);
}
return(implode($newlines, "\n"));
return(implode("\n", $newlines));
}
function collecturls($message) {

View File

@@ -110,7 +110,7 @@ class ASNValue
function SetIntBuffer($Value)
{
if (strlen($Value) > 1) {
$firstByte = ord($Value{0});
$firstByte = ord($Value[0]);
if ($firstByte & 0x80) { //first bit set
$Value = chr(0x00) . $Value;
}
@@ -122,7 +122,7 @@ class ASNValue
function GetIntBuffer()
{
$result = $this->Value;
if (ord($result{0}) == 0x00) {
if (ord($result[0]) == 0x00) {
$result = substr($result, 1);
}