MDL-13985 - Prevent popup windows from having a space in their name.

This commit is contained in:
scyrma
2008-04-29 04:04:32 +00:00
parent 4d6e43a1dd
commit d8e091627c
+5 -2
View File
@@ -703,7 +703,7 @@ function element_to_popup_window ($type=null, $url=null, $name=null, $linkname=n
$options=null, $return=false, $id=null, $class=null) {
if (is_null($url)) {
error('There must be an url to the popup. Can\'t create popup window.');
debugging('You must give the url to display in the popup. URL is missing - can\'t create popup window.', DEBUG_DEVELOPER);
}
global $CFG;
@@ -728,7 +728,10 @@ function element_to_popup_window ($type=null, $url=null, $name=null, $linkname=n
if ($class) {
$class = ' class="'.$class.'" ';
}
if (!$name) {
if ($name) {
$name = str_replace(' ', '_', $name);
debugging('The $name of a popup window shouldn\'t contain spaces - string modified.', DEBUG_DEVELOPER);
} else {
$name = 'popup';
}