Following code:
function parseUrl ( $url )
{
$r = '!(?:(\w+)://)?(?:(\w+)\:(\w+)@)?([^/:]+)?';
$r .= '(?:\:(\d*))?([^#?]+)?(?:\?([^#]+))?(?:#(.+$))?!i';
preg_match ( $r, $url, $out );
return $out;
}
pasted in php tags, it's not viewed properly, even there is no ending tag.
Example:
function parseUrl ( $url )
{
$r = '!(?:(\w+)://)?(?:(\w+)\:(\w+)@)?([^/:]+)?';
$r .= '(?:\:(\d*))?([^#+)?(?:\?([^#]+))?(?:#(.+$))?!i';
preg_match ( $r, $url, $out );
return $out;
}
?>
Comments
Comment #1
damien tournoud commentedInteresting bug ;)
Drupal core has no PHP code filter, so I believe this belongs in the code filter project.
Comment #2
kenorb commentedAh, sorry;)
Comment #3
fgmBut is still present on 8.x (just checked).
Comment #4
joachim commentedIs the problem that the blank lines of code get turned into P tags?
It would be helpful if the code sample didn't have the regexes in, as those make it look like there's a nasty problem there!