]> git.mjollnir.org Git - moodle.git/commitdiff
Robustness
authormoodler <moodler>
Wed, 1 Jan 2003 07:18:43 +0000 (07:18 +0000)
committermoodler <moodler>
Wed, 1 Jan 2003 07:18:43 +0000 (07:18 +0000)
mod/journal/index.php
user/lib.php

index 6c2fd4af3310d86f9475f5526df6abdd753f8239..0e149569bb5865c719d49e78d3c0e3343a59f53a 100644 (file)
@@ -52,7 +52,7 @@
         $entrytext = get_field("journal_entries", "text", "userid", $USER->id, "journal", $journal->id);
 
         $journal->timestart  = $course->startdate + (($journal->section - 1) * 608400);
-        if ($journal->daysopen) {
+        if (!empty($journal->daysopen)) {
             $journal->timefinish = $journal->timestart + (3600 * 24 * $journal->daysopen);
         } else {
             $journal->timefinish = 9999999999;
@@ -66,7 +66,7 @@
         } else {
             $text .= "$strview</A></P>";
         }
-        if ($journal->section) {
+        if (!empty($journal->section)) {
             $section = "$journal->section";
         } else {
             $section = "";
index 00de75c04d4ffe7630a19d98e9bbf8352c4f2266..27a08073228795fc8dff2208e7913d2621bce983 100644 (file)
@@ -136,7 +136,7 @@ function print_user($user, $course, $string) {
     echo "<FONT SIZE=-1>";
     echo "<FONT SIZE=3><B>$user->firstname $user->lastname</B></FONT>";
     echo "<P>";
-    if ($user->role and ($user->role <> $course->teacher)) {
+    if (!empty($user->role) and ($user->role <> $course->teacher)) {
         echo "$string->role: $user->role<BR>";
     }
     if ($user->maildisplay == 1 or ($user->maildisplay == 2 and $course->category) or isteacher($course->id)) {