Compare commits
32 Commits
2.7.1
...
2.7-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b754b95b9c | ||
|
|
bfcca39939 | ||
|
|
ddaf00492d | ||
|
|
ab394b7665 | ||
|
|
d6926a1f65 | ||
|
|
01725d680a | ||
|
|
876fc98410 | ||
|
|
a3a543708e | ||
|
|
dcc5b55d46 | ||
|
|
df231af292 | ||
|
|
1f31649051 | ||
|
|
4b701a0713 | ||
|
|
3f9c011410 | ||
|
|
778ff4a527 | ||
|
|
2f30019e35 | ||
|
|
15d96da0f4 | ||
|
|
c7c43d0c77 | ||
|
|
49d30a54c6 | ||
|
|
b872682b9b | ||
|
|
c55d125063 | ||
|
|
219ce056c2 | ||
|
|
7a92c50bf0 | ||
|
|
1c38c52b64 | ||
|
|
91b2a262ba | ||
|
|
1752026950 | ||
|
|
484c5295e5 | ||
|
|
9721bf8f00 | ||
|
|
c3b88c06ae | ||
|
|
01a09570e8 | ||
|
|
c2321cbbb0 | ||
|
|
3a3f2632d9 | ||
|
|
59ccfa89ff |
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 “slug” 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 “slug” 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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class MT_Import {
|
||||
<p><?php _e('Howdy! We’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>
|
||||
|
||||
@@ -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']) )
|
||||
|
||||
@@ -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'] ) )
|
||||
|
||||
@@ -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 . "/>";
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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']))
|
||||
|
||||
@@ -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' ) {
|
||||
|
||||
@@ -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 “%s”') . '</span>', wp_specialchars( get_search_query() ) ); ?>
|
||||
if ( isset($_GET['usersearch']) && $_GET['usersearch'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', wp_specialchars( $_GET['usersearch'] ) ); ?>
|
||||
</h2>
|
||||
|
||||
<div class="filter">
|
||||
|
||||
13
wp-app.php
13
wp-app.php
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -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) ) {
|
||||
|
||||
@@ -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 ) )
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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']}';") );
|
||||
|
||||
@@ -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 ) &&
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user