aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-03-31 13:41:29 -0400
committerAndrew Manning <tamanning@zoho.com>2018-03-31 13:41:29 -0400
commit6decffb00c00fabcb4ef581084eaca038e340686 (patch)
tree34471f015e0b33007ad40059dfdd09c83a768fbb /Zotlabs/Module
parent1dc795722a8e748ebb98e8fab778cd4686a0654f (diff)
parent6433ce70a19be8c57edbc72f8df3a4c7ef52f389 (diff)
downloadvolse-hubzilla-6decffb00c00fabcb4ef581084eaca038e340686.tar.gz
volse-hubzilla-6decffb00c00fabcb4ef581084eaca038e340686.tar.bz2
volse-hubzilla-6decffb00c00fabcb4ef581084eaca038e340686.zip
Merge branch 'dev' into oauth2
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Acl.php2
-rw-r--r--Zotlabs/Module/Connedit.php6
-rw-r--r--Zotlabs/Module/Directory.php4
-rw-r--r--Zotlabs/Module/Display.php10
-rw-r--r--Zotlabs/Module/Hashtags.php2
-rw-r--r--Zotlabs/Module/Mail.php4
-rw-r--r--Zotlabs/Module/Rpost.php4
-rw-r--r--Zotlabs/Module/Tagger.php13
-rw-r--r--Zotlabs/Module/Uexport.php4
-rw-r--r--Zotlabs/Module/Wiki.php4
10 files changed, 34 insertions, 19 deletions
diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php
index 245b0a9b7..ef901aef1 100644
--- a/Zotlabs/Module/Acl.php
+++ b/Zotlabs/Module/Acl.php
@@ -95,7 +95,7 @@ class Acl extends \Zotlabs\Web\Controller {
. "' IN xchan_name) else position('" . protect_sprintf(dbesc(punify($search))) . "' IN xchan_addr) end, ";
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
- $sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
+ $sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc(($col === 'xchan_addr') ? punify($search) : $search) . "%'" ) . " ";
}
else {
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index f359175c1..cb9c19cf0 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -828,7 +828,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$locstr = locations_by_netid($contact['xchan_hash']);
if(! $locstr)
- $locstr = $contact['xchan_url'];
+ $locstr = unpunify($contact['xchan_url']);
$clone_warn = '';
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
@@ -852,8 +852,8 @@ class Connedit extends \Zotlabs\Web\Controller {
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
- '$addr' => $contact['xchan_addr'],
- '$primeurl' => $contact['xchan_url'],
+ '$addr' => unpunify($contact['xchan_addr']),
+ '$primeurl' => unpunify($contact['xchan_url']),
'$section' => $section,
'$sections' => $sections,
'$vcard' => $vcard,
diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php
index 62a1670f9..87387ef56 100644
--- a/Zotlabs/Module/Directory.php
+++ b/Zotlabs/Module/Directory.php
@@ -299,9 +299,9 @@ class Directory extends \Zotlabs\Web\Controller {
if(strlen($out))
$out .= ', ';
if($marr && in_arrayi($k,$marr))
- $out .= '<strong>' . $k . '</strong>';
+ $out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'"><strong>' . $k . '</strong></a>';
else
- $out .= $k;
+ $out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'">' . $k . '</a>';
}
}
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index fa29ce66c..d3047bc59 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -102,7 +102,7 @@ class Display extends \Zotlabs\Web\Controller {
if($decoded)
$item_hash = $decoded;
- $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid like '%s' limit 1",
+ $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, author_xchan, item_blocked from item where mid like '%s' limit 1",
dbesc($item_hash . '%')
);
@@ -110,6 +110,13 @@ class Display extends \Zotlabs\Web\Controller {
$target_item = $r[0];
}
+ $x = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($target_item['author_xchan'])
+ );
+ if($x) {
+ \App::$poi = $x[0];
+ }
+
//if the item is to be moderated redirect to /moderate
if($target_item['item_blocked'] == ITEM_MODERATED) {
goaway(z_root() . '/moderate/' . $target_item['id']);
@@ -169,6 +176,7 @@ class Display extends \Zotlabs\Web\Controller {
}
}
+
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
diff --git a/Zotlabs/Module/Hashtags.php b/Zotlabs/Module/Hashtags.php
index edb631871..300485196 100644
--- a/Zotlabs/Module/Hashtags.php
+++ b/Zotlabs/Module/Hashtags.php
@@ -18,7 +18,7 @@ class Hashtags extends \Zotlabs\Web\Controller {
);
if($r) {
foreach($r as $rv) {
- $result[] = [ 'text' => strtolower($rv['term']) ];
+ $result[] = [ 'text' => $rv['term'] ];
}
}
diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php
index b58b169d0..ca183f644 100644
--- a/Zotlabs/Module/Mail.php
+++ b/Zotlabs/Module/Mail.php
@@ -67,14 +67,14 @@ class Mail extends \Zotlabs\Web\Controller {
if(! $recipient) {
$channel = \App::get_channel();
- $j = \Zotlabs\Zot\Finger::run($rstr,$channel);
+ $j = \Zotlabs\Zot\Finger::run(punify($rstr),$channel);
if(! $j['success']) {
notice( t('Unable to lookup recipient.') . EOL);
return;
}
- logger('message_post: lookup: ' . $url . ' ' . print_r($j,true));
+ logger('message_post: lookup: ' . $rstr . ' ' . print_r($j,true));
if(! $j['guid']) {
notice( t('Unable to communicate with requested channel.'));
diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php
index e6ea52845..f0c4a06b9 100644
--- a/Zotlabs/Module/Rpost.php
+++ b/Zotlabs/Module/Rpost.php
@@ -45,7 +45,9 @@ class Rpost extends \Zotlabs\Web\Controller {
$url = get_rpost_path(\App::get_observer());
// make sure we're not looping to our own hub
if(($url) && (! stristr($url, \App::get_hostname()))) {
- foreach($_REQUEST as $key => $arg) {
+ foreach($_GET as $key => $arg) {
+ if($key === 'q')
+ continue;
$url .= '&' . $key . '=' . $arg;
}
goaway($url);
diff --git a/Zotlabs/Module/Tagger.php b/Zotlabs/Module/Tagger.php
index 603a95f2b..24adf1bde 100644
--- a/Zotlabs/Module/Tagger.php
+++ b/Zotlabs/Module/Tagger.php
@@ -80,6 +80,8 @@ class Tagger extends \Zotlabs\Web\Controller {
break;
}
+
+ $clean_term = trim($term,'"\' ');
$links = array(array('rel' => 'alternate','type' => 'text/html',
'href' => z_root() . '/display/' . gen_link_id($item['mid'])));
@@ -103,15 +105,15 @@ class Tagger extends \Zotlabs\Web\Controller {
),
));
- $tagid = z_root() . '/search?tag=' . $term;
+ $tagid = z_root() . '/search?tag=' . $clean_term;
$objtype = ACTIVITY_OBJ_TAGTERM;
$obj = json_encode(array(
'type' => $objtype,
'id' => $tagid,
'link' => array(array('rel' => 'alternate','type' => 'text/html', 'href' => $tagid)),
- 'title' => $term,
- 'content' => $term
+ 'title' => $clean_term,
+ 'content' => $clean_term
));
$bodyverb = t('%1$s tagged %2$s\'s %3$s with %4$s');
@@ -119,7 +121,7 @@ class Tagger extends \Zotlabs\Web\Controller {
// saving here for reference
// also check out x22d5 and x2317 and x0d6b and x0db8 and x24d0 and xff20 !!!
- $termlink = html_entity_decode('&#x22d5;') . '[zrl=' . z_root() . '/search?tag=' . urlencode($term) . ']'. $term . '[/zrl]';
+ $termlink = html_entity_decode('&#x22d5;') . '[zrl=' . z_root() . '/search?tag=' . urlencode($clean_term) . ']'. $clean_term . '[/zrl]';
$channel = \App::get_channel();
@@ -143,8 +145,7 @@ class Tagger extends \Zotlabs\Web\Controller {
$arr['obj_type'] = $objtype;
$arr['obj'] = $obj;
$arr['parent_mid'] = $item['mid'];
-
- store_item_tag($item['uid'],$item['id'],TERM_OBJ_POST,TERM_COMMUNITYTAG,$term,$tagid);
+ store_item_tag($item['uid'],$item['id'],TERM_OBJ_POST,TERM_COMMUNITYTAG,$clean_term,$tagid);
$ret = post_activity_item($arr);
if($ret['success']) {
diff --git a/Zotlabs/Module/Uexport.php b/Zotlabs/Module/Uexport.php
index 28c840ceb..9af1887dc 100644
--- a/Zotlabs/Module/Uexport.php
+++ b/Zotlabs/Module/Uexport.php
@@ -22,8 +22,8 @@ class Uexport extends \Zotlabs\Web\Controller {
$month = intval(argv(2));
}
- header('content-type: application/octet_stream');
- header('content-disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . '.json"' );
+ header('content-type: application/json');
+ header('content-disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . (($_REQUEST['sections']) ? '-' . $_REQUEST['sections'] : '') . '.json"' );
if($year) {
echo json_encode(identity_export_year(local_channel(),$year,$month));
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index ae543eb98..696191f70 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -284,6 +284,8 @@ class Wiki extends \Zotlabs\Web\Controller {
$wikiheaderPage = urldecode($pageUrlName);
$renamePage = (($wikiheaderPage === 'Home') ? '' : t('Rename page'));
+ $sharePage = t('Share');
+
$p = [];
if(! $ignore_language) {
@@ -354,6 +356,8 @@ class Wiki extends \Zotlabs\Web\Controller {
'$wikiheaderName' => $wikiheaderName,
'$wikiheaderPage' => $wikiheaderPage,
'$renamePage' => $renamePage,
+ '$sharePage' => $sharePage,
+ '$shareLink' => urlencode('#^[zrl=' . z_root() . '/wiki/' . argv(1) . '/' . $wikiUrlName . '/' . $pageUrlName . ']' . '[ ' . $owner['channel_name'] . ' ] - ' . $wikiheaderName . ' - ' . $wikiheaderPage . '[/zrl]'),
'$showPageControls' => $showPageControls,
'$editOrSourceLabel' => (($showPageControls) ? t('Edit') : t('Source')),
'$tools_label' => 'Page Tools',