From b867e6028af23e0f89fb3ab9644b41b68b1bfa4b Mon Sep 17 00:00:00 2001 From: scyrma Date: Tue, 29 Apr 2008 04:10:08 +0000 Subject: [PATCH] MDL-13985 - Prevent popup windows from having a space in their name. (merge from 1.9) --- lib/weblib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 22ba59f9e7..c47c641c4f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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)) { - print_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'; } -- 2.39.5