aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-12 19:22:07 -0800
committerfriendica <info@friendica.com>2015-02-12 19:22:07 -0800
commit4b513d3322e03ed59e796ca60d09ee1d26cc50fb (patch)
treeb2fa745182d559be3f458d6e05da356a7f37df99 /include/text.php
parent084ca3f4a16084068a0ab04af651770142324f3a (diff)
downloadvolse-hubzilla-4b513d3322e03ed59e796ca60d09ee1d26cc50fb.tar.gz
volse-hubzilla-4b513d3322e03ed59e796ca60d09ee1d26cc50fb.tar.bz2
volse-hubzilla-4b513d3322e03ed59e796ca60d09ee1d26cc50fb.zip
issue #896
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index 3d4e9cd01..c93bc4e70 100644
--- a/include/text.php
+++ b/include/text.php
@@ -625,7 +625,8 @@ function get_tags($s) {
// The lookbehind is used to prevent a match in the middle of a word
// '=' needs to be avoided because when the replacement is made (in handle_tag()) it has to be ignored there
// Feel free to allow '=' if the issue with '=' is solved in handle_tag()
- if(preg_match_all('/(?<![a-zA-Z0-9=])(@[^ \x0D\x0A,:?\[]+ [^ \x0D\x0A@,:?\[]+)/',$s,$match)) {
+ // added / ? and [ to avoid issues with hashchars in url paths
+ if(preg_match_all('/(?<![a-zA-Z0-9=\/\?])(@[^ \x0D\x0A,:?\[]+ [^ \x0D\x0A@,:?\[]+)/',$s,$match)) {
foreach($match[1] as $mtch) {
if(substr($mtch,-1,1) === '.')
$ret[] = substr($mtch,0,-1);
@@ -637,7 +638,7 @@ function get_tags($s) {
// Otherwise pull out single word tags. These can be @nickname, @first_last
// and #hash tags.
- if(preg_match_all('/(?<![a-zA-Z0-9=])([@#][^ \x0D\x0A,;:?\[]+)/',$s,$match)) {
+ if(preg_match_all('/(?<![a-zA-Z0-9=\/\?])([@#][^ \x0D\x0A,;:?\[]+)/',$s,$match)) {
foreach($match[1] as $mtch) {
if(substr($mtch,-1,1) === '.')
$mtch = substr($mtch,0,-1);
@@ -2356,6 +2357,7 @@ function linkify_tags($a, &$body, $uid) {
$result = array();
$tags = get_tags($body);
+
if(count($tags)) {
foreach($tags as $tag) {
$access_tag = '';