mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-73402 block_admin_bookmarks: slightly relax section cleaning.
Allow '/' character in external page names.
This commit is contained in:
parent
508fe3937e
commit
73ef0be41f
3 changed files with 6 additions and 5 deletions
|
@ -32,8 +32,6 @@ class block_admin_bookmarks extends block_base {
|
|||
/** @var string */
|
||||
public $blockname = null;
|
||||
|
||||
/** @var bool */
|
||||
protected $contentgenerated = false;
|
||||
|
||||
/** @var bool|null */
|
||||
protected $docked = null;
|
||||
|
@ -74,9 +72,10 @@ class block_admin_bookmarks extends block_base {
|
|||
global $CFG;
|
||||
|
||||
// First check if we have already generated, don't waste cycles
|
||||
if ($this->contentgenerated === true) {
|
||||
if ($this->content !== null) {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
$this->content = new stdClass();
|
||||
|
||||
if (get_user_preferences('admin_bookmarks')) {
|
||||
|
|
|
@ -30,7 +30,8 @@ $context = context_system::instance();
|
|||
$PAGE->set_context($context);
|
||||
$adminroot = admin_get_root(false, false); // settings not required - only pages
|
||||
|
||||
if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey()) {
|
||||
// We clean section with safe path here for compatibility with external pages that include a slash in their name.
|
||||
if ($section = optional_param('section', '', PARAM_SAFEPATH) and confirm_sesskey()) {
|
||||
|
||||
if (get_user_preferences('admin_bookmarks')) {
|
||||
$bookmarks = explode(',', get_user_preferences('admin_bookmarks'));
|
||||
|
|
|
@ -31,7 +31,8 @@ $context = context_system::instance();
|
|||
$PAGE->set_context($context);
|
||||
$adminroot = admin_get_root(false, false); // settings not required - only pages
|
||||
|
||||
if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey()) {
|
||||
// We clean section with safe path here for compatibility with external pages that include a slash in their name.
|
||||
if ($section = optional_param('section', '', PARAM_SAFEPATH) and confirm_sesskey()) {
|
||||
|
||||
if (get_user_preferences('admin_bookmarks')) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue