]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13985 - Prevent popup windows from having a space in their name. (merge from...
authorscyrma <scyrma>
Tue, 29 Apr 2008 04:10:08 +0000 (04:10 +0000)
committerscyrma <scyrma>
Tue, 29 Apr 2008 04:10:08 +0000 (04:10 +0000)
lib/weblib.php

index 22ba59f9e799cf6366f98cf9265cad3dc4619117..c47c641c4f6835cf89f1bc681ee6571a571b8a63 100644 (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)) {
-        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';
     }