From 454727f6c13bdd1e8bf40633abc47f97c2d2400a Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 30 Oct 2005 22:16:41 +0000 Subject: [PATCH] fixed warnings/errors in latest PHP versions; merge from MOODLE_15_STABLE --- course/groups.php | 2 +- grade/exceptions.php | 5 +---- login/signup.php | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/course/groups.php b/course/groups.php index 42aeb118a90..f36b500f2b7 100644 --- a/course/groups.php +++ b/course/groups.php @@ -185,7 +185,7 @@ natcasesort($nonmembers); if (empty($selectedgroup)) { // Choose the first group by default - if ($selectedgroup = array_shift(array_keys($listgroups))) { + if ($selectedgroup = array_shift($temparr = array_keys($listgroups))) { $members = $listmembers[$selectedgroup]; } } else { diff --git a/grade/exceptions.php b/grade/exceptions.php index 7a1c73677a8..431c2efbaa0 100644 --- a/grade/exceptions.php +++ b/grade/exceptions.php @@ -125,10 +125,7 @@ } if (empty($selectedgrade_item)) { // Choose the first group by default - // doesn't work with php 5 :( - // $selectedgrade_item = array_shift(array_keys($listgrade_items)); - $keys = array_keys($listgrade_items); - $selectedgrade_item = array_shift($keys); + $selectedgrade_item = array_shift($temparr = array_keys($listgrade_items)); } include('exceptions.html'); diff --git a/login/signup.php b/login/signup.php index dc85ef973c2..0ff9d324fd2 100644 --- a/login/signup.php +++ b/login/signup.php @@ -53,7 +53,7 @@ } if (!empty($err)) { - $focus = "form.".array_shift(array_flip(get_object_vars($err))); + $focus = "form.".array_shift($temparr = array_flip(get_object_vars($err))); } else { $focus = ""; }