aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Scrape.php2
-rw-r--r--include/bbcode.php6
-rw-r--r--include/items.php34
3 files changed, 33 insertions, 9 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index 8478ea407..e4f7a0878 100644
--- a/include/Scrape.php
+++ b/include/Scrape.php
@@ -161,6 +161,8 @@ function scrape_feed($url) {
$x = $item->getAttribute('rel');
if(($x === 'alternate') && ($item->getAttribute('type') === 'application/atom+xml'))
$ret['feed_atom'] = $item->getAttribute('href');
+ if(($x === 'alternate') && ($item->getAttribute('type') === 'application/rss+xml'))
+ $ret['feed_rss'] = $item->getAttribute('href');
}
return $ret;
diff --git a/include/bbcode.php b/include/bbcode.php
index 9e5f5a371..8382cc804 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -22,10 +22,10 @@ function bbcode($Text) {
// Perform URL Search
- $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]+)/", ' <a href="$2" >$2</a>', $Text);
+ $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]+)/", ' <a href="$2" target="external-link">$2</a>', $Text);
- $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" >$1</a>', $Text);
- $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" >$2</a>', $Text);
+ $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" target="external-link">$1</a>', $Text);
+ $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" target="external-link">$2</a>', $Text);
//$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
diff --git a/include/items.php b/include/items.php
index 5f8264beb..e238280fc 100644
--- a/include/items.php
+++ b/include/items.php
@@ -423,19 +423,29 @@ function get_atom_elements($feed,$item) {
else
$res['private'] = 0;
- $rawcreated = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'published');
- if($rawcreated)
- $res['created'] = unxmlify($rawcreated[0]['data']);
$rawlocation = $item->get_item_tags(NAMESPACE_DFRN, 'location');
if($rawlocation)
$res['location'] = unxmlify($rawlocation[0]['data']);
+ $rawcreated = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'published');
+ if($rawcreated)
+ $res['created'] = unxmlify($rawcreated[0]['data']);
+
+
$rawedited = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'updated');
if($rawedited)
$res['edited'] = unxmlify($rawcreated[0]['data']);
+
+ if(! $res['created'])
+ $res['created'] = $item->get_date();
+
+ if(! $res['edited'])
+ $res['edited'] = $item->get_date();
+
+
$rawowner = $item->get_item_tags(NAMESPACE_DFRN, 'owner');
if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])
$res['owner-name'] = unxmlify($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']);
@@ -746,7 +756,7 @@ function get_item_contact($item,$contacts) {
}
-function dfrn_deliver($owner,$contact,$atom) {
+function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
$a = get_app();
@@ -817,6 +827,8 @@ function dfrn_deliver($owner,$contact,$atom) {
$postvars['dfrn_id'] = $idtosend;
$postvars['dfrn_version'] = DFRN_PROTOCOL_VERSION;
+ if($dissolve)
+ $postvars['dissolve'] = '1';
if(($contact['rel']) && ($contact['rel'] != REL_FAN) && (! $contact['blocked']) && (! $contact['readonly'])) {
$postvars['data'] = $atom;
@@ -828,7 +840,7 @@ function dfrn_deliver($owner,$contact,$atom) {
$postvars['data'] = str_replace('<dfrn:comment-allow>1','<dfrn:comment-allow>0',$atom);
}
- if($rino && $rino_allowed) {
+ if($rino && $rino_allowed && (! $dissolve)) {
$key = substr(random_string(),0,16);
$data = bin2hex(aes_encrypt($postvars['data'],$key));
$postvars['data'] = $data;
@@ -1145,6 +1157,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) {
continue;
}
$datarray = get_atom_elements($feed,$item);
+
if($contact['network'] === 'stat') {
if(strlen($datarray['title']))
unset($datarray['title']);
@@ -1155,6 +1168,11 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) {
);
$datarray['last-child'] = 1;
}
+
+ if(($contact['network'] === 'feed') || (! strlen($contact['notify']))) {
+ // one way feed - no remote comment ability
+ $datarray['last-child'] = 0;
+ }
$datarray['parent-uri'] = $parent_uri;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
@@ -1207,6 +1225,11 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) {
$datarray['last-child'] = 1;
}
+ if(($contact['network'] === 'feed') || (! strlen($contact['notify']))) {
+ // one way feed - no remote comment ability
+ $datarray['last-child'] = 0;
+ }
+
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
@@ -1216,7 +1239,6 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) {
}
}
}
-
}
function new_follower($importer,$contact,$datarray,$item) {