Skip to content

Commit

Permalink
Fixed security Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cis authored and cis committed Sep 18, 2014
1 parent 29ce07e commit 071cf89
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions protected_pages.module
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,23 @@ function protected_pages_init() {
$query['protected_page'] = $pid;
drupal_goto('protected-page', array('query' => $query));
}
else {
$page_node = menu_get_object();
if (isset($page_node->nid) && is_numeric($page_node->nid)) {
$path_to_node = 'node/' . $page_node->nid;
$current_path = drupal_strtolower(drupal_get_path_alias($path_to_node));
$normal_path = drupal_get_normal_path($current_path);
$pid = protected_pages_is_page_locked($current_path, $normal_path);
if ($pid) {
$query = drupal_get_destination();
if (!empty($_SERVER['HTTP_REFERER'])) {
$query['back'] = urlencode($current_path);
}
$query['protected_page'] = $pid;
drupal_goto('protected-page', array('query' => $query));
}
}
}
}

/**
Expand Down

0 comments on commit 071cf89

Please sign in to comment.