aboutsummaryrefslogtreecommitdiffstats
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
parent084ca3f4a16084068a0ab04af651770142324f3a (diff)
downloadvolse-hubzilla-4b513d3322e03ed59e796ca60d09ee1d26cc50fb.tar.gz
volse-hubzilla-4b513d3322e03ed59e796ca60d09ee1d26cc50fb.tar.bz2
volse-hubzilla-4b513d3322e03ed59e796ca60d09ee1d26cc50fb.zip
issue #896
-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();
}