]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13985 - Fix previous fix to display a warning when whitespace is used in popup...
authorscyrma <scyrma>
Tue, 29 Apr 2008 05:10:34 +0000 (05:10 +0000)
committerscyrma <scyrma>
Tue, 29 Apr 2008 05:10:34 +0000 (05:10 +0000)
lib/weblib.php

index c47c641c4f6835cf89f1bc681ee6571a571b8a63..c3b1a271e8984c6ca61951efd7215781e7f4f6db 100644 (file)
@@ -729,8 +729,10 @@ function element_to_popup_window ($type=null, $url=null, $name=null, $linkname=n
         $class = ' class="'.$class.'" ';
     }
     if ($name) {
-        $name = str_replace(' ', '_', $name);
-        debugging('The $name of a popup window shouldn\'t contain spaces - string modified.', DEBUG_DEVELOPER);
+        $_name = $name;
+        if (($name = preg_replace("/\s/", '_', $name)) != $_name) {
+            debugging('The $name of a popup window shouldn\'t contain spaces - string modified. '. $_name .' changed to '. $name, DEBUG_DEVELOPER);
+        }
     } else {
         $name = 'popup';
     }