diff --git a/admin/auth.php b/admin/auth.php
index ea3da976e1e..cf72f160a77 100644
--- a/admin/auth.php
+++ b/admin/auth.php
@@ -18,6 +18,7 @@
if ($config = data_submitted()) {
+ $config = (array)$config;
validate_form($config, $err);
if (count($err) == 0) {
@@ -39,7 +40,7 @@
/// Otherwise fill and print the form.
- if (!isset($config)) {
+ if (empty($config)) {
$config = $CFG;
}
diff --git a/admin/config.php b/admin/config.php
index 48a9b9c1f43..cb3430e0eb7 100644
--- a/admin/config.php
+++ b/admin/config.php
@@ -68,10 +68,10 @@
/// Otherwise fill and print the form.
- if (!isset($config)) {
+ if (empty($config)) {
$config = $CFG;
}
- if (!isset($focus)) {
+ if (empty($focus)) {
$focus = "";
}
diff --git a/course/editsection.php b/course/editsection.php
index 2d2169cf967..eadcdac5f2d 100644
--- a/course/editsection.php
+++ b/course/editsection.php
@@ -39,7 +39,7 @@
/// Otherwise fill and print the form.
- if (! $form ) {
+ if (empty($form)) {
$form = $section;
}
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index 599fe5329fb..5c9e962befc 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -508,7 +508,7 @@ function authenticate_user_login($username, $password) {
$md5password = md5($password);
- if (!isset($CFG->auth)) {
+ if (empty($CFG->auth)) {
$CFG->auth = "email"; // Default authentication module
}
diff --git a/login/change_password.php b/login/change_password.php
index e9a6071e9f0..27ce2cf7aee 100644
--- a/login/change_password.php
+++ b/login/change_password.php
@@ -65,17 +65,18 @@
$frm->id = $id;
}
- if (!$frm->username)
+ if (empty($frm->username)) {
$frm->username = get_moodle_cookie();
+ }
- if ($frm->username) {
+ if (!empty($frm->username)) {
$focus = "form.password";
} else {
$focus = "form.username";
}
$strchangepassword = get_string("changepassword");
- if ($course->id) {
+ if (!empty($course->id)) {
print_header($strchangepassword, $strchangepassword,
"wwwroot/course/view.php?id=$course->id\">$course->shortname ->
wwwroot/user/index.php?id=$course->id\">".get_string("participants")." ->
diff --git a/login/forgot_password.php b/login/forgot_password.php
index 94cf72793a7..ec5ffc73209 100644
--- a/login/forgot_password.php
+++ b/login/forgot_password.php
@@ -34,8 +34,8 @@
}
}
- if ( empty($frm->email) ) {
- if ( $username = get_moodle_cookie() ) {
+ if (empty($frm->email)) {
+ if ($username = get_moodle_cookie() ) {
$frm->email = get_field("user", "email", "username", "$username");
}
}
diff --git a/login/signup.php b/login/signup.php
index b3fa090b1fb..f07d3c509bc 100644
--- a/login/signup.php
+++ b/login/signup.php
@@ -37,7 +37,7 @@
$focus = 'form.' . array_shift(array_flip(get_object_vars($err)));
}
- if (!$user->country and $CFG->country) {
+ if (empty($user->country) and !empty($CFG->country)) {
$user->country = $CFG->country;
}