From: Garret Buell Date: Mon, 1 Sep 2008 00:12:41 +0000 (-0400) Subject: Allow_multicase_tags X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cca78b26f71aaa5792e147b8a96c5e26a369bd82;p=quix0rs-gnu-social.git Allow_multicase_tags Make "#test", "#Test", and "#tEsT" all preserve appearance but link to the same tag darcs-hash:20080901001241-e3c0d-b466f35f4f023c6c90a6d2817487c97be9a1bbca.gz --- diff --git a/classes/Notice.php b/classes/Notice.php index 8c20975898..5e1f83a52f 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -54,7 +54,7 @@ class Notice extends DB_DataObject function saveTags() { /* extract all #hastags */ - $count = preg_match_all('/(?:^|\s)#([a-z0-9]{1,64})/', strtolower($this->content), $match); + $count = preg_match_all('/(?:^|\s)#([A-Za-z0-9]{1,64})/', strtolower($this->content), $match); if (!$count) { return true; } diff --git a/lib/util.php b/lib/util.php index 93a0711f36..469bc986fe 100644 --- a/lib/util.php +++ b/lib/util.php @@ -688,16 +688,16 @@ function common_render_content($text, $notice) { $r = preg_replace('@https?://[^)\]>\s]+@', '\0', $r); $r = preg_replace('/(^|\s+)@([a-z0-9]{1,64})/e', "'\\1@'.common_at_link($id, '\\2')", $r); $r = preg_replace('/^T ([A-Z0-9]{1,64}) /e', "'T '.common_at_link($id, '\\1').' '", $r); - $r = preg_replace('/(^|\s+)#([a-z0-9]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r); + $r = preg_replace('/(^|\s+)#([A-Za-z0-9]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r); # XXX: machine tags return $r; } function common_tag_link($tag) { if(common_config('site', 'fancy')) { - return ''; + return ''; } else { - return ''; + return ''; } }