Elide_Tags
Make "#sanfrancisco", "#SanFrancisco", "#san_francisco", "#San.Francisco", and "#SAN-FRANCISCO" all link to http://identi.ca/tag/sanfrancisco but preserve appearance darcs-hash:20080901025932-e3c0d-c0a939eaf7e242d88cbcb0d651c9d53718c60a9d.gz
This commit is contained in:
@@ -54,10 +54,13 @@ class Notice extends DB_DataObject
|
||||
|
||||
function saveTags() {
|
||||
/* extract all #hastags */
|
||||
$count = preg_match_all('/(?:^|\s)#([A-Za-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;
|
||||
}
|
||||
|
||||
/* elide characters we don't want in the tag */
|
||||
$match[1] = str_replace(array('-', '_', '.'), '', $match[1]);
|
||||
|
||||
/* Add them to the database */
|
||||
foreach(array_unique($match[1]) as $hashtag) {
|
||||
|
Reference in New Issue
Block a user