aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-03 19:38:15 -0800
committerfriendica <info@friendica.com>2014-02-03 19:38:15 -0800
commit876f5d4de09f6215c3e65146460027d0dd244bc8 (patch)
tree2287b38af784719957788c01438d4c2ea8f0f197 /mod/item.php
parentc4d088459634d8148620a27c56ba06b33814668f (diff)
downloadvolse-hubzilla-876f5d4de09f6215c3e65146460027d0dd244bc8.tar.gz
volse-hubzilla-876f5d4de09f6215c3e65146460027d0dd244bc8.tar.bz2
volse-hubzilla-876f5d4de09f6215c3e65146460027d0dd244bc8.zip
transmit, receive, and parse bookmarks
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/mod/item.php b/mod/item.php
index 6d421009b..88bf46a9f 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -887,13 +887,24 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
$replaced = false;
$r = null;
- $termtype = ((strpos($tag,'#') === 0) ? TERM_HASHTAG : TERM_UNKNOWN);
- $termtype = ((strpos($tag,'@') === 0) ? TERM_MENTION : $termtype);
+
+ $termtype = ((strpos($tag,'#') === 0) ? TERM_HASHTAG : TERM_UNKNOWN);
+ $termtype = ((strpos($tag,'@') === 0) ? TERM_MENTION : $termtype);
+ $termtype = ((strpos($tag,'#^[') === 0) ? TERM_BOOKMARK : $termtype);
+
//is it a hash tag?
if(strpos($tag,'#') === 0) {
- // if the tag is replaced...
- if(strpos($tag,'[zrl=')) {
+ if(strpos($tag,'#^[') === 0) {
+ if(preg_match('/#\^\[(url|zrl)=(.*?)\](.*?)\[\/(url|zrl)\]/',$tag,$match)) {
+ $basetag = $match[3];
+ $url = $match[2];
+ $replaced = true;
+
+ }
+ }
+ // if the tag is already replaced...
+ elseif(strpos($tag,'[zrl=')) {
//...do nothing
return $replaced;
}
@@ -904,7 +915,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
$body = str_replace($tag,$newtag,$body);
$replaced = true;
}
- else {
+ if(! $replaced) {
//base tag has the tags name only
$basetag = str_replace('_',' ',substr($tag,1));
//create text for link