summaryrefslogtreecommitdiffstats
path: root/wp-includes/formatting.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-08 10:57:32 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-08 10:57:32 +0000
commite30516b2ee40c1c45c8f288c20a3d4372e478624 (patch)
treebd6b8bcc4c06697f50e6985a6b08620e25bc572e /wp-includes/formatting.php
parente20c9aa016d6885c6e3fc7425525b4090f05ac2a (diff)
downloadwordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.gz
wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.xz
wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.zip
WP Merge to #4124
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@734 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/formatting.php')
-rw-r--r--wp-includes/formatting.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 1be7f1e..0f5cc74 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -76,7 +76,7 @@ function wpautop($pee, $br = 1) {
$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
}
$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
- $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
+ $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);
return $pee;
@@ -1037,7 +1037,9 @@ function wp_richedit_pre($text) {
function clean_url( $url ) {
if ('' == $url) return $url;
- $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
+ $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url);
+ $strip = array('%0d', '%0a');
+ $url = str_replace($strip, '', $url);
$url = str_replace(';//', '://', $url);
$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);