summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-02 10:42:08 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-02 10:42:08 +0000
commitd71327104baa1c83106f008a3ed11aee70edc50d (patch)
tree7cae83f2214a2c3ff71fa799751a0e7bb40826d7
parent4fb300c67a3442cd0209a6129d53f0f727b60743 (diff)
downloadwordpress-mu-d71327104baa1c83106f008a3ed11aee70edc50d.tar.gz
wordpress-mu-d71327104baa1c83106f008a3ed11aee70edc50d.tar.xz
wordpress-mu-d71327104baa1c83106f008a3ed11aee70edc50d.zip
WP Merge to #4669
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@829 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-admin/admin-functions.php2
-rw-r--r--wp-admin/categories.php4
-rw-r--r--wp-admin/export.php2
-rw-r--r--wp-admin/link-add.php2
-rw-r--r--wp-admin/plugins.php2
-rw-r--r--wp-admin/templates.php2
-rw-r--r--wp-includes/formatting.php15
-rw-r--r--xmlrpc.php39
8 files changed, 40 insertions, 28 deletions
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 438aa47..07e9cc8 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -561,7 +561,7 @@ function add_link() {
function edit_link( $link_id = '' ) {
if (!current_user_can( 'manage_links' ))
- wp_die( __( 'Cheatin&8217; uh?' ));
+ wp_die( __( 'Cheatin&#8217; uh?' ));
$_POST['link_url'] = wp_specialchars( $_POST['link_url'] );
$_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url'];
diff --git a/wp-admin/categories.php b/wp-admin/categories.php
index a101727..f7a04f9 100644
--- a/wp-admin/categories.php
+++ b/wp-admin/categories.php
@@ -34,10 +34,10 @@ case 'delete':
// Don't delete the default cats.
if ( $cat_ID == get_option('default_category') )
- wp_die(sprintf(__("Can&8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
+ wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
if ( $cat_ID == get_option('default_link_category') )
- wp_die(sprintf(__("Can&8217;t delete the <strong>%s</strong> category: this is the default one for links"), $cat_name));
+ wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one for links"), $cat_name));
wp_delete_category($cat_ID);
diff --git a/wp-admin/export.php b/wp-admin/export.php
index e4bfbac..b763412 100644
--- a/wp-admin/export.php
+++ b/wp-admin/export.php
@@ -14,7 +14,7 @@ require_once ('admin-header.php');
<div class="narrow">
<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.'); ?></p>
-<p><?php _e('Once you&8217;ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
+<p><?php _e('Once you&#8217;ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
<form action="" method="get">
<h3><?php _e('Optional options'); ?></h3>
diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php
index 2f7ed78..fca6c3e 100644
--- a/wp-admin/link-add.php
+++ b/wp-admin/link-add.php
@@ -28,7 +28,7 @@ require('admin-header.php');
<div id="wp-link-bookmarklet" class="wrap">
<h3><?php _e('Add Link Bookmarklet'); ?></h3>
-<p><?php _e('Right click on the following link and choose "Bookmark This Link..." to create an add link shortcut. Right now this only works on Mozilla or Netscape, but we&8217;re working on it.'); ?></p>
+<p><?php _e('Right click on the following link and choose "Bookmark This Link..." to create an add link shortcut. Right now this only works on Mozilla or Netscape, but we&#8217;re working on it.'); ?></p>
<?php printf('<p><a href="%s" title="'.__('Link add bookmarklet').'">'.__('Link This').'</a></p>', "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&amp;linkurl='+escape(location.href)+'&amp;name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?>
</div>
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index dc8fa28..2889b13 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -86,7 +86,7 @@ $plugins = get_plugins();
if (empty($plugins)) {
echo '<p>';
- _e("Couldn&8217;t open plugins directory or there are no plugins available."); // TODO: make more helpful
+ _e("Couldn&#8217;t open plugins directory or there are no plugins available."); // TODO: make more helpful
echo '</p>';
} else {
?>
diff --git a/wp-admin/templates.php b/wp-admin/templates.php
index b032494..7453992 100644
--- a/wp-admin/templates.php
+++ b/wp-admin/templates.php
@@ -99,7 +99,7 @@ if ( $recents ) :
<?php
echo '<ol>';
foreach ($recents as $recent) :
- echo "<li><a href='templates.php?file=" . attribute_escape($recent) . "'>" . get_file_description(basename($recent)) . "</a></li>";
+ echo "<li><a href='templates.php?file=" . attribute_escape($recent) . "'>" . wp_specialchars(get_file_description(basename($recent))) . "</a></li>";
endforeach;
echo '</ol>';
endif;
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index badd080..963992d 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -421,6 +421,7 @@ function funky_javascript_fix($text) {
Balances Tags of string using a modified stack.
@param text Text to be balanced
+ @param force Forces balancing, ignoring the value of the option
@return Returns balanced text
@author Leonard Lin (leonard@acm.org)
@version v1.1
@@ -429,12 +430,12 @@ function funky_javascript_fix($text) {
@notes
@changelog
--- Modified by Scott Reilly (coffee2code) 02 Aug 2004
- 1.2 ***TODO*** Make better - change loop condition to $text
- 1.1 Fixed handling of append/stack pop order of end text
- Added Cleaning Hooks
- 1.0 First Version
+ 1.2 ***TODO*** Make better - change loop condition to $text
+ 1.1 Fixed handling of append/stack pop order of end text
+ Added Cleaning Hooks
+ 1.0 First Version
*/
-function balanceTags($text, $is_comment = 0, $force = false) {
+function balanceTags($text, $force = false) {
if ( !$force && get_option('use_balanceTags') == 0 )
return $text;
@@ -536,7 +537,7 @@ function balanceTags($text, $is_comment = 0, $force = false) {
}
function force_balance_tags($text) {
- return balanceTags($text, 0, true);
+ return balanceTags($text, true);
}
function format_to_edit($content, $richedit = false) {
@@ -764,7 +765,7 @@ function human_time_diff( $from, $to = '' ) {
if ($days <= 1) {
$days = 1;
}
- $since = sprintf(__('%s day', '%s days', $days), $days);
+ $since = sprintf(__ngettext('%s day', '%s days', $days), $days);
}
return $since;
}
diff --git a/xmlrpc.php b/xmlrpc.php
index 8e50581..15f3276 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -1223,25 +1223,36 @@ class wp_xmlrpc_server extends IXR_Server {
$p = explode( "\n\n", $linea );
- $sem_regexp_pb = "/(\\/|\\\|\*|\?|\+|\.|\^|\\$|\(|\)|\[|\]|\||\{|\})/";
- $sem_regexp_fix = "\\\\$1";
- $link = preg_replace( $sem_regexp_pb, $sem_regexp_fix, $pagelinkedfrom );
+ $preg_target = preg_quote($pagelinkedto);
- $finished = false;
foreach ( $p as $para ) {
- if ( $finished )
- continue;
- if ( strstr( $para, $pagelinkedto ) ) {
- $context = preg_replace( "/.*<a[^>]+".$link."[^>]*>([^>]+)<\/a>.*/", "$1", $para );
- $excerpt = strip_tags( $para );
- $excerpt = trim( $excerpt );
- $use = preg_quote( $context );
- $excerpt = preg_replace("|.*?\s(.{0,100}$use.{0,100})\s|s", "$1", $excerpt);
- $finished = true;
+ if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
+ preg_match("|<a[^>]+?".$preg_target."[^>]*>([^>]+?)</a>|", $para, $context);
+
+ // If the URL isn't in a link context, keep looking
+ if ( empty($context) )
+ continue;
+
+ // We're going to use this fake tag to mark the context in a bit
+ // the marker is needed in case the link text appears more than once in the paragraph
+ $excerpt = preg_replace('|\</?wpcontext\>|', '', $para);
+
+ // prevent really long link text
+ if ( strlen($context[1]) > 100 )
+ $context[1] = substr($context[1], 0, 100) . '...';
+
+ $marker = '<wpcontext>'.$context[1].'</wpcontext>'; // set up our marker
+ $excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
+ $excerpt = strip_tags($excerpt, '<wpcontext>'); // strip all tags but our context marker
+ $excerpt = trim($excerpt);
+ $preg_marker = preg_quote($marker);
+ $excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
+ $excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
+ break;
}
}
- if ( empty($context) ) // URL pattern not found
+ if ( empty($context) ) // Link to target not found
return new IXR_Error(17, 'The source URL does not contain a link to the target URL, and so cannot be used as a source.');
$pagelinkedfrom = preg_replace('#&([^amp\;])#is', '&amp;$1', $pagelinkedfrom);