More robustness fixes

This commit is contained in:
moodler 2003-01-01 06:34:54 +00:00
parent 6d6c938999
commit f747744495
2 changed files with 29 additions and 2 deletions

View File

@ -6,6 +6,30 @@
$defaultformat = FORMAT_MOODLE;
$onsubmit = "";
}
if (empty($form->name)) {
$form->name = "";
}
if (empty($form->description)) {
$form->description = "";
}
if (empty($form->format)) {
$form->format = "";
}
if (empty($form->type)) {
$form->type = "";
}
if (empty($form->resubmit)) {
$form->resubmit = "";
}
if (empty($form->grade)) {
$form->grade = "";
}
if (empty($form->maxbytes)) {
$form->maxbytes = "";
}
if (empty($form->timedue)) {
$form->timedue = "";
}
?>
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
@ -107,7 +131,6 @@
print_date_selector("dueday", "duemonth", "dueyear", $form->timedue);
echo "&nbsp;-&nbsp;";
print_time_selector("duehour", "dueminute", $form->timedue);
formerr($err["duedate"]);
?></td>
</tr>
</table>

View File

@ -1472,7 +1472,11 @@ function forum_print_latest_discussions($forum_id=0, $forum_numdiscussions=5, $f
} else {
$discussion->replies = 0;
}
$ownpost = ($discussion->userid == $USER->id);
if (!empty($USER->id)) {
$ownpost = ($discussion->userid == $USER->id);
} else {
$ownpost=false;
}
switch ($forum_style) {
case "minimal":
echo "<P><FONT COLOR=#555555>".userdate($discussion->modified, "%d %b, %H:%M")." - $discussion->firstname</FONT>";