Skip to content
Browse files

Merged from MOODLE_15_STABLE - make_categories_list(): initialize var…

…iables correctly to cover up for broken call convention. Passing unset variables by ref to be populated is a BAD idea. Do The Right Thing and Return your function output or there'll be no dessert for you.
  • Loading branch information...
martinlanghoff committed Sep 6, 2005
1 parent 488b946 commit 9d866ae0f1642dcef771d2e3feb04629cc26d3e7
Showing with 8 additions and 0 deletions.
  1. +8 −0 course/lib.php
@@ -1180,6 +1180,14 @@ function make_categories_list(&$list, &$parents, $category=NULL, $path="") {
/// categories, building up a nice list for display. It also makes
/// an array that list all the parents for each category.
// initialize the arrays if needed
if (!is_array($list)) {
$list = array();
if (!is_array($parents)) {
$parents = array();
if ($category) {
if ($path) {
$path = $path.' / '.$category->name;

0 comments on commit 9d866ae

Please sign in to comment.
You can’t perform that action at this time.