aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-28 20:11:50 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-28 20:11:50 -0700
commit6301de10321733a6578e59347b6b54fbd534de06 (patch)
treed928336a9a04c1a8f0acf8423cc622a2d6c17da8 /boot.php
parent051fb7107ef5c449d9d9627298b85abe882e8186 (diff)
downloadvolse-hubzilla-6301de10321733a6578e59347b6b54fbd534de06.tar.gz
volse-hubzilla-6301de10321733a6578e59347b6b54fbd534de06.tar.bz2
volse-hubzilla-6301de10321733a6578e59347b6b54fbd534de06.zip
catch a couple of edge cases with the tag linkifier
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index 870a4c33b..f69d66be5 100644
--- a/boot.php
+++ b/boot.php
@@ -1298,10 +1298,18 @@ function activity_match($haystack,$needle) {
}}
+// Pull out all #hashtags and @person tags from $s;
+// We also get @person@domain.com - which would make
+// the regex quite complicated as tags can also
+// end a sentence. So we'll run through our results
+// and strip the period from any tags which end with one.
+// Returns array of tags found, or empty array.
+
+
if(! function_exists('get_tags')) {
function get_tags($s) {
$ret = array();
- if(preg_match_all('/([@#][^ ,:?]*)[ ,:?]/',$s,$match)) {
+ if(preg_match_all('/([@#][^ ,:?]*)([ ,:?]|$)/',$s,$match)) {
foreach($match[1] as $match) {
if(substr($match,-1,1) === '.')
$ret[] = substr($match,0,-1);
@@ -1314,6 +1322,8 @@ function get_tags($s) {
}}
+// quick and dirty quoted_printable encoding
+
if(! function_exists('qp')) {
function qp($s) {
return str_replace ("%","=",rawurlencode($s));