Permalink
Browse files

MDL-13705

  • Loading branch information...
1 parent 48b31fc commit f19e9ea7e73fff08d82cb5f58dc16eedcf047152 skodak committed Mar 1, 2008
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/kses.php
View
@@ -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('/:|:|:/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

0 comments on commit f19e9ea

Please sign in to comment.