Permalink
Browse files

[MDL-22112]

Removing access to $PAGE from this function
  • Loading branch information...
Jordi Piguillem
Jordi Piguillem committed May 20, 2010
1 parent 1884fec commit 7bc03dd55b165c7cc13af91627c300be9908fc9c
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod/wiki/locallib.php
View
@@ -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;

0 comments on commit 7bc03dd

Please sign in to comment.