summaryrefslogtreecommitdiffstats
path: root/wp-includes/formatting.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-10-09 11:39:17 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-10-09 11:39:17 +0000
commit75e0ccc3a64e164d036da4f71f458520ddea3b24 (patch)
tree94f00db692e25c95030f7984c27178e1bd7e1bcd /wp-includes/formatting.php
parentca036ad95fc44c318275ab539a52f1eb6fddf060 (diff)
downloadwordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.tar.gz
wordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.tar.xz
wordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.zip
WP Merge - needs testing.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@797 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/formatting.php')
-rw-r--r--wp-includes/formatting.php18
1 files changed, 4 insertions, 14 deletions
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 11f0067..5c96044 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -618,14 +618,7 @@ function convert_smilies($text) {
if (get_option('use_smilies')) {
// HTML loop taken from texturize function, could possible be consolidated
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
- $stop = count($textarr);// loop stuff
- for ($i = 0; $i < $stop; $i++) {
- $content = $textarr[$i];
- if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
- $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);
- }
- $output .= $content;
- }
+ $output = implode('', preg_replace($wp_smiliessearch, $wp_smiliesreplace, $textarr));
} else {
// return default text.
$output = $text;
@@ -1070,11 +1063,8 @@ function js_escape($text) {
return preg_replace("/\r?\n/", "\\n", addslashes($text));
}
-function wp_make_link_relative( $link, $base = '' ) {
- if ( !$base )
- $base = get_option( 'home' );
- if ( 0 === strpos($link, $base) )
- $link = substr_replace($link, '', 0, strlen($base));
- return $link;
+function wp_make_link_relative( $link ) {
+ return preg_replace('|https?://[^/]+(/.*)|i', '$1', $link );
}
+
?>