diff --git a/mod/chat/gui_header_js/chatinput.php b/mod/chat/gui_header_js/chatinput.php
index e7477b7fe6b..c4d94712634 100644
--- a/mod/chat/gui_header_js/chatinput.php
+++ b/mod/chat/gui_header_js/chatinput.php
@@ -7,24 +7,22 @@
$chat_sid = required_param('chat_sid', PARAM_ALPHANUM);
-
if (!$chatuser = get_record('chat_users', 'sid', $chat_sid)) {
error('Not logged in!');
}
chat_force_language($chatuser->lang);
-
ob_start();
?>
';
}
- //redirect('empty.php');
+ redirect('../empty.php');
?>
diff --git a/mod/chat/gui_header_js/jsupdate.php b/mod/chat/gui_header_js/jsupdate.php
index 57da1a5ece3..7ac6981c0ff 100644
--- a/mod/chat/gui_header_js/jsupdate.php
+++ b/mod/chat/gui_header_js/jsupdate.php
@@ -80,7 +80,8 @@
update_record('chat_users', $chatuser);
if ($refreshusers) {
- echo "parent.users.location.href = parent.users.document.anchors[0].href;\n";
+ echo "if (parent.users.document.anchors[0] != null) {" .
+ "parent.users.location.href = parent.users.document.anchors[0].href;}\n";
} else {
foreach($us as $uid=>$lastping) {
$min = (int) ($lastping/60);
@@ -88,7 +89,8 @@
$min = $min < 10 ? '0'.$min : $min;
$sec = $sec < 10 ? '0'.$sec : $sec;
$idle = $min.':'.$sec;
- echo "parent.users.document.getElementById('uidle{$uid}').innerHTML = '$idle';";
+ echo "if (parent.users.document.getElementById('uidle{$uid}') != null) {".
+ "parent.users.document.getElementById('uidle{$uid}').innerHTML = '$idle';}\n";
}
}
?>
@@ -102,6 +104,6 @@
echo '';
}
?>
- Refresh link
+ Refresh link