aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2012-06-26 19:58:52 -0400
committercash <cash.costello@gmail.com>2012-06-26 19:58:52 -0400
commit91d3da6284490c32c595bb94f112fe30982bdb6c (patch)
tree2b9e3d87acd26ca257bc92c9fd16b2d351bac16e
parentaf04013ede70c0bb94bad22a7bdc22012a33dce0 (diff)
downloadelgg-91d3da6284490c32c595bb94f112fe30982bdb6c.tar.gz
elgg-91d3da6284490c32c595bb94f112fe30982bdb6c.tar.bz2
Fixes #4632: Adds 301 redirects for /forum/topic/... urls. - from Evan
-rw-r--r--mod/groups/start.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php
index e39c37000..c8198371b 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -714,6 +714,7 @@ function discussion_init() {
elgg_register_library('elgg:discussion', elgg_get_plugins_path() . 'groups/lib/discussion.php');
elgg_register_page_handler('discussion', 'discussion_page_handler');
+ elgg_register_page_handler('forum', 'discussion_forum_page_handler');
elgg_register_entity_url_handler('object', 'groupforumtopic', 'discussion_override_topic_url');
@@ -745,6 +746,20 @@ function discussion_init() {
}
/**
+ * Exists for backwards compatibility for Elgg 1.7
+ */
+function discussion_forum_page_handler($page) {
+ switch ($page[0]) {
+ case 'topic':
+ header('Status: 301 Moved Permanently');
+ forward("/discussion/view/{$page[1]}/{$page[2]}");
+ break;
+ default:
+ return false;
+ }
+}
+
+/**
* Discussion page handler
*
* URLs take the form of