aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/text.php6
-rw-r--r--mod/item.php2
2 files changed, 5 insertions, 3 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 = '';
diff --git a/mod/item.php b/mod/item.php
index 120b5c66f..eb823b4b0 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -740,7 +740,7 @@ function item_post(&$a) {
$datarray['author'] = $observer;
$datarray['attach'] = json_encode($datarray['attach']);
$o = conversation($a,array($datarray),'search',false,'preview');
- logger('preview: ' . $o, LOGGER_DEBUG);
+// logger('preview: ' . $o, LOGGER_DEBUG);
echo json_encode(array('preview' => $o));
killme();
}