Skip to content
Browse files

MDL-29441 Chat: Use a valid name for chat popup actions

  • Loading branch information...
1 parent 5c74090 commit 85d8381fe72586d5ca88bb6c84c58bae9870e87d @andrewnicols andrewnicols committed
Showing with 5 additions and 5 deletions.
  1. +2 −2 lib/javascript-static.js
  2. +3 −3 mod/chat/view.php
View
4 lib/javascript-static.js
@@ -1313,10 +1313,10 @@ function openpopup(event, args) {
args.name = '_blank';
} else if (args.name.match(nameregex)) {
// Cleans window name because IE does not support funky ones.
- args.name = args.name.replace(nameregex, '_');
if (M.cfg.developerdebug) {
- alert('DEVELOPER NOTICE: Invalid \'name\' passed to openpopup()');
+ alert('DEVELOPER NOTICE: Invalid \'name\' passed to openpopup(): ' + args.name);
}
+ args.name = args.name.replace(nameregex, '_');
}
var fullurl = args.url;
View
6 mod/chat/view.php
@@ -101,7 +101,7 @@
$params = array();
if ($currentgroup) {
$groupselect = " AND groupid = '$currentgroup'";
- $groupparam = "&groupid=$currentgroup";
+ $groupparam = "_group{$currentgroup}";
$params['groupid'] = $currentgroup;
} else {
$groupselect = "";
@@ -129,12 +129,12 @@
$params['id'] = $chat->id;
$chattarget = new moodle_url("/mod/chat/gui_$CFG->chat_method/index.php", $params);
echo '<p>';
- echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat$course->id$chat->id$groupparam", array('height' => 500, 'width' => 700)));
+ echo $OUTPUT->action_link($chattarget, $strenterchat, new popup_action('click', $chattarget, "chat{$course->id}_{$chat->id}{$groupparam}", array('height' => 500, 'width' => 700)));
echo '</p>';
$params['id'] = $chat->id;
$link = new moodle_url('/mod/chat/gui_basic/index.php', $params);
- $action = new popup_action('click', $link, "chat{$course->id}{$chat->id}{$groupparam}", array('height' => 500, 'width' => 700));
+ $action = new popup_action('click', $link, "chat{$course->id}_{$chat->id}{$groupparam}", array('height' => 500, 'width' => 700));
echo '<p>';
echo $OUTPUT->action_link($link, get_string('noframesjs', 'message'), $action, array('title'=>get_string('modulename', 'chat')));
echo '</p>';

0 comments on commit 85d8381

Please sign in to comment.
Something went wrong with that request. Please try again.