aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/attach.php8
-rw-r--r--include/bbcode.php2
-rw-r--r--include/channel.php3
-rw-r--r--include/connections.php17
-rw-r--r--include/nav.php69
-rw-r--r--include/text.php4
6 files changed, 48 insertions, 55 deletions
diff --git a/include/attach.php b/include/attach.php
index 09d4005e8..56fb936e7 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -658,8 +658,12 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$def_extension = '';
$is_photo = 0;
- $gis = @getimagesize($src);
- logger('getimagesize: ' . print_r($gis,true), LOGGER_DATA);
+
+ if ($src) {
+ $gis = @getimagesize($src);
+ logger('getimagesize: ' . print_r($gis,true), LOGGER_DATA);
+ }
+
if(($gis) && ($gis[2] === IMAGETYPE_GIF || $gis[2] === IMAGETYPE_JPEG || $gis[2] === IMAGETYPE_PNG || $gis[2] === IMAGETYPE_WEBP)) {
$is_photo = 1;
if($gis[2] === IMAGETYPE_GIF)
diff --git a/include/bbcode.php b/include/bbcode.php
index 87a7e6af6..25615e385 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -308,7 +308,7 @@ function bb_parse_app($match) {
$app = Zotlabs\Lib\Apps::app_decode($match[1]);
if ($app)
- return Zotlabs\Lib\Apps::app_render($app);
+ return preg_replace('/[[:cntrl:]]/', '', Zotlabs\Lib\Apps::app_render($app, 'inline'));
}
function bb_svg($match) {
diff --git a/include/channel.php b/include/channel.php
index 5917af6aa..3ee2742b8 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -2796,7 +2796,6 @@ function channel_remove($channel_id, $local = true, $unset_session = false) {
q("DELETE FROM pgrp WHERE uid = %d", intval($channel_id));
q("DELETE FROM pgrp_member WHERE uid = %d", intval($channel_id));
q("DELETE FROM event WHERE uid = %d", intval($channel_id));
- q("DELETE FROM mail WHERE channel_id = %d", intval($channel_id));
q("DELETE FROM menu WHERE menu_channel_id = %d", intval($channel_id));
q("DELETE FROM menu_item WHERE mitem_channel_id = %d", intval($channel_id));
@@ -2956,7 +2955,7 @@ function anon_identity_init($reqvars) {
}
if(! validate_email($anon_email)) {
- logger('enonymous email not valid');
+ logger('anonymous email not valid');
return false;
}
diff --git a/include/connections.php b/include/connections.php
index a1b27e301..59020051c 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -294,21 +294,15 @@ function remove_all_xchan_resources($xchan, $channel_id = 0) {
drop_item($rr,false);
}
}
+
$r = q("delete from event where event_xchan = '%s'",
dbesc($xchan)
);
+
$r = q("delete from pgrp_member where xchan = '%s'",
dbesc($xchan)
);
- // Cannot delete just one side of the conversation since we do not allow
- // you to block private mail replies. This would leave open a gateway for abuse.
- // Both participants are owners of the conversation and both can remove it.
-
- $r = q("delete from mail where ( from_xchan = '%s' or to_xchan = '%s' )",
- dbesc($xchan),
- dbesc($xchan)
- );
$r = q("delete from xlink where ( xlink_xchan = '%s' or xlink_link = '%s' )",
dbesc($xchan),
dbesc($xchan)
@@ -318,7 +312,6 @@ function remove_all_xchan_resources($xchan, $channel_id = 0) {
dbesc($xchan)
);
-
if($dirmode === false || $dirmode == DIRECTORY_MODE_NORMAL) {
$r = q("delete from xchan where xchan_hash = '%s'",
@@ -440,12 +433,6 @@ function contact_remove($channel_id, $abook_id) {
intval($channel_id)
);
- $r = q("delete from mail where ( from_xchan = '%s' or to_xchan = '%s' ) and channel_id = %d ",
- dbesc($abook['abook_xchan']),
- dbesc($abook['abook_xchan']),
- intval($channel_id)
- );
-
$r = q("delete from abconfig where chan = %d and xchan = '%s'",
intval($channel_id),
dbesc($abook['abook_xchan'])
diff --git a/include/nav.php b/include/nav.php
index 994f7e0c0..0e75cd59f 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -18,14 +18,11 @@ function nav($template = 'default') {
App::$page['htmlhead'] = App::$page['htmlhead'] ?? '';
App::$page['htmlhead'] .= '<script>$(document).ready(function() { $("#nav-search-text").search_autocomplete(\'' . z_root() . '/acl' . '\');});</script>';
$is_owner = (((local_channel()) && ((App::$profile_uid == local_channel()) || (App::$profile_uid == 0))) ? true : false);
- $observer = [];
- $sitelocation = '';
+ $observer = App::get_observer();
if (local_channel()) {
- $channel = App::get_channel();
- $observer = App::get_observer();
-
- $prof = q("select id from profile where uid = %d and is_default = 1",
+ $channel = App::get_channel();
+ $prof = q("select id from profile where uid = %d and is_default = 1",
intval($channel['channel_id'])
);
@@ -34,10 +31,10 @@ function nav($template = 'default') {
intval(get_account_id())
);
}
+
$sitelocation = (($is_owner) ? '' : App::$profile['reddress']);
}
- elseif (remote_channel()) {
- $observer = App::get_observer();
+ else {
$sitelocation = ((App::$profile['reddress']) ? App::$profile['reddress'] : '@' . App::get_hostname());
}
@@ -47,9 +44,9 @@ function nav($template = 'default') {
$navbar_apps = [];
$channel_apps = [];
- if (isset(App::$profile['channel_address']))
+ if (isset(App::$profile['channel_address'])) {
$channel_apps[] = channel_apps($is_owner, App::$profile['channel_address']);
-
+ }
/**
*
@@ -98,7 +95,7 @@ function nav($template = 'default') {
if (local_channel()) {
if (empty($_SESSION['delegate'])) {
- $nav['manage'] = ['manage', t('Channel Manager'), "", t('Manage your channels'), 'manage_nav_btn'];
+ $nav['manage'] = ['manage', t('Channels'), "", t('Manage your channels'), 'manage_nav_btn'];
}
if (Apps::system_app_installed(local_channel(), 'Privacy Groups'))
$nav['group'] = ['group', t('Privacy Groups'), "", t('Manage your privacy groups'), 'group_nav_btn'];
@@ -164,8 +161,9 @@ function nav($template = 'default') {
];
}
- if (((get_config('system', 'register_policy') == REGISTER_OPEN) || (get_config('system', 'register_policy') == REGISTER_APPROVE)) && (empty($_SESSION['authenticated'])))
+ if ((get_config('system', 'register_policy') == REGISTER_OPEN || get_config('system', 'register_policy') == REGISTER_APPROVE) && empty($_SESSION['authenticated'])) {
$nav['register'] = ['register', t('Register'), "", t('Create an account'), 'register_nav_btn'];
+ }
if (!get_config('system', 'hide_help')) {
$help_url = z_root() . '/help?f=&cmd=' . App::$cmd;
@@ -204,10 +202,6 @@ function nav($template = 'default') {
call_hooks('nav', $x);
- // Not sure the best place to put this on the page. So I'm implementing it but leaving it
- // turned off until somebody discovers this and figures out a good location for it.
- $powered_by = '';
-
$url = '';
$settings_url = '';
@@ -253,6 +247,7 @@ function nav($template = 'default') {
$pinned_list[] = Apps::app_encode($li);
}
}
+
Apps::translate_system_apps($pinned_list);
usort($pinned_list, 'Zotlabs\\Lib\\Apps::app_name_compare');
@@ -266,6 +261,7 @@ function nav($template = 'default') {
$syslist[] = Apps::app_encode($li);
}
}
+
Apps::translate_system_apps($syslist);
}
@@ -293,12 +289,13 @@ function nav($template = 'default') {
if ($syslist) {
foreach ($syslist as $app) {
- if (isset(App::$nav_sel['name']) && App::$nav_sel['name'] == $app['name'])
+ if (isset(App::$nav_sel['name']) && App::$nav_sel['name'] == $app['name']) {
$app['active'] = true;
+ }
if ($is_owner) {
$nav_apps[] = Apps::app_render($app, 'nav');
}
- elseif (!$is_owner && (!isset($app['requires']) || (isset($app['requires']) && strpos($app['requires'], 'local_channel') === false))) {
+ elseif (!isset($app['requires']) || (isset($app['requires']) && strpos($app['requires'], 'local_channel') === false)) {
$nav_apps[] = Apps::app_render($app, 'nav');
}
}
@@ -326,19 +323,23 @@ function nav($template = 'default') {
'$localuser' => local_channel(),
'$is_owner' => $is_owner,
'$sel' => App::$nav_sel,
- '$powered_by' => $powered_by,
- '$help' => t('@name, !forum, #tag, ?doc, content'),
+ '$help' => t('@name, #tag, ?doc, content'),
'$pleasewait' => t('Please wait...'),
'$nav_apps' => $nav_apps,
'$navbar_apps' => $navbar_apps,
'$channel_menu' => get_pconfig(App::$profile_uid, 'system', 'channel_menu', get_config('system', 'channel_menu')),
'$channel_thumb' => ((App::$profile) ? App::$profile['thumb'] : ''),
'$channel_apps' => $channel_apps,
- '$addapps' => t('Add Apps'),
- '$orderapps' => t('Arrange Apps'),
- '$sysapps_toggle' => t('Toggle System Apps'),
+ '$addapps' => t('Apps'),
+ '$channelapps' => t('Channel Apps'),
+ '$sysapps' => t('System Apps'),
+ '$pinned_apps' => t('Pinned Apps'),
+ '$featured_apps' => t('Featured Apps'),
'$url' => (($url) ? $url : z_root() . '/' . App::$cmd),
- '$settings_url' => $settings_url
+ '$settings_url' => $settings_url,
+ '$name' => ((!$is_owner) ? App::$profile['channel_name'] : ''),
+ '$thumb' => ((!$is_owner) ? App::$profile['thumb'] : ''),
+ '$form_security_token' => get_form_security_token('pconfig')
]);
if (x($_SESSION, 'reload_avatar') && $observer) {
@@ -368,29 +369,33 @@ function nav_set_selected($raw_name, $settings_url = '') {
App::$nav_sel['name'] = $item['name'];
- if ($settings_url)
+ if ($settings_url) {
App::$nav_sel['settings_url'] = z_root() . '/' . $settings_url;
+ }
}
function channel_apps($is_owner = false, $nickname = null) {
// Don't provide any channel apps if we're running as the sys channel
- if (App::$is_sys)
- return '';
+ if (App::$is_sys) {
+ return EMPTY_STR;
+ }
$channel = App::get_channel();
- if ($channel && is_null($nickname))
+ if ($channel && is_null($nickname)) {
$nickname = $channel['channel_address'];
+ }
$uid = ((isset(App::$profile['profile_uid'])) ? App::$profile['profile_uid'] : local_channel());
- if (!get_pconfig($uid, 'system', 'channelapps', '1'))
- return;
+ if (!get_pconfig($uid, 'system', 'channelapps', '1')) {
+ return EMPTY_STR;
+ }
if ($uid == local_channel()) {
- return;
+ return EMPTY_STR;
}
else {
$cal_link = '/cal/' . $nickname;
@@ -549,8 +554,6 @@ function channel_apps($is_owner = false, $nickname = null) {
return replace_macros(get_markup_template('profile_tabs.tpl'),
[
'$tabs' => $arr['tabs'],
- '$name' => App::$profile['channel_name'],
- '$thumb' => App::$profile['thumb'],
]
);
}
diff --git a/include/text.php b/include/text.php
index 841abdbd3..e0910f83e 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1610,7 +1610,7 @@ function format_hashtags(&$item) {
if($s)
$s .= ' ';
- $s .= '<span class="badge badge-pill badge-info"><i class="fa fa-hashtag"></i>&nbsp;<a class="text-white" href="' . zid($t['url']) . '" >' . $term . '</a></span>';
+ $s .= '<span class="badge rounded-pill bg-info"><i class="fa fa-hashtag"></i>&nbsp;<a class="text-white" href="' . zid($t['url']) . '" >' . $term . '</a></span>';
}
}
@@ -1633,7 +1633,7 @@ function format_mentions(&$item) {
continue;
if($s)
$s .= ' ';
- $s .= '<span class="badge badge-pill badge-success"><i class="fa fa-at"></i>&nbsp;<a class="text-white" href="' . zid($t['url']) . '" >' . $term . '</a></span>';
+ $s .= '<span class="badge rounded-pill bg-success"><i class="fa fa-at"></i>&nbsp;<a class="text-white" href="' . zid($t['url']) . '" >' . $term . '</a></span>';
}
}