aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2021-02-02 10:58:10 +0100
committerMario Vavti <mario@mariovavti.com>2021-02-02 10:58:10 +0100
commitf3f49cf80f2441d576d825f116afdb5a66bb7c54 (patch)
tree220f72c418ab07b971de85d431ccb15c671b13e8 /include
parent8b78e18fb8ade1d04dbf2e5152288f6982a462df (diff)
downloadvolse-hubzilla-f3f49cf80f2441d576d825f116afdb5a66bb7c54.tar.gz
volse-hubzilla-f3f49cf80f2441d576d825f116afdb5a66bb7c54.tar.bz2
volse-hubzilla-f3f49cf80f2441d576d825f116afdb5a66bb7c54.zip
fix php8 issues
Diffstat (limited to 'include')
-rw-r--r--include/markdown.php9
-rw-r--r--include/permissions.php2
-rw-r--r--include/plugin.php2
3 files changed, 8 insertions, 5 deletions
diff --git a/include/markdown.php b/include/markdown.php
index 0bfe595b8..013d57c29 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -213,6 +213,11 @@ function bb_to_markdown_share($match) {
}
+function bb_to_markdown_transform_tags($match) {
+ return '#'. str_replace(' ', '_', $match[3]);
+}
+
+
/**
* @brief Convert bbcode to Markdown.
*
@@ -226,8 +231,7 @@ function bb_to_markdown($Text, $options = []) {
* Transform #tags, strip off the [url] and replace spaces with underscore
*/
- $Text = preg_replace_callback('/#\[([zu])rl\=(.*?)\](.*?)\[\/[(zu)]rl\]/i',
- create_function('$match', 'return \'#\'. str_replace(\' \', \'_\', $match[3]);'), $Text);
+ $Text = preg_replace_callback('/#\[([zu])rl\=(.*?)\](.*?)\[\/[(zu)]rl\]/i', 'bb_to_markdown_transform_tags', $Text);
$Text = preg_replace('/#\^\[([zu])rl\=(.*?)\](.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text);
@@ -282,7 +286,6 @@ function bb_to_markdown($Text, $options = []) {
return $Text;
}
-
/**
* @brief Convert a HTML text into Markdown.
*
diff --git a/include/permissions.php b/include/permissions.php
index ca8ff6e93..c7eee11f4 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -279,7 +279,7 @@ function perm_is_allowed($uid, $observer_xchan, $permission, $check_siteblock =
// First find out what the channel owner declared permissions to be.
- $channel_perm = \Zotlabs\Access\PermissionLimits::Get($uid,$permission);
+ $channel_perm = intval(\Zotlabs\Access\PermissionLimits::Get($uid,$permission));
$r = q("select channel_pageflags, channel_moved, channel_hash from channel where channel_id = %d limit 1",
intval($uid)
diff --git a/include/plugin.php b/include/plugin.php
index c789ad522..269903373 100644
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -912,7 +912,7 @@ function script_path() {
// Some proxy setups may require using http_host
- if(intval(App::$config['system']['script_path_use_http_host']))
+ if(isset(App::$config['system']['script_path_use_http_host']) && intval(App::$config['system']['script_path_use_http_host']))
$server_var = 'HTTP_HOST';
else
$server_var = 'SERVER_NAME';