Changeset 829

Show
Ignore:
Timestamp:
01/02/07 10:42:08 (2 years ago)
Author:
donncha
Message:

WP Merge to #4669

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-functions.php

    r828 r829  
    562562function edit_link( $link_id = '' ) { 
    563563        if (!current_user_can( 'manage_links' )) 
    564                 wp_die( __( 'Cheatin&8217; uh?' )); 
     564                wp_die( __( 'Cheatin’ uh?' )); 
    565565 
    566566        $_POST['link_url'] = wp_specialchars( $_POST['link_url'] ); 
  • trunk/wp-admin/categories.php

    r828 r829  
    3535        // Don't delete the default cats. 
    3636    if ( $cat_ID == get_option('default_category') ) 
    37                 wp_die(sprintf(__("Can&8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name)); 
     37                wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name)); 
    3838 
    3939    if ( $cat_ID == get_option('default_link_category') ) 
    40                 wp_die(sprintf(__("Can&8217;t delete the <strong>%s</strong> category: this is the default one for links"), $cat_name)); 
     40                wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one for links"), $cat_name)); 
    4141 
    4242        wp_delete_category($cat_ID); 
  • trunk/wp-admin/export.php

    r828 r829  
    1515<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p> 
    1616<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.'); ?></p> 
    17 <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> 
     17<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> 
    1818<form action="" method="get"> 
    1919<h3><?php _e('Optional options'); ?></h3> 
  • trunk/wp-admin/link-add.php

    r828 r829  
    2929<div id="wp-link-bookmarklet"  class="wrap"> 
    3030<h3><?php _e('Add Link Bookmarklet'); ?></h3> 
    31 <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> 
     31<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> 
    3232<?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();") ?> 
    3333</div> 
  • trunk/wp-admin/plugins.php

    r828 r829  
    8787if (empty($plugins)) { 
    8888        echo '<p>'; 
    89         _e("Couldn&8217;t open plugins directory or there are no plugins available."); // TODO: make more helpful 
     89        _e("Couldn&#8217;t open plugins directory or there are no plugins available."); // TODO: make more helpful 
    9090        echo '</p>'; 
    9191} else { 
  • trunk/wp-admin/templates.php

    r828 r829  
    100100echo '<ol>'; 
    101101foreach ($recents as $recent) : 
    102         echo "<li><a href='templates.php?file=" . attribute_escape($recent) . "'>" . get_file_description(basename($recent)) . "</a></li>"; 
     102        echo "<li><a href='templates.php?file=" . attribute_escape($recent) . "'>" . wp_specialchars(get_file_description(basename($recent))) . "</a></li>"; 
    103103endforeach; 
    104104echo '</ol>'; 
  • trunk/wp-includes/formatting.php

    r828 r829  
    422422 
    423423 @param text      Text to be balanced 
     424 @param force     Forces balancing, ignoring the value of the option 
    424425 @return          Returns balanced text 
    425426 @author          Leonard Lin (leonard@acm.org) 
     
    430431 @changelog 
    431432 ---  Modified by Scott Reilly (coffee2code) 02 Aug 2004 
    432                                                 1.2  ***TODO*** Make better - change loop condition to $text 
    433                                                 1.1  Fixed handling of append/stack pop order of end text 
    434                                                                        Added Cleaning Hooks 
    435                                                 1.0  First Version 
     433        1.2  ***TODO*** Make better - change loop condition to $text 
     434        1.1  Fixed handling of append/stack pop order of end text 
     435             Added Cleaning Hooks 
     436        1.0  First Version 
    436437*/ 
    437 function balanceTags($text, $is_comment = 0, $force = false) { 
     438function balanceTags($text, $force = false) { 
    438439 
    439440        if ( !$force && get_option('use_balanceTags') == 0 ) 
     
    537538 
    538539function force_balance_tags($text) { 
    539         return balanceTags($text, 0, true); 
     540        return balanceTags($text, true); 
    540541} 
    541542 
     
    765766                        $days = 1; 
    766767                } 
    767                 $since = sprintf(__('%s day', '%s days', $days), $days); 
     768                $since = sprintf(__ngettext('%s day', '%s days', $days), $days); 
    768769        } 
    769770        return $since; 
  • trunk/xmlrpc.php

    r827 r829  
    12241224                $p = explode( "\n\n", $linea ); 
    12251225 
    1226                 $sem_regexp_pb = "/(\\/|\\\|\*|\?|\+|\.|\^|\\$|\(|\)|\[|\]|\||\{|\})/"; 
    1227                 $sem_regexp_fix = "\\\\$1"; 
    1228                 $link = preg_replace( $sem_regexp_pb, $sem_regexp_fix, $pagelinkedfrom ); 
    1229  
    1230                 $finished = false; 
     1226                $preg_target = preg_quote($pagelinkedto); 
     1227 
    12311228                foreach ( $p as $para ) { 
    1232                         if ( $finished ) 
    1233                                 continue; 
    1234                         if ( strstr( $para, $pagelinkedto ) ) { 
    1235                                 $context = preg_replace( "/.*<a[^>]+".$link."[^>]*>([^>]+)<\/a>.*/", "$1", $para ); 
    1236                                 $excerpt = strip_tags( $para ); 
    1237                                 $excerpt = trim( $excerpt ); 
    1238                                 $use     = preg_quote( $context ); 
    1239                                 $excerpt = preg_replace("|.*?\s(.{0,100}$use.{0,100})\s|s", "$1", $excerpt); 
    1240                                 $finished = true; 
     1229                        if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link? 
     1230                                preg_match("|<a[^>]+?".$preg_target."[^>]*>([^>]+?)</a>|", $para, $context); 
     1231 
     1232                                // If the URL isn't in a link context, keep looking 
     1233                                if ( empty($context) ) 
     1234                                        continue; 
     1235 
     1236                                // We're going to use this fake tag to mark the context in a bit 
     1237                                // the marker is needed in case the link text appears more than once in the paragraph 
     1238                                $excerpt = preg_replace('|\</?wpcontext\>|', '', $para); 
     1239 
     1240                                // prevent really long link text 
     1241                                if ( strlen($context[1]) > 100 ) 
     1242                                        $context[1] = substr($context[1], 0, 100) . '...'; 
     1243 
     1244                                $marker = '<wpcontext>'.$context[1].'</wpcontext>';    // set up our marker 
     1245                                $excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker 
     1246                                $excerpt = strip_tags($excerpt, '<wpcontext>');        // strip all tags but our context marker 
     1247                                $excerpt = trim($excerpt); 
     1248                                $preg_marker = preg_quote($marker); 
     1249                                $excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt); 
     1250                                $excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper 
     1251                                break; 
    12411252                        } 
    12421253                } 
    12431254 
    1244                 if ( empty($context) ) // URL pattern not found 
     1255                if ( empty($context) ) // Link to target not found 
    12451256                        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.'); 
    12461257