Skip to content

Commit

Permalink
Restore $CFG->prefix just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Sep 25, 2004
1 parent e335cc7 commit 8fcccd5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions enrol/database/enrol.php
Expand Up @@ -26,6 +26,7 @@ function get_student_courses(&$user) {
// The following hack will make the database explicit which keeps it happy

if (strpos($CFG->prefix, $CFG->dbname) === false) {
$oldprefix = $CFG->prefix;
$CFG->prefix = "$CFG->dbname.$CFG->prefix";
}

Expand Down Expand Up @@ -77,6 +78,10 @@ function get_student_courses(&$user) {

$enroldb->Close();
}

if (!empty($oldprefix)) {
$CFG->prefix = $oldprefix; // Restore it just in case
}
}


Expand Down

0 comments on commit 8fcccd5

Please sign in to comment.