mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Use preg_replace_callback() instead of using the 'e' modifier.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
03b47d4ddc
commit
83df1eb992
@ -83,7 +83,7 @@ function wpautop($pee, $br = 1) {
|
||||
$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
|
||||
$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
|
||||
if ($br) {
|
||||
$pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);
|
||||
$pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'return str_replace("\n", "<WPPreserveNewline />", $matches[0]);'), $pee);
|
||||
$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
|
||||
$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user