Compare commits

..

32 Commits

Author SHA1 Message Date
ryan
b754b95b9c Fix path to xmlrpc. Props MidnighToker. fixes #9516
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-04-14 19:15:21 +00:00
ryan
bfcca39939 robots.txt is not home. Props johnbillion. fixes #9482 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-04-13 16:15:59 +00:00
azaozz
ddaf00492d Fix confirmation for second bulk delete, fixes #9473 for 2.7.2
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-04-06 22:37:51 +00:00
westi
ab394b7665 Move byuser to a seperate array entry to ease filtering by plugins. Fixes #9465 for 2.7 branch props hakre.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-04-05 17:48:24 +00:00
westi
d6926a1f65 Set a short timeout for the SSL discovery support so that we don't block requests until the attempt timesout. Fixes #9380 for 2.7.2 props josephscott
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-23 22:20:41 +00:00
ryan
01725d680a Pass the unprocessed title to the sanitize_title filter. Props chineseleper. fixes #8981 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-17 17:43:57 +00:00
ryan
876fc98410 Remove category ordering. Props filosofo. fixes #9228 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-13 22:01:50 +00:00
ryan
a3a543708e Remember page when redirecting after tag edit. Props Viper007Bond. fixes #9220 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-13 05:24:35 +00:00
ryan
dcc5b55d46 Add core_version_check_locale filter. Props nbachiyski. see #8729 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-11 23:37:45 +00:00
ryan
df231af292 Reparent children when deleting a comment. Props vladimir_kolesnikov. fixes #9003 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-10 19:03:03 +00:00
ryan
1f31649051 Create user object. Props mark8barnes. fixes #9309 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-10 18:38:35 +00:00
westi
4b701a0713 Attachment metadata is stored in the summary field in AtomPub requests. Fixes #9148 for 2.7.2 props josephscott.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-09 22:41:48 +00:00
ryan
3f9c011410 Escape dot in regex. Props pne, sivel. fixes #9088 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-05 20:17:41 +00:00
ryan
778ff4a527 Avoid double encoding of attachment descriptions. Props dwc. fixes #9168 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-04 19:37:52 +00:00
ryan
2f30019e35 Nested install fixes. Props sivel. fixes #7997 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-04 19:30:39 +00:00
westi
15d96da0f4 Display the search query when searching users. Fixes #9265 for 2.7.2 props johnbillion.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-04 08:20:32 +00:00
azaozz
c7c43d0c77 Fix typo, props sambauers for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-02 00:32:22 +00:00
ryan
49d30a54c6 Escape hyphen in regex. Props chrisbliss18. fixes #8548 #9244 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-03-01 19:59:41 +00:00
westi
b872682b9b Ensure that updating an uploaded file using AtomPub works correct. Fixes #9233 for 2.7.2 props josephscott
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-27 18:39:19 +00:00
ryan
c55d125063 Return correct edit link. Props josephscott. fixes #9147 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-26 00:04:11 +00:00
ryan
219ce056c2 Escape before passing to insert/update post. Props hailin. fixes #9199 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-22 00:36:00 +00:00
westi
7a92c50bf0 Remove version check against PHP 4.3.0 as this is the minimum version for WordPress. Fixes #9204 for 2.7 branch prop filosofo.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-21 17:25:02 +00:00
azaozz
1c38c52b64 Fix regex in function rss_enclosure(), fixes #9192 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-21 06:24:34 +00:00
ryan
91b2a262ba Append .txt to import files rather than .import. Props donncha
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-20 21:39:32 +00:00
ryan
1752026950 Add some escaping
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-20 21:36:09 +00:00
ryan
484c5295e5 Remove meta_value from selected fields. Props filosofo. fixes #9177 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-19 19:19:47 +00:00
ryan
9721bf8f00 Use group by for meta key queries. Props filosofo. fixes #9167 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-19 19:17:22 +00:00
ryan
c3b88c06ae Bump
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-18 05:01:42 +00:00
westi
01a09570e8 Fix typo in action body for pingback.extensions.getPingbacks. Fixes #9157 for 2.7.x props josephscott.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-17 23:12:18 +00:00
ryan
c2321cbbb0 Don't put any wp-content files in the old files list.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-11 21:38:58 +00:00
ryan
3a3f2632d9 Use right variable name. Props stringfold. fixes #9090 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-11 19:50:00 +00:00
ryan
59ccfa89ff If no angle brackets, assume email address. Props donncha. fixes #9086 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-02-10 23:55:07 +00:00
31 changed files with 81 additions and 62 deletions

View File

@@ -294,7 +294,7 @@ if ( $page_links )
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected categories.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
}

View File

@@ -378,7 +378,7 @@ if ( $page_links )
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected comments.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
}

View File

@@ -229,7 +229,7 @@ if ( $page_links )
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected link categories.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
}

View File

@@ -317,7 +317,7 @@ endif; // posts;
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected pages.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
}

View File

@@ -43,7 +43,14 @@ case 'delete':
wp_delete_term( $tag_ID, 'post_tag');
wp_redirect('edit-tags.php?message=2');
$location = 'edit-tags.php';
if ( $referer = wp_get_referer() ) {
if ( false !== strpos($referer, 'edit-tags.php') )
$location = $referer;
}
$location = add_query_arg('message', 2, $location);
wp_redirect($location);
exit;
break;
@@ -260,13 +267,13 @@ else
<div class="form-field form-required">
<label for="name"><?php _e('Tag name') ?></label>
<input name="name" id="name" type="text" value="" size="40" aria-required="true" />
<p><?php _e('The name is how the tag appears on your site.'); ?></p>
<p><?php _e('The name is how the tag appears on your site.'); ?></p>
</div>
<div class="form-field">
<label for="slug"><?php _e('Tag slug') ?></label>
<input name="slug" id="slug" type="text" value="" size="40" />
<p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
<p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
</div>
<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Tag'); ?>" /></p>
@@ -285,7 +292,7 @@ else
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected tags.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
}

View File

@@ -301,7 +301,7 @@ if ( $page_links )
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected posts.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
}

View File

@@ -39,7 +39,7 @@ class MT_Import {
<p><?php _e('Howdy! We&#8217;re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click "Upload file and import," or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
<form method="post" action="<?php echo add_query_arg('step', 1); ?>" class="import-upload-form">
<form method="post" action="<?php echo attribute_escape(add_query_arg('step', 1)); ?>" class="import-upload-form">
<?php wp_nonce_field('import-upload'); ?>
<p>

View File

@@ -92,6 +92,7 @@ foreach ($categories as $category) {
$blogrolling = true;
} else { // try to get the upload file.
$overrides = array('test_form' => false, 'test_type' => false);
$_FILES['userfile']['name'] .= '.txt';
$file = wp_handle_upload($_FILES['userfile'], $overrides);
if ( isset($file['error']) )

View File

@@ -60,7 +60,7 @@ function wp_import_cleanup( $id ) {
*/
function wp_import_handle_upload() {
$overrides = array( 'test_form' => false, 'test_type' => false );
$_FILES['import']['name'] .= '.import';
$_FILES['import']['name'] .= '.txt';
$file = wp_handle_upload( $_FILES['import'], $overrides );
if ( isset( $file['error'] ) )

View File

@@ -1167,7 +1167,7 @@ function get_media_item( $attachment_id, $args = null ) {
if ( !empty($field[$field['input']]) )
$item .= $field[$field['input']];
elseif ( $field['input'] == 'textarea' ) {
$item .= "<textarea type='text' id='$name' name='$name'" . $aria_required . ">" . htmlspecialchars( $field['value'] ) . "</textarea>";
$item .= "<textarea type='text' id='$name' name='$name'" . $aria_required . ">" . wp_specialchars( $field['value'] ) . "</textarea>";
} else {
$item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "'" . $aria_required . "/>";
}

View File

@@ -161,11 +161,7 @@ $_old_files = array(
'wp-images/smilies',
'wp-images/wp-small.png',
'wp-images/wpminilogo.png',
'wp.php',
'wp-content/themes/default/attachment.php',
'wp-content/themes/default/images/kubrickbg.jpg',
'wp-content/plugins/markdown.php',
'wp-content/plugins/textile1.php',
'wp.php'
);
/**

View File

@@ -393,6 +393,8 @@ function wp_delete_user($id, $reassign = 'novalue') {
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
$user = new WP_User($id);
wp_cache_delete($id, 'users');
wp_cache_delete($user->user_login, 'userlogins');
wp_cache_delete($user->user_email, 'useremail');

View File

@@ -168,7 +168,7 @@ if ( $links ) {
$link->link_name = attribute_escape($link->link_name);
$link->link_category = wp_get_link_cats($link->link_id);
$short_url = str_replace('http://', '', $link->link_url);
$short_url = preg_replace('/^www./i', '', $short_url);
$short_url = preg_replace('/^www\./i', '', $short_url);
if ('/' == substr($short_url, -1))
$short_url = substr($short_url, 0, -1);
if (strlen($short_url) > 35)
@@ -275,7 +275,7 @@ if ( $links ) {
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected links.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
}

View File

@@ -42,8 +42,8 @@ if ( !is_writable('../'))
if (file_exists('../wp-config.php'))
wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
// Check if wp-config.php exists above the root directory
if (file_exists('../../wp-config.php') && ! file_exists('../../wp-load.php'))
// Check if wp-config.php exists above the root directory but is not part of another install
if (file_exists('../../wp-config.php') && ! file_exists('../../wp-settings.php'))
wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
if (isset($_GET['step']))

View File

@@ -415,7 +415,7 @@ if ( $page_links )
(function($){
$(document).ready(function(){
$('#doaction, #doaction2').click(function(e){
if ( $('select[name^="action"]').val() == 'delete' ) {
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
var m = '<?php echo js_escape(__("You are about to delete the selected attachments.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
return showNotice.warn(m);
} else if ( $('select[name^="action"]').val() == 'attach' ) {

View File

@@ -240,8 +240,8 @@ if ( ! empty($messages) ) {
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo wp_specialchars( $title );
if ( isset($_GET['s']) && $_GET['s'] )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', wp_specialchars( get_search_query() ) ); ?>
if ( isset($_GET['usersearch']) && $_GET['usersearch'] )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', wp_specialchars( $_GET['usersearch'] ) ); ?>
</h2>
<div class="filter">

View File

@@ -26,6 +26,9 @@ require_once(ABSPATH . WPINC . '/atomlib.php');
/** Feed Handling API */
require_once(ABSPATH . WPINC . '/feed.php');
/** Admin Image API for metadata updating */
require_once(ABSPATH . '/wp-admin/includes/image.php');
$_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] );
/**
@@ -698,7 +701,7 @@ EOD;
extract($entry);
$post_title = $parsed->title[1];
$post_content = $parsed->content[1];
$post_content = $parsed->summary[1];
$pubtimes = $this->get_publish_time($parsed->updated);
$post_modified = $pubtimes[0];
$post_modified_gmt = $pubtimes[1];
@@ -814,9 +817,12 @@ EOD;
$this->auth_required(__('Sorry, you do not have the right to edit this post.'));
}
$upload_dir = wp_upload_dir( );
$location = get_post_meta($entry['ID'], '_wp_attached_file', true);
$filetype = wp_check_filetype($location);
$location = "{$upload_dir['basedir']}/{$location}";
if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
$this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
@@ -843,6 +849,8 @@ EOD;
$this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
}
wp_update_attachment_metadata( $postID, wp_generate_attachment_metadata( $postID, $location ) );
log_app('function',"put_file($postID)");
$this->ok();
}
@@ -1067,6 +1075,8 @@ EOD;
log_app('function',"get_feed($page, '$post_type')");
ob_start();
$this->ENTRY_PATH = $post_type;
if(!isset($page)) {
$page = 1;
}
@@ -1136,6 +1146,7 @@ EOD;
$varname = 'p';
break;
case 'attachment':
$this->ENTRY_PATH = 'attachment';
$varname = 'attachment_id';
break;
}

View File

@@ -292,7 +292,8 @@ function get_comment_class( $class = '', $comment_id = null, $post_id = null ) {
// If the comment author has an id (registered), then print the log in name
if ( $comment->user_id > 0 && $user = get_userdata($comment->user_id) ) {
// For all registered users, 'byuser'
$classes[] = 'byuser comment-author-' . $user->user_nicename;
$classes[] = 'byuser';
$classes[] = 'comment-author-' . $user->user_nicename;
// For comment authors who are the author of the post
if ( $post = get_post($post_id) ) {
if ( $comment->user_id === $post->post_author )

View File

@@ -739,6 +739,13 @@ function wp_delete_comment($comment_id) {
if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) )
return false;
// Move children up a level.
$children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment_id) );
if ( !empty($children) ) {
$wpdb->update($wpdb->comments, array('comment_parent' => $comment->comment_parent), array('comment_parent' => $comment_id));
clean_comment_cache($children);
}
$post_id = $comment->comment_post_ID;
if ( $post_id && $comment->comment_approved == 1 )
wp_update_comment_count($post_id);
@@ -1542,10 +1549,11 @@ function weblog_ping($server = '', $path = '') {
* @package WordPress
* @subpackage Cache
*
* @param int $id Comment ID to remove from cache
* @param int|array $id Comment ID or array of comment IDs to remove from cache
*/
function clean_comment_cache($id) {
wp_cache_delete($id, 'comment');
function clean_comment_cache($ids) {
foreach ( (array) $ids as $id )
wp_cache_delete($id, 'comment');
}
/**

View File

@@ -99,7 +99,7 @@ function _mb_strcut( $str, $start, $length=null, $encoding=null ) {
if ( !function_exists( 'htmlspecialchars_decode' ) ) {
// Added in PHP 5.1.0
// Error checks from PEAR::PHP_Compat
function htmlspecialchars_decode( $str, $quote_style = ENT_COMPAT )
function htmlspecialchars_decode( $string, $quote_style = ENT_COMPAT )
{
if ( !is_scalar( $string ) ) {
trigger_error( 'htmlspecialchars_decode() expects parameter 1 to be string, ' . gettype( $string ) . ' given', E_USER_WARNING );
@@ -111,7 +111,7 @@ if ( !function_exists( 'htmlspecialchars_decode' ) ) {
return;
}
return wp_specialchars_decode( $str, $quote_style );
return wp_specialchars_decode( $string, $quote_style );
}
}

View File

@@ -403,10 +403,10 @@ function rss_enclosure() {
foreach ( (array) get_post_custom() as $key => $val) {
if ($key == 'enclosure') {
foreach ( (array) $val as $enc ) {
$enclosure = split("\n", $enc);
$enclosure = explode("\n", $enc);
//only get the the first element eg, audio/mpeg from 'audio/mpeg mpga mp2 mp3'
$t = split('[ \t]', trim($enclosure[2]) );
$t = preg_split('/[ \t]/', trim($enclosure[2]) );
$type = $t[0];
echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . $type . '" />' . "\n");

View File

@@ -637,8 +637,9 @@ function sanitize_user( $username, $strict = false ) {
* @return string The sanitized string.
*/
function sanitize_title($title, $fallback_title = '') {
$raw_title = $title;
$title = strip_tags($title);
$title = apply_filters('sanitize_title', $title);
$title = apply_filters('sanitize_title', $title, $raw_title);
if ( '' === $title || false === $title )
$title = $fallback_title;

View File

@@ -1388,10 +1388,7 @@ function status_header( $header ) {
if ( function_exists( 'apply_filters' ) )
$status_header = apply_filters( 'status_header', $status_header, $header, $text, $protocol );
if ( version_compare( phpversion(), '4.3.0', '>=' ) )
return @header( $status_header, true, $header );
else
return @header( $status_header );
return @header( $status_header, true, $header );
}
/**
@@ -2621,6 +2618,7 @@ function url_is_accessable_via_ssl($url)
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_exec($ch);
@@ -2912,6 +2910,4 @@ function wp_clone( $object ) {
}
return $can_clone ? clone( $object ) : $object;
}
?>

View File

@@ -306,7 +306,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
$from_email = str_replace( '>', '', $from_email );
$from_email = trim( $from_email );
} else {
$from_name = trim( $content );
$from_email = trim( $content );
}
} elseif ( 'content-type' == strtolower($name) ) {
if ( strpos( $content,';' ) !== false ) {
@@ -1251,7 +1251,7 @@ function wp_salt($scheme = 'auth') {
$secret_key = SECURE_AUTH_KEY;
if ( defined('SECURE_AUTH_SALT') ) {
$salt = SECRET_AUTH_SALT;
$salt = SECURE_AUTH_SALT;
} else {
$salt = get_option('secure_auth_salt');
if ( empty($salt) ) {

View File

@@ -3456,7 +3456,8 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
$post = _wp_post_revision_fields( $post, $autosave );
$post = add_magic_quotes($post); //since data is from db
$revision_id = wp_insert_post( $post );
if ( is_wp_error($revision_id) )
return $revision_id;
@@ -3532,6 +3533,8 @@ function wp_restore_post_revision( $revision_id, $fields = null ) {
return false;
$update['ID'] = $revision['post_parent'];
$update = add_magic_quotes( $update ); //since data is from db
$post_id = wp_update_post( $update );
if ( is_wp_error( $post_id ) )

View File

@@ -1451,7 +1451,7 @@ class WP_Query {
if ( $this->is_feed && ( !empty($qv['withcomments']) || ( empty($qv['withoutcomments']) && $this->is_singular ) ) )
$this->is_comment_feed = true;
if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup ) )
if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup || $this->is_robots ) )
$this->is_home = true;
// Correct is_* for page_on_front and page_for_posts
@@ -1789,10 +1789,6 @@ class WP_Query {
$q['cat'] = implode(',', $req_cats);
}
if ( !empty($q['category__in']) ) {
$groupby = "{$wpdb->posts}.ID";
}
if ( !empty($q['category__in']) ) {
$join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
$whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
@@ -1869,7 +1865,7 @@ class WP_Query {
}
}
if ( !empty($q['tag__in']) || !empty($q['tag_slug__in']) ) {
if ( !empty($q['category__in']) || !empty($q['meta_key']) || !empty($q['tag__in']) || !empty($q['tag_slug__in']) ) {
$groupby = "{$wpdb->posts}.ID";
}
@@ -2023,7 +2019,7 @@ class WP_Query {
$q['orderby'] = "$wpdb->posts.post_date ".$q['order'];
} else {
// Used to filter values
$allowed_keys = array('author', 'date', 'category', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand');
$allowed_keys = array('author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand');
if ( !empty($q['meta_key']) ) {
$allowed_keys[] = $q['meta_key'];
$allowed_keys[] = 'meta_value';
@@ -2214,9 +2210,6 @@ class WP_Query {
$distinct = apply_filters('posts_distinct', $distinct);
$limits = apply_filters( 'post_limits', $limits );
if ( ! empty($q['meta_key']) )
$fields = "$fields, $wpdb->postmeta.meta_value";
$fields = apply_filters('posts_fields', $fields);
}

View File

@@ -849,7 +849,7 @@ function preview_theme() {
if ( !current_user_can( 'switch_themes' ) )
return;
$_GET['template'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['template']);
$_GET['template'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['template']);
if ( validate_file($_GET['template']) )
return;
@@ -857,7 +857,7 @@ function preview_theme() {
add_filter('template', create_function('', "return '{$_GET['template']}';") );
if ( isset($_GET['stylesheet']) ) {
$_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['stylesheet']);
$_GET['stylesheet'] = preg_replace('|[^a-z0-9_.\-/]|i', '', $_GET['stylesheet']);
if ( validate_file($_GET['stylesheet']) )
return;
add_filter('stylesheet', create_function('', "return '{$_GET['stylesheet']}';") );

View File

@@ -30,7 +30,7 @@ function wp_version_check() {
if ( ! is_object($current) )
$current = new stdClass;
$locale = get_locale();
$locale = apply_filters( 'core_version_check_locale', get_locale() );
if (
isset( $current->last_checked ) &&
43200 > ( time() - $current->last_checked ) &&

View File

@@ -8,7 +8,7 @@
*
* @global string $wp_version
*/
$wp_version = '2.7.1';
$wp_version = '2.7.2-alpha';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@@ -26,9 +26,9 @@ if ( file_exists( ABSPATH . 'wp-config.php') ) {
/** The config file resides in ABSPATH */
require_once( ABSPATH . 'wp-config.php' );
} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) && ! file_exists( dirname(ABSPATH) . '/wp-load.php' ) ) {
} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) && ! file_exists( dirname(ABSPATH) . '/wp-settings.php' ) ) {
/** The config file resides one level below ABSPATH */
/** The config file resides one level above ABSPATH but is not part of another install*/
require_once( dirname(ABSPATH) . '/wp-config.php' );
} else {

View File

@@ -441,7 +441,7 @@ class wp_xmlrpc_server extends IXR_Server {
'url' => get_option( 'home' ) . '/',
'blogid' => $blog_id,
'blogName' => get_option( 'blogname' ),
'xmlrpc' => get_option( 'home' ) . '/xmlrpc.php'
'xmlrpc' => site_url( 'xmlrpc.php' )
);
restore_current_blog( );
@@ -1593,7 +1593,7 @@ class wp_xmlrpc_server extends IXR_Server {
'url' => get_option('home') . '/',
'blogid' => '1',
'blogName' => get_option('blogname'),
'xmlrpc' => get_option('home') . '/xmlrpc.php',
'xmlrpc' => site_url( 'xmlrpc.php' )
);
return array($struct);
@@ -3341,7 +3341,7 @@ class wp_xmlrpc_server extends IXR_Server {
global $wpdb;
do_action('xmlrpc_call', 'pingback.extensions.getPingsbacks');
do_action('xmlrpc_call', 'pingback.extensions.getPingbacks');
$this->escape($args);