From 5eda92d0e2c9932a8a5005adb19004dde0f68040 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 30 Dec 2002 15:47:54 +0000 Subject: [PATCH] Little robustness fixes --- admin/auth.php | 5 +++++ course/teachers.php | 4 ++-- mod/journal/edit.php | 3 ++- mod/resource/details.php | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/admin/auth.php b/admin/auth.php index 7d1e2fad9d..5b5e4cfc10 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -59,6 +59,11 @@ if (! isset($config->guestloginbutton)) { $config->guestloginbutton = 1; } + + if (empty($focus)) { + $focus = ""; + } + $guestoptions[0] = get_string("hide"); $guestoptions[1] = get_string("show"); diff --git a/course/teachers.php b/course/teachers.php index b16b55d88c..e9b0c5f6b3 100644 --- a/course/teachers.php +++ b/course/teachers.php @@ -36,8 +36,8 @@ if (! $teacher = get_record("user_teachers", "course", "$course->id", "userid", "$num")) { error("No such teacher in course $course->shortname with user id $num"); } - $teacher->role = $vals[r]; - $teacher->authority = $vals[a]; + $teacher->role = $vals['r']; + $teacher->authority = $vals['a']; if (!update_record("user_teachers", $teacher)) { error("Could not update teacher entry id = $teacher->id"); } diff --git a/mod/journal/edit.php b/mod/journal/edit.php index f07189f6ba..9cc792b430 100644 --- a/mod/journal/edit.php +++ b/mod/journal/edit.php @@ -69,9 +69,10 @@ $onsubmit = "onsubmit=\"copyrichtext(theform.text);\""; } else { $defaultformat = FORMAT_MOODLE; + $onsubmit = ""; } - if (! $entry ) { + if (empty($entry)) { $entry->text = ""; $entry->format = $defaultformat; } diff --git a/mod/resource/details.php b/mod/resource/details.php index cdc2720f61..36de44678a 100644 --- a/mod/resource/details.php +++ b/mod/resource/details.php @@ -34,6 +34,8 @@ if ($usehtmleditor and $form->type == HTML) { $onsubmit = "onsubmit=\"copyrichtext(theform.alltext);\""; + } else { + $onsubmit = ""; } echo "
destination\">"; echo ""; -- 2.39.5