aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2017-10-24 06:03:09 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2017-10-24 06:03:09 +0200
commitc99962106d6f9a65f01c2be4a9708d35dec7ca90 (patch)
treeb8c9439eaa107f03aae314146a21340e9e47d2b5 /include
parentf648809856b852d3819a8c1a0d624fd725ed8a34 (diff)
parente67ff5c122087f878111ad99d1c3b2328b967ab2 (diff)
downloadvolse-hubzilla-c99962106d6f9a65f01c2be4a9708d35dec7ca90.tar.gz
volse-hubzilla-c99962106d6f9a65f01c2be4a9708d35dec7ca90.tar.bz2
volse-hubzilla-c99962106d6f9a65f01c2be4a9708d35dec7ca90.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include')
-rw-r--r--include/contact_widgets.php8
-rw-r--r--include/features.php9
-rw-r--r--include/markdown.php11
-rw-r--r--include/network.php4
-rw-r--r--include/zot.php6
5 files changed, 30 insertions, 8 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index a13f87573..9cc9f0baf 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -65,6 +65,10 @@ function categories_widget($baseurl,$selected = '') {
if(! feature_enabled(App::$profile['profile_uid'],'categories'))
return '';
+ require_once('include/security.php');
+
+ $sql_extra = item_permissions_sql(App::$profile['profile_uid']);
+
$item_normal = item_normal();
$terms = array();
@@ -77,6 +81,7 @@ function categories_widget($baseurl,$selected = '') {
and item.owner_xchan = '%s'
and item.item_wall = 1
$item_normal
+ $sql_extra
order by term.term asc",
intval(App::$profile['profile_uid']),
intval(TERM_CATEGORY),
@@ -105,6 +110,8 @@ function cardcategories_widget($baseurl,$selected = '') {
if(! feature_enabled(App::$profile['profile_uid'],'categories'))
return '';
+ $sql_extra = item_permissions_sql(App::$profile['profile_uid']);
+
$item_normal = "and item.item_hidden = 0 and item.item_type = 6 and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
@@ -118,6 +125,7 @@ function cardcategories_widget($baseurl,$selected = '') {
and term.otype = %d
and item.owner_xchan = '%s'
$item_normal
+ $sql_extra
order by term.term asc",
intval(App::$profile['profile_uid']),
intval(TERM_CATEGORY),
diff --git a/include/features.php b/include/features.php
index f84c9cb05..d8d98dbaa 100644
--- a/include/features.php
+++ b/include/features.php
@@ -364,6 +364,15 @@ function get_features($filtered = true) {
t('Post/Comment Tools'),
[
+ 'markdown',
+ t('Markdown'),
+ t('Use markdown for editing posts'),
+ false,
+ get_config('feature_lock','markdown'),
+ feature_level('markdown',2),
+ ],
+
+ [
'commtag',
t('Community Tagging'),
t('Ability to tag existing posts'),
diff --git a/include/markdown.php b/include/markdown.php
index 0cd9ab237..0464cf71a 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -49,14 +49,17 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
$s = $x['text'];
- // Escaping the hash tags - doesn't always seem to work
- // $s = preg_replace('/\#([^\s\#])/','\\#$1',$s);
- // This seems to work
+ // Escaping the hash tags
$s = preg_replace('/\#([^\s\#])/','&#35;$1',$s);
$s = MarkdownExtra::defaultTransform($s);
- $s = str_replace("\r","",$s);
+ if($options && $options['preserve_lf']) {
+ $s = str_replace(["\r","\n"],["",'<br>'],$s);
+ }
+ else {
+ $s = str_replace("\r","",$s);
+ }
$s = str_replace('&#35;','#',$s);
diff --git a/include/network.php b/include/network.php
index 7e2dbf4cf..2f29a70c4 100644
--- a/include/network.php
+++ b/include/network.php
@@ -716,6 +716,10 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
$scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]);
else
$scaled = $mtch[3];
+
+ if(! strpbrk(substr($scaled,0,1),'zhfmt'))
+ continue;
+
$i = z_fetch_url($scaled,true);
diff --git a/include/zot.php b/include/zot.php
index 55632fc31..dad30dbb0 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -361,8 +361,6 @@ function zot_refresh($them, $channel = null, $force = false) {
else
$permissions = $j['permissions'];
- $connected_set = false;
-
if($permissions && is_array($permissions)) {
$old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream');
@@ -4177,7 +4175,7 @@ function zotinfo($arr) {
if($ztarget_hash) {
$permissions['connected'] = false;
- $b = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
+ $b = q("select * from abook where abook_xchan = '%s' and abook_channel = %d and abook_pending = 0 limit 1",
dbesc($ztarget_hash),
intval($e['channel_id'])
);
@@ -4201,7 +4199,7 @@ function zotinfo($arr) {
if($x)
$ret['locations'] = $x;
- $ret['site'] = zot_site_info($e['xchan_pubkey']);
+ $ret['site'] = zot_site_info($e['channel_prvkey']);
check_zotinfo($e,$x,$ret);