Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

MDL-24043 addslashes_object() for and added default course category i…

…s insert fails, credit goes to Troy Williams <>
  • Loading branch information...
1 parent 649ec3a commit 08c5c9fd523b1c6b629e93f82d2ebd429179f8b5 @skodak skodak committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 enrol/imsenterprise/enrol.php
5 enrol/imsenterprise/enrol.php
@@ -516,11 +516,12 @@ function process_group_tag($tagcontents){
// Else if we're allowed to create new categories, let's create this one
$newcat->name = $group->category;
$newcat->visible = 0;
- if($catid = insert_record('course_categories', $newcat)){
+ if($catid = insert_record('course_categories', addslashes_object($newcat))){
$course->category = $catid;
$this->log_line("Created new (hidden) category, #$catid: $newcat->name");
- $this->log_line('Failed to create new category: '.$newcat->name);
+ $this->log_line('Failed to create new category: '.$newcat->name.' so using default category instead.');
+ $course->category = 1;
// If not found and not allowed to create, stick with default

0 comments on commit 08c5c9f

Please sign in to comment.
Something went wrong with that request. Please try again.