aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-02 18:20:13 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-02 18:20:13 +0000
commit3423daa3784995f25b72ebfb1e17d59f745f9354 (patch)
tree67c91d9979825a40906b432dad40afe860458930
parent9e4472a987fb626b370f36377f761bde5ba32bdd (diff)
downloadelgg-3423daa3784995f25b72ebfb1e17d59f745f9354.tar.gz
elgg-3423daa3784995f25b72ebfb1e17d59f745f9354.tar.bz2
Using REFERER shorthand throughout core
git-svn-id: http://code.elgg.org/elgg/trunk@7193 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/admin/menu_items.php2
-rw-r--r--actions/admin/plugins/disable.php2
-rw-r--r--actions/admin/plugins/disableall.php2
-rw-r--r--actions/admin/plugins/enable.php2
-rw-r--r--actions/admin/plugins/enableall.php2
-rw-r--r--actions/admin/plugins/reorder.php2
-rw-r--r--actions/admin/plugins/simple_update_states.php2
-rw-r--r--actions/admin/site/update_advanced.php2
-rw-r--r--actions/admin/site/update_basic.php2
-rw-r--r--actions/admin/user/makeadmin.php2
-rw-r--r--actions/admin/user/removeadmin.php2
-rw-r--r--actions/admin/user/resetpassword.php2
-rw-r--r--actions/admin/user/unban.php2
-rw-r--r--actions/comments/add.php8
-rw-r--r--actions/comments/delete.php2
-rw-r--r--actions/email/save.php2
-rw-r--r--actions/entities/delete.php2
-rw-r--r--actions/friends/add.php2
-rw-r--r--actions/friends/remove.php2
-rw-r--r--actions/import/opendd.php2
-rw-r--r--actions/likes/add.php8
-rw-r--r--actions/likes/delete.php2
-rw-r--r--actions/login.php2
-rw-r--r--actions/plugins/settings/save.php12
-rw-r--r--actions/plugins/usersettings/save.php4
-rw-r--r--actions/user/name.php2
-rw-r--r--actions/useradd.php2
-rw-r--r--actions/usersettings/save.php2
-rw-r--r--actions/widgets/add.php2
-rw-r--r--actions/widgets/reorder.php2
-rw-r--r--actions/widgets/save.php2
-rw-r--r--mod/blog/actions/blog/delete.php2
-rw-r--r--mod/blog/start.php2
-rw-r--r--mod/bookmarks/actions/delete.php2
-rw-r--r--mod/categories/actions/save.php2
-rw-r--r--mod/ecml/actions/save_permissions.php2
-rw-r--r--mod/file/actions/upload.php6
-rw-r--r--mod/groups/actions/addtogroup.php2
-rw-r--r--mod/groups/actions/edit.php4
-rw-r--r--mod/groups/actions/featured.php2
-rw-r--r--mod/groups/actions/groupskillinvitation.php2
-rw-r--r--mod/groups/actions/groupskillrequest.php2
-rw-r--r--mod/groups/actions/invite.php2
-rw-r--r--mod/groups/actions/join.php2
-rw-r--r--mod/groups/actions/joinrequest.php2
-rw-r--r--mod/groups/actions/leave.php2
-rw-r--r--mod/invitefriends/actions/invite.php4
-rw-r--r--mod/messages/actions/delete.php2
-rw-r--r--mod/notifications/actions/groupsave.php2
-rw-r--r--mod/notifications/actions/save.php2
-rw-r--r--mod/pages/actions/pages/delete.php2
-rw-r--r--mod/pages/actions/pages/edit.php2
-rw-r--r--mod/profile/actions/addcomment.php2
-rw-r--r--mod/profile/actions/cropicon.php2
-rw-r--r--mod/profile/actions/deletecomment.php4
-rw-r--r--mod/profile/actions/deletedefaultprofileitem.php2
-rw-r--r--mod/profile/actions/edit.php4
-rw-r--r--mod/profile/actions/editdefault.php2
-rw-r--r--mod/profile/actions/iconupload.php6
-rw-r--r--mod/profile/actions/resetdefaultprofile.php2
-rw-r--r--mod/sitepages/actions/edit_settings.php4
61 files changed, 82 insertions, 82 deletions
diff --git a/actions/admin/menu_items.php b/actions/admin/menu_items.php
index 8b01ae8fe..c9efb8bee 100644
--- a/actions/admin/menu_items.php
+++ b/actions/admin/menu_items.php
@@ -47,4 +47,4 @@ set_config('menu_items_custom_items', $custom_items);
system_message(elgg_echo('admin:menu_items:saved'));
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/admin/plugins/disable.php b/actions/admin/plugins/disable.php
index 5ad49d2c7..48116e43a 100644
--- a/actions/admin/plugins/disable.php
+++ b/actions/admin/plugins/disable.php
@@ -32,4 +32,4 @@ foreach ($plugin as $p) {
elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/admin/plugins/disableall.php b/actions/admin/plugins/disableall.php
index f2545fb0e..bd68c17b1 100644
--- a/actions/admin/plugins/disableall.php
+++ b/actions/admin/plugins/disableall.php
@@ -27,4 +27,4 @@ foreach ($plugins as $p => $data) {
elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/admin/plugins/enable.php b/actions/admin/plugins/enable.php
index 92ccd185b..b15666093 100644
--- a/actions/admin/plugins/enable.php
+++ b/actions/admin/plugins/enable.php
@@ -33,4 +33,4 @@ foreach ($plugin as $p) {
elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/admin/plugins/enableall.php b/actions/admin/plugins/enableall.php
index 5a85b6e07..b959c235f 100644
--- a/actions/admin/plugins/enableall.php
+++ b/actions/admin/plugins/enableall.php
@@ -27,4 +27,4 @@ foreach ($plugins as $p => $data) {
elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/admin/plugins/reorder.php b/actions/admin/plugins/reorder.php
index 165495050..e3c65f6e5 100644
--- a/actions/admin/plugins/reorder.php
+++ b/actions/admin/plugins/reorder.php
@@ -50,4 +50,4 @@ if (regenerate_plugin_list($plugins)) {
elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php
index a81cb6a7a..7d01e4a46 100644
--- a/actions/admin/plugins/simple_update_states.php
+++ b/actions/admin/plugins/simple_update_states.php
@@ -50,4 +50,4 @@ if ($success) {
elgg_invalidate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php
index 10a186bd1..127fd38b6 100644
--- a/actions/admin/site/update_advanced.php
+++ b/actions/admin/site/update_advanced.php
@@ -82,5 +82,5 @@ if (datalist_get('default_site')) {
register_error(elgg_echo("admin:configuration:fail"));
}
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
} \ No newline at end of file
diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php
index dd3e08301..94882cfd3 100644
--- a/actions/admin/site/update_basic.php
+++ b/actions/admin/site/update_basic.php
@@ -26,4 +26,4 @@ if (datalist_get('default_site')) {
set_config('language', get_input('language'), $site->getGUID());
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/admin/user/makeadmin.php b/actions/admin/user/makeadmin.php
index f8a426a41..19f365d62 100644
--- a/actions/admin/user/makeadmin.php
+++ b/actions/admin/user/makeadmin.php
@@ -26,4 +26,4 @@ if (($user instanceof ElggUser) && ($user->canEdit())) {
register_error(elgg_echo('admin:user:makeadmin:no'));
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/admin/user/removeadmin.php b/actions/admin/user/removeadmin.php
index 9e8c55ac9..468670940 100644
--- a/actions/admin/user/removeadmin.php
+++ b/actions/admin/user/removeadmin.php
@@ -21,4 +21,4 @@ if (($user instanceof ElggUser) && ($user->canEdit())) {
register_error(elgg_echo('admin:user:removeadmin:no'));
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/admin/user/resetpassword.php b/actions/admin/user/resetpassword.php
index c70410201..46a983c86 100644
--- a/actions/admin/user/resetpassword.php
+++ b/actions/admin/user/resetpassword.php
@@ -42,4 +42,4 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) {
register_error(elgg_echo('admin:user:resetpassword:no'));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/admin/user/unban.php b/actions/admin/user/unban.php
index 2bc609b5c..66173623a 100644
--- a/actions/admin/user/unban.php
+++ b/actions/admin/user/unban.php
@@ -26,4 +26,4 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) {
access_show_hidden_entities($access_status);
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/comments/add.php b/actions/comments/add.php
index 2e28e7839..b7feb4b66 100644
--- a/actions/comments/add.php
+++ b/actions/comments/add.php
@@ -16,14 +16,14 @@ $comment_text = get_input('generic_comment');
// make sure comment is not empty
if (empty($comment_text)) {
register_error(elgg_echo("generic_comment:blank"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
// Let's see if we can get an entity with the specified GUID
$entity = get_entity($entity_guid);
if (!$entity) {
register_error(elgg_echo("generic_comment:notfound"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
$user = get_loggedin_user();
@@ -38,7 +38,7 @@ $annotation = create_annotation($entity->guid,
// tell user annotation posted
if (!$annotation) {
register_error(elgg_echo("generic_comment:failure"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
// notify if poster wasn't owner
@@ -65,4 +65,4 @@ system_message(elgg_echo("generic_comment:posted"));
add_to_river('annotation/annotate', 'comment', $user->guid, $entity->guid, "", 0, $annotation);
// Forward to the page the action occurred on
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/comments/delete.php b/actions/comments/delete.php
index 47c988d51..d0f5c7b84 100644
--- a/actions/comments/delete.php
+++ b/actions/comments/delete.php
@@ -27,4 +27,4 @@ if ($comment = get_annotation($annotation_id)) {
}
register_error(elgg_echo("generic_comment:notdeleted"));
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/email/save.php b/actions/email/save.php
index c84969945..0dee6ee1e 100644
--- a/actions/email/save.php
+++ b/actions/email/save.php
@@ -19,7 +19,7 @@ if (!$user_id) {
if (!is_email_address($email)) {
register_error(elgg_echo('email:save:fail'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
if ($user) {
diff --git a/actions/entities/delete.php b/actions/entities/delete.php
index 61913e2f8..3ec88bd04 100644
--- a/actions/entities/delete.php
+++ b/actions/entities/delete.php
@@ -21,4 +21,4 @@ if (($entity) && ($entity->canEdit())) {
register_error(sprintf(elgg_echo('entity:delete:fail'), $guid));
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/friends/add.php b/actions/friends/add.php
index d26539a54..60431a27d 100644
--- a/actions/friends/add.php
+++ b/actions/friends/add.php
@@ -31,4 +31,4 @@ if (!$errors) {
}
// Forward back to the page you friended the user on
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/friends/remove.php b/actions/friends/remove.php
index f79fdf0ac..786b5975b 100644
--- a/actions/friends/remove.php
+++ b/actions/friends/remove.php
@@ -32,4 +32,4 @@ if (!$errors) {
}
// Forward back to the page you made the friend on
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/import/opendd.php b/actions/import/opendd.php
index 96eb2bc05..0bf748734 100644
--- a/actions/import/opendd.php
+++ b/actions/import/opendd.php
@@ -24,4 +24,4 @@ if ($return) {
register_error(elgg_echo('importfail'));
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/likes/add.php b/actions/likes/add.php
index b4b4a8462..211cb340b 100644
--- a/actions/likes/add.php
+++ b/actions/likes/add.php
@@ -12,13 +12,13 @@ $entity_guid = (int) get_input('guid');
//check to see if the user has already liked the item
if (elgg_annotation_exists($entity_guid, 'likes')) {
system_message(elgg_echo("likes:alreadyliked"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
// Let's see if we can get an entity with the specified GUID
$entity = get_entity($entity_guid);
if (!$entity) {
register_error(elgg_echo("likes:notfound"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
$user = get_loggedin_user();
@@ -32,7 +32,7 @@ $annotation = create_annotation($entity->guid,
// tell user annotation didn't work if that is the case
if (!$annotation) {
register_error(elgg_echo("likes:failure"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
// notify if poster wasn't owner
@@ -59,4 +59,4 @@ system_message(elgg_echo("likes:likes"));
add_to_river('annotation/annotatelike', 'likes', $user->guid, $entity->guid, "", 0, $annotation);
// Forward back to the page where the user 'liked' the object
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/likes/delete.php b/actions/likes/delete.php
index 3ca82308d..45984b581 100644
--- a/actions/likes/delete.php
+++ b/actions/likes/delete.php
@@ -28,4 +28,4 @@ if ($likes = get_annotation($annotation_id)) {
}
register_error(elgg_echo("likes:notdeleted"));
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/login.php b/actions/login.php
index b7823514a..67a2052b6 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -36,7 +36,7 @@ if ($result) {
forward($forward_url);
} else {
if (get_input('returntoreferer')) {
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
} else {
// forward to index for front page overrides.
// index will forward to dashboard if appropriate.
diff --git a/actions/plugins/settings/save.php b/actions/plugins/settings/save.php
index 24af3f5fa..1a8b2db3d 100644
--- a/actions/plugins/settings/save.php
+++ b/actions/plugins/settings/save.php
@@ -10,7 +10,7 @@ $params = get_input('params');
$plugin = get_input('plugin');
if (!$plugin_info = load_plugin_manifest($plugin)) {
register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
$plugin_name = $plugin_info['name'];
@@ -32,28 +32,28 @@ if (elgg_action_exist("settings/$plugin/save")) {
foreach ($params as $k => $v) {
if (!$result = set_plugin_setting($k, $v, $plugin)) {
register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin_name));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
exit;
}
}
}
system_message(sprintf(elgg_echo('plugins:settings:save:ok'), $plugin_name));
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
//
//$trigger = trigger_plugin_hook('plugin:save_settings', $plugin, $options, NULL);
//if ($trigger === NULL) {
// foreach ($params as $k => $v) {
// if (!$result = set_plugin_setting($k, $v, $plugin)) {
// register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin_name));
-// forward($_SERVER['HTTP_REFERER']);
+// forward(REFERER);
// exit;
// }
// }
//} elseif ($trigger === FALSE) {
// register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin_name));
-// forward($_SERVER['HTTP_REFERER']);
+// forward(REFERER);
//}
//
//system_message(sprintf(elgg_echo('plugins:settings:save:ok'), $plugin_name));
-//forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+//forward(REFERER); \ No newline at end of file
diff --git a/actions/plugins/usersettings/save.php b/actions/plugins/usersettings/save.php
index 3e7f48f52..27f549184 100644
--- a/actions/plugins/usersettings/save.php
+++ b/actions/plugins/usersettings/save.php
@@ -20,10 +20,10 @@ foreach ($params as $k => $v) {
// Error?
if (!$result) {
register_error(sprintf(elgg_echo('plugins:usersettings:save:fail'), $plugin));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
exit;
}
}
system_message(sprintf(elgg_echo('plugins:usersettings:save:ok'), $plugin));
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/user/name.php b/actions/user/name.php
index acf83ab49..c3e79d725 100644
--- a/actions/user/name.php
+++ b/actions/user/name.php
@@ -19,7 +19,7 @@ if (!$user_id) {
if (elgg_strlen($name) > 50) {
register_error(elgg_echo('user:name:fail'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
if (($user) && ($user->canEdit()) && ($name)) {
diff --git a/actions/useradd.php b/actions/useradd.php
index 2b3dfe429..54def11b3 100644
--- a/actions/useradd.php
+++ b/actions/useradd.php
@@ -48,4 +48,4 @@ try {
register_error($r->getMessage());
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/usersettings/save.php b/actions/usersettings/save.php
index 5e375941f..3e0117f06 100644
--- a/actions/usersettings/save.php
+++ b/actions/usersettings/save.php
@@ -12,4 +12,4 @@ gatekeeper();
trigger_plugin_hook('usersettings:save', 'user');
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/actions/widgets/add.php b/actions/widgets/add.php
index b38e53f0d..57c331e21 100644
--- a/actions/widgets/add.php
+++ b/actions/widgets/add.php
@@ -27,4 +27,4 @@ if ($result) {
register_error(elgg_echo('widgets:save:failure'));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/widgets/reorder.php b/actions/widgets/reorder.php
index c7c525a81..e43a0ba73 100644
--- a/actions/widgets/reorder.php
+++ b/actions/widgets/reorder.php
@@ -21,4 +21,4 @@ if ($result) {
register_error(elgg_echo('widgets:panel:save:failure'));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/actions/widgets/save.php b/actions/widgets/save.php
index 673767939..945634d97 100644
--- a/actions/widgets/save.php
+++ b/actions/widgets/save.php
@@ -27,4 +27,4 @@ if ($result) {
register_error(elgg_echo('widgets:save:failure'));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/blog/actions/blog/delete.php b/mod/blog/actions/blog/delete.php
index c2cd5278f..d338fd2df 100644
--- a/mod/blog/actions/blog/delete.php
+++ b/mod/blog/actions/blog/delete.php
@@ -20,4 +20,4 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
register_error(elgg_echo('blog:error:post_not_found'));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/blog/start.php b/mod/blog/start.php
index a87a14ca2..208f3b969 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -102,7 +102,7 @@ function blog_page_handler($page) {
// forward away if invalid user.
if (!$user = get_user_by_username($username)) {
register_error('blog:error:unknown_username');
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
set_page_owner($user->getGUID());
diff --git a/mod/bookmarks/actions/delete.php b/mod/bookmarks/actions/delete.php
index d6e19cdae..23de80146 100644
--- a/mod/bookmarks/actions/delete.php
+++ b/mod/bookmarks/actions/delete.php
@@ -17,4 +17,4 @@ if ($entity = get_entity($guid)) {
}
register_error(elgg_echo("bookmarks:delete:failed"));
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/categories/actions/save.php b/mod/categories/actions/save.php
index 48f050c14..dc2c7943b 100644
--- a/mod/categories/actions/save.php
+++ b/mod/categories/actions/save.php
@@ -14,4 +14,4 @@ system_message(elgg_echo("categories:save:success"));
elgg_delete_admin_notice('categories_admin_notice_no_categories');
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/ecml/actions/save_permissions.php b/mod/ecml/actions/save_permissions.php
index 89b2179fa..f32544d86 100644
--- a/mod/ecml/actions/save_permissions.php
+++ b/mod/ecml/actions/save_permissions.php
@@ -34,4 +34,4 @@ if (set_plugin_setting('ecml_permissions', serialize($perms), 'ecml')) {
register_error(elgg_echo('ecml:admin:cannot_save_permissions'));
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/mod/file/actions/upload.php b/mod/file/actions/upload.php
index 82744730c..6af52c701 100644
--- a/mod/file/actions/upload.php
+++ b/mod/file/actions/upload.php
@@ -47,7 +47,7 @@
exit;
} else {
register_error($error);
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
}
@@ -64,13 +64,13 @@
$file = get_entity($guid);
if (!$file) {
register_error(elgg_echo('file:cannotload'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
// user must be able to edit file
if (!$file->canEdit()) {
register_error(elgg_echo('file:noaccess'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
}
diff --git a/mod/groups/actions/addtogroup.php b/mod/groups/actions/addtogroup.php
index ff2ab6944..6f63ff446 100644
--- a/mod/groups/actions/addtogroup.php
+++ b/mod/groups/actions/addtogroup.php
@@ -89,6 +89,6 @@
}
}
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
?>
diff --git a/mod/groups/actions/edit.php b/mod/groups/actions/edit.php
index 6e738e205..4ae98815c 100644
--- a/mod/groups/actions/edit.php
+++ b/mod/groups/actions/edit.php
@@ -31,7 +31,7 @@ $group = new ElggGroup($group_guid); // load if present, if not create a new gro
if (($group_guid) && (!$group->canEdit())) {
register_error(elgg_echo("groups:cantedit"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
exit;
}
@@ -46,7 +46,7 @@ if (sizeof($input) > 0) {
if (!$group->name) {
register_error(elgg_echo("groups:notitle"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
exit;
}
diff --git a/mod/groups/actions/featured.php b/mod/groups/actions/featured.php
index 8dc9dcc65..b49a76471 100644
--- a/mod/groups/actions/featured.php
+++ b/mod/groups/actions/featured.php
@@ -35,4 +35,4 @@
}
- forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+ forward(REFERER); \ No newline at end of file
diff --git a/mod/groups/actions/groupskillinvitation.php b/mod/groups/actions/groupskillinvitation.php
index ea74024fc..46d71bede 100644
--- a/mod/groups/actions/groupskillinvitation.php
+++ b/mod/groups/actions/groupskillinvitation.php
@@ -23,6 +23,6 @@
system_message(elgg_echo("groups:invitekilled"));
}
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
?> \ No newline at end of file
diff --git a/mod/groups/actions/groupskillrequest.php b/mod/groups/actions/groupskillrequest.php
index 153dc0179..c0511cc0e 100644
--- a/mod/groups/actions/groupskillrequest.php
+++ b/mod/groups/actions/groupskillrequest.php
@@ -23,6 +23,6 @@
system_message(elgg_echo("groups:joinrequestkilled"));
}
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
?> \ No newline at end of file
diff --git a/mod/groups/actions/invite.php b/mod/groups/actions/invite.php
index fa56b9015..9ab4f2440 100644
--- a/mod/groups/actions/invite.php
+++ b/mod/groups/actions/invite.php
@@ -60,6 +60,6 @@ if (sizeof($user_guid))
}
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
?>
diff --git a/mod/groups/actions/join.php b/mod/groups/actions/join.php
index 6fd94d34a..158da372c 100644
--- a/mod/groups/actions/join.php
+++ b/mod/groups/actions/join.php
@@ -58,6 +58,6 @@
else
register_error(elgg_echo("groups:cantjoin"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
exit;
?>
diff --git a/mod/groups/actions/joinrequest.php b/mod/groups/actions/joinrequest.php
index fae8fc0de..a3b372e65 100644
--- a/mod/groups/actions/joinrequest.php
+++ b/mod/groups/actions/joinrequest.php
@@ -79,4 +79,4 @@ if (($group) && ($user) && (!$group->isMember($user)))
}
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/groups/actions/leave.php b/mod/groups/actions/leave.php
index 220a106cf..5ed2bf648 100644
--- a/mod/groups/actions/leave.php
+++ b/mod/groups/actions/leave.php
@@ -36,6 +36,6 @@
else
register_error(elgg_echo("groups:cantleave"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
exit;
?> \ No newline at end of file
diff --git a/mod/invitefriends/actions/invite.php b/mod/invitefriends/actions/invite.php
index fa95ec23d..bb6b71385 100644
--- a/mod/invitefriends/actions/invite.php
+++ b/mod/invitefriends/actions/invite.php
@@ -16,7 +16,7 @@ if (strlen($emails) > 0) {
if (!is_array($emails) || count($emails) == 0) {
register_error(elgg_echo('invitefriends:noemails'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
$current_user = get_loggedin_user();
@@ -82,4 +82,4 @@ if ($error) {
system_message(elgg_echo('invitefriends:success'));
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/mod/messages/actions/delete.php b/mod/messages/actions/delete.php
index 0f5bb2813..d59aff025 100644
--- a/mod/messages/actions/delete.php
+++ b/mod/messages/actions/delete.php
@@ -61,5 +61,5 @@ if ($success) {
}
} else {
register_error(elgg_echo("messages:notfound"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
} \ No newline at end of file
diff --git a/mod/notifications/actions/groupsave.php b/mod/notifications/actions/groupsave.php
index 587b1117c..f39beb665 100644
--- a/mod/notifications/actions/groupsave.php
+++ b/mod/notifications/actions/groupsave.php
@@ -34,4 +34,4 @@ foreach($NOTIFICATION_HANDLERS as $method => $foo) {
system_message(elgg_echo('notifications:subscriptions:success'));
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/mod/notifications/actions/save.php b/mod/notifications/actions/save.php
index 18f243254..eddda9dc6 100644
--- a/mod/notifications/actions/save.php
+++ b/mod/notifications/actions/save.php
@@ -31,4 +31,4 @@ foreach($subscriptions as $key => $subscription) {
system_message(elgg_echo('notifications:subscriptions:success'));
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/mod/pages/actions/pages/delete.php b/mod/pages/actions/pages/delete.php
index ab28e23b6..8bc20b821 100644
--- a/mod/pages/actions/pages/delete.php
+++ b/mod/pages/actions/pages/delete.php
@@ -35,4 +35,4 @@ if ($page = get_entity($page)) {
}
register_error(elgg_echo('pages:delete:failure'));
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/mod/pages/actions/pages/edit.php b/mod/pages/actions/pages/edit.php
index db308b5d7..c8b151a97 100644
--- a/mod/pages/actions/pages/edit.php
+++ b/mod/pages/actions/pages/edit.php
@@ -71,7 +71,7 @@ if ($page instanceof ElggObject) {
if (!$page->title) {
register_error(elgg_echo("pages:notitle"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
$page->access_id = (int)get_input('access_id', ACCESS_PRIVATE);
diff --git a/mod/profile/actions/addcomment.php b/mod/profile/actions/addcomment.php
index 86d3cbd47..5817b8e83 100644
--- a/mod/profile/actions/addcomment.php
+++ b/mod/profile/actions/addcomment.php
@@ -45,4 +45,4 @@ if ($user && !empty($message_content)) {
}
// Forward back to the messageboard
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/profile/actions/cropicon.php b/mod/profile/actions/cropicon.php
index 21280463e..1212e8bab 100644
--- a/mod/profile/actions/cropicon.php
+++ b/mod/profile/actions/cropicon.php
@@ -12,7 +12,7 @@ $profile_owner = get_user_by_username($profile_username);
if (!$profile_owner || !($profile_owner instanceof ElggUser) || !$profile_owner->canEdit()) {
register_error(elgg_echo('profile:icon:fail'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
$x1 = (int) get_input('x_1',0);
diff --git a/mod/profile/actions/deletecomment.php b/mod/profile/actions/deletecomment.php
index 0a104eabe..233d53069 100644
--- a/mod/profile/actions/deletecomment.php
+++ b/mod/profile/actions/deletecomment.php
@@ -19,11 +19,11 @@ if ($message = get_annotation($annotation_id)) {
$message->delete();
//display message
system_message(elgg_echo("profile:commentwall:deleted"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
} else {
system_message(elgg_echo("profile:commentwall:notdeleted"));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/profile/actions/deletedefaultprofileitem.php b/mod/profile/actions/deletedefaultprofileitem.php
index a049cb8b0..f3880954f 100644
--- a/mod/profile/actions/deletedefaultprofileitem.php
+++ b/mod/profile/actions/deletedefaultprofileitem.php
@@ -28,4 +28,4 @@ if (($id) && (set_plugin_setting("admin_defined_profile_$id", '', 'profile')) &&
register_error(elgg_echo('profile:editdefault:delete:fail'));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/profile/actions/edit.php b/mod/profile/actions/edit.php
index b9cc8e19d..c91e5e5a7 100644
--- a/mod/profile/actions/edit.php
+++ b/mod/profile/actions/edit.php
@@ -13,7 +13,7 @@ $profile_owner = get_user_by_username($profile_username);
if (!$profile_owner || !$profile_owner->canEdit()) {
system_message(elgg_echo("profile:noaccess"));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
// grab the defined profile field names and their load the values from POST.
@@ -48,7 +48,7 @@ foreach($CONFIG->profile as $shortname => $valuetype) {
if (!is_array($value) && $valuetype != 'longtext' && elgg_strlen($value) > 250) {
$error = sprintf(elgg_echo('profile:field_too_long'), elgg_echo("profile:{$shortname}"));
register_error($error);
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
if ($valuetype == 'tags') {
diff --git a/mod/profile/actions/editdefault.php b/mod/profile/actions/editdefault.php
index 6e4c3262b..1d50f432a 100644
--- a/mod/profile/actions/editdefault.php
+++ b/mod/profile/actions/editdefault.php
@@ -36,4 +36,4 @@ if (($label) && ($type)){
register_error(elgg_echo('profile:editdefault:fail'));
}
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/profile/actions/iconupload.php b/mod/profile/actions/iconupload.php
index e780bde76..cd842752f 100644
--- a/mod/profile/actions/iconupload.php
+++ b/mod/profile/actions/iconupload.php
@@ -12,7 +12,7 @@ $profile_owner = get_user_by_username($profile_username);
if (!$profile_owner || !($profile_owner instanceof ElggUser) || !$profile_owner->canEdit()) {
register_error(elgg_echo('profile:icon:fail'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
$profile_owner_guid = $profile_owner->getGUID();
@@ -49,7 +49,7 @@ foreach ($icon_sizes as $name => $size_info) {
}
system_message(elgg_echo('profile:icon:notfound'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
}
@@ -61,4 +61,4 @@ if (trigger_elgg_event('profileiconupdate', $profile_owner->type, $profile_owner
}
//forward the user back to the upload page to crop
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);
diff --git a/mod/profile/actions/resetdefaultprofile.php b/mod/profile/actions/resetdefaultprofile.php
index 26b596f90..facc82f71 100644
--- a/mod/profile/actions/resetdefaultprofile.php
+++ b/mod/profile/actions/resetdefaultprofile.php
@@ -20,4 +20,4 @@ set_plugin_setting('user_defined_fields', FALSE, 'profile');
system_message(elgg_echo('profile:defaultprofile:reset'));
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
+forward(REFERER); \ No newline at end of file
diff --git a/mod/sitepages/actions/edit_settings.php b/mod/sitepages/actions/edit_settings.php
index d79c38240..8f328eb76 100644
--- a/mod/sitepages/actions/edit_settings.php
+++ b/mod/sitepages/actions/edit_settings.php
@@ -15,7 +15,7 @@ switch ($page_type) {
$content = get_input('sitepages_content', '', FALSE);
if (empty($content)) {
register_error(elgg_echo('sitepages:blank'));
- forward($_SERVER['HTTP_REFERER']);
+ forward(REFERER);
}
//$sitepage->title = $page_type;
@@ -47,4 +47,4 @@ if ($sitepage->save()) {
register_error(elgg_echo('sitepages:error'));
}
-forward($_SERVER['HTTP_REFERER']);
+forward(REFERER);