]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13705
authorskodak <skodak>
Sat, 1 Mar 2008 13:11:31 +0000 (13:11 +0000)
committerskodak <skodak>
Sat, 1 Mar 2008 13:11:31 +0000 (13:11 +0000)
lib/kses.php

index 476f2c380ced33aa827ee8da619ad07a2272c4f2..204a56a802ad0df5d1fddc520befeea56779da32 100644 (file)
@@ -469,10 +469,12 @@ function kses_bad_protocol_once($string, $allowed_protocols)
 # handling whitespace and HTML entities.
 ###############################################################################
 {
-  return preg_replace('/^((&[^;]*;|[\sA-Za-z0-9])*)'.
-                      '(:|&#0*58;|&#[Xx]0*3[Aa];)\s*/e',
-                      'kses_bad_protocol_once2(\'\\1\', $allowed_protocols)',
-                      $string);
+  $string2 = preg_split('/:|&#58;|&#x3a;/i', $string, 2);
+  if(isset($string2[1]) && !preg_match('%/\?%',$string2[0]))
+  {
+    $string = kses_bad_protocol_once2($string2[0],$allowed_protocols).trim($string2[1]);
+  }
+  return $string;
 } # function kses_bad_protocol_once