Skip to content

Commit

Permalink
More robustness fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 1, 2003
1 parent 6d6c938 commit f747744
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
25 changes: 24 additions & 1 deletion mod/assignment/mod.html
Expand Up @@ -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 ?>">
Expand Down Expand Up @@ -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>
Expand Down
6 changes: 5 additions & 1 deletion mod/forum/lib.php
Expand Up @@ -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>";
Expand Down

0 comments on commit f747744

Please sign in to comment.