diff options
author | friendica <info@friendica.com> | 2014-02-03 19:38:15 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-02-03 19:38:15 -0800 |
commit | 876f5d4de09f6215c3e65146460027d0dd244bc8 (patch) | |
tree | 2287b38af784719957788c01438d4c2ea8f0f197 /include/text.php | |
parent | c4d088459634d8148620a27c56ba06b33814668f (diff) | |
download | volse-hubzilla-876f5d4de09f6215c3e65146460027d0dd244bc8.tar.gz volse-hubzilla-876f5d4de09f6215c3e65146460027d0dd244bc8.tar.bz2 volse-hubzilla-876f5d4de09f6215c3e65146460027d0dd244bc8.zip |
transmit, receive, and parse bookmarks
Diffstat (limited to 'include/text.php')
-rwxr-xr-x | include/text.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php index a72989147..37ce54f25 100755 --- a/include/text.php +++ b/include/text.php @@ -593,7 +593,7 @@ function get_tags($s) { if(substr($mtch,-1,1) === '.') $mtch = substr($mtch,0,-1); // ignore strictly numeric tags like #1 - if((strpos($mtch,'#') === 0) && ctype_digit(substr($mtch,1))) + if((strpos($mtch,'#') === 0) && ( ctype_digit(substr($mtch,1)) || substr($mtch,1,1) === '^')) continue; // try not to catch url fragments if(strpos($s,$mtch) && preg_match('/[a-zA-z0-9\/]/',substr($s,strpos($s,$mtch)-1,1))) @@ -601,6 +601,18 @@ function get_tags($s) { $ret[] = $mtch; } } + + // bookmarks + + if(preg_match_all('/#\^\[(url|zrl)=(.*?)\](.*?)\[\/(url|zrl)\]/',$s,$match,PREG_SET_ORDER)) { + foreach($match as $mtch) { + $ret[] = $mtch[0]; + } + } + + + // logger('get_tags: ' . print_r($ret,true)); + return $ret; } |