summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/Notice.php14
-rw-r--r--lib/dbqueuemanager.php4
-rw-r--r--lib/router.php2
-rw-r--r--lib/util.php2
-rwxr-xr-xscripts/getvaliddaemons.php3
5 files changed, 17 insertions, 8 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 101fadb67..7f002d838 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -97,13 +97,21 @@ class Notice extends Memcached_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)#([\pL\pN_\-\.]{1,64})/', strtolower($this->content), $match);
if (!$count) {
return true;
}
+
+ //turn each into their canonical tag
+ //this is needed to remove dupes before saving e.g. #hash.tag = #hashtag
+ $hashtags = array();
+ for($i=0; $i<count($match[1]); $i++) {
+ $hashtags[] = common_canonical_tag($match[1][$i]);
+ }
+
/* Add them to the database */
- foreach(array_unique($match[1]) as $hashtag) {
+ foreach(array_unique($hashtags) as $hashtag) {
/* elide characters we don't want in the tag */
$this->saveTag($hashtag);
}
@@ -112,8 +120,6 @@ class Notice extends Memcached_DataObject
function saveTag($hashtag)
{
- $hashtag = common_canonical_tag($hashtag);
-
$tag = new Notice_tag();
$tag->notice_id = $this->id;
$tag->tag = $hashtag;
diff --git a/lib/dbqueuemanager.php b/lib/dbqueuemanager.php
index a37a8ffdf..1df5af6c1 100644
--- a/lib/dbqueuemanager.php
+++ b/lib/dbqueuemanager.php
@@ -88,7 +88,9 @@ class DBQueueManager extends QueueManager
do {
$qi = Queue_item::top($queue);
- if (!empty($qi)) {
+ if (empty($qi)) {
+ sleep(1);
+ } else {
$notice = Notice::staticGet('id', $qi->notice_id);
if (!empty($notice)) {
$result = $notice;
diff --git a/lib/router.php b/lib/router.php
index 5e0fcfc94..8e4836497 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -211,7 +211,7 @@ class Router
array('tag' => '[a-zA-Z0-9]+'));
$m->connect('tag/:tag',
array('action' => 'tag'),
- array('tag' => '[a-zA-Z0-9]+'));
+ array('tag' => '[\pL\pN_\-\.]{1,64}'));
$m->connect('peopletag/:tag',
array('action' => 'peopletag'),
diff --git a/lib/util.php b/lib/util.php
index f23f10e2c..c7c82dba2 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -404,7 +404,7 @@ function common_render_text($text)
$r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r);
$r = common_replace_urls_callback($r, 'common_linkify');
- $r = preg_replace('/(^|\(|\[|\s+)#([A-Za-z0-9_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r);
+ $r = preg_replace('/(^|\(|\[|\s+)#([\pL\pN_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r);
// XXX: machine tags
return $r;
}
diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php
index 97c230784..1e4546dff 100755
--- a/scripts/getvaliddaemons.php
+++ b/scripts/getvaliddaemons.php
@@ -28,7 +28,8 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
$helptext = <<<ENDOFHELP
-getvaliddaemons.php - print out the currently configured PID directory
+getvaliddaemons.php - print out a list of valid daemons that should be started
+by the startdaemons script
ENDOFHELP;