Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[MDL-22112]

Removing access to $PAGE from this function
  • Loading branch information...
commit 7bc03dd55b165c7cc13af91627c300be9908fc9c 1 parent 1884fec
Jordi Piguillem authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod/wiki/locallib.php
View
5 mod/wiki/locallib.php
@@ -324,7 +324,10 @@ function wiki_refresh_page_links($page, $links) {
*/
function wiki_create_page($swid, $title, $format, $userid) {
global $DB, $PAGE;
- require_capability('mod/wiki:editpage', $PAGE->context);
+ $subwiki = wiki_get_subwiki($swid);
+ $cm = get_coursemodule_from_instance('wiki', $subwiki->wikiid);
+ $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+ require_capability('mod/wiki:editpage', $context);
// if page exists
if ($page = wiki_get_page_by_title($swid, $title)) {
return $page->id;
Please sign in to comment.
Something went wrong with that request. Please try again.