From 5aeb48fcb2107bb4201f657aee35ed1e9a1659f4 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 17 Sep 2011 13:36:05 -0700 Subject: [PATCH 1/3] Don't try to verify URL if the user has left it out when making a new event --- plugins/Event/newevent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Event/newevent.php b/plugins/Event/newevent.php index 34e83cd7e0..4c2157e01e 100644 --- a/plugins/Event/newevent.php +++ b/plugins/Event/newevent.php @@ -206,7 +206,7 @@ class NeweventAction extends Action throw new ClientException(_m('Event must have an end time.')); } - if (isset($this->url) && Validate::uri($this->url) === false) { + if (!empty($this->url) && Validate::uri($this->url) === false) { // TRANS: Client exception thrown when trying to post an event with an invalid URL. throw new ClientException(_m('URL must be valid.')); } From a394f795394dce64d504a7b0eb32779a3a98ab5f Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 18 Sep 2011 13:35:09 -0700 Subject: [PATCH 2/3] Reorder directory router connections / fix regex --- plugins/Directory/DirectoryPlugin.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/Directory/DirectoryPlugin.php b/plugins/Directory/DirectoryPlugin.php index 06cfca02ef..5979bb0e80 100644 --- a/plugins/Directory/DirectoryPlugin.php +++ b/plugins/Directory/DirectoryPlugin.php @@ -115,21 +115,20 @@ class DirectoryPlugin extends Plugin { $m->connect( - 'directory/users', + 'directory/users/:filter', array('action' => 'userdirectory'), - array('filter' => 'all') + array('filter' => '[0-9a-zA-Z]|(0-9)') ); $m->connect( - 'directory/users/:filter', - array('action' => 'userdirectory'), - array('filter' => '([0-9a-zA-Z_]{1,64}|0-9)') + 'directory/users', + array('action' => 'userdirectory') ); $m->connect( 'groups/:filter', array('action' => 'groupdirectory'), - array('filter' => '([0-9a-zA-Z_]{1,64}|0-9)') + array('filter' => '[0-9a-zA-Z]|(0-9)') ); $m->connect( From 1acb0c227dab546799131c824d57c6e5d58a5802 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 18 Sep 2011 14:17:41 -0700 Subject: [PATCH 3/3] Remove fulltext indexes from notice and profile tables. The default for fulltext search is 'like' (MySQLLikeSearch) which doesn't require them. --- classes/Notice.php | 3 --- classes/Profile.php | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index e34dab549f..a38f54f050 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -127,9 +127,6 @@ class Notice extends Managed_DataObject 'notice_created_idx' => array('created'), 'notice_replyto_idx' => array('reply_to'), 'notice_repeatof_idx' => array('repeat_of'), - ), - 'fulltext indexes' => array( - 'content' => array('content'), ) ); } diff --git a/classes/Profile.php b/classes/Profile.php index 5ace57004c..8cea91ece6 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -72,10 +72,7 @@ class Profile extends Managed_DataObject 'primary key' => array('id'), 'indexes' => array( 'profile_nickname_idx' => array('nickname'), - ), - 'fulltext indexes' => array( - 'nickname' => array('nickname', 'fullname', 'location', 'bio', 'homepage') - ), + ) ); }