diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/elgglib.php | 4 | ||||
-rw-r--r-- | engine/lib/group.php | 4 | ||||
-rw-r--r-- | engine/lib/sessions.php | 9 |
3 files changed, 5 insertions, 12 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index c62175629..64bdf9276 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -143,9 +143,9 @@ function forward($location = "", $reason = 'system') { } else if ($location === '') { exit; } + } else { + throw new SecurityException(elgg_echo('SecurityException:ForwardFailedToRedirect')); } - - return false; } /** diff --git a/engine/lib/group.php b/engine/lib/group.php index e7b70fd10..7fa188cd6 100644 --- a/engine/lib/group.php +++ b/engine/lib/group.php @@ -276,9 +276,7 @@ function group_gatekeeper($forward = true) { if ($forward && $allowed == false) { register_error(elgg_echo('membershiprequired')); - if (!forward($url, 'member')) { - throw new SecurityException(elgg_echo('SecurityException:UnexpectedOutputInGatekeeper')); - } + forward($url, 'member'); } return $allowed; diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 407bb69c5..ae42956a9 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -472,10 +472,7 @@ function gatekeeper() { if (!elgg_is_logged_in()) { $_SESSION['last_forward_from'] = current_page_url(); register_error(elgg_echo('loggedinrequired')); - - if (!forward('', 'login')) { - throw new SecurityException(elgg_echo('SecurityException:UnexpectedOutputInGatekeeper')); - } + forward('', 'login'); } } @@ -490,9 +487,7 @@ function admin_gatekeeper() { if (!elgg_is_admin_logged_in()) { $_SESSION['last_forward_from'] = current_page_url(); register_error(elgg_echo('adminrequired')); - if (!forward('', 'admin')) { - throw new SecurityException(elgg_echo('SecurityException:UnexpectedOutputInGatekeeper')); - } + forward('', 'admin'); } } |