Notice fixes from DD32. see #7509
git-svn-id: http://svn.automattic.com/wordpress/trunk@9596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3b65a42c5f
commit
545da15950
|
@ -77,8 +77,13 @@ $blog_name = get_bloginfo('name', 'display');
|
||||||
if ( '' == $blog_name )
|
if ( '' == $blog_name )
|
||||||
$blog_name = ' ';
|
$blog_name = ' ';
|
||||||
$title_class = '';
|
$title_class = '';
|
||||||
if ( function_exists('mb_strlen') && mb_strlen($blog_name, 'UTF-8') > 30 )
|
if ( function_exists('mb_strlen') ) {
|
||||||
|
if ( mb_strlen($blog_name, 'UTF-8') > 30 )
|
||||||
$title_class = 'class="long-title"';
|
$title_class = 'class="long-title"';
|
||||||
|
} else {
|
||||||
|
if ( strlen($blog_name) > 30 )
|
||||||
|
$title_class = 'class="long-title"';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<img id="logo50" src="images/wp-logo.gif" alt="" /> <h1 <?php echo $title_class ?>><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php _e('Visit site') ?>"><?php echo $blog_name ?></a></h1>
|
<img id="logo50" src="images/wp-logo.gif" alt="" /> <h1 <?php echo $title_class ?>><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php _e('Visit site') ?>"><?php echo $blog_name ?></a></h1>
|
||||||
|
|
|
@ -247,30 +247,29 @@ else
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ( $can_manage ) {
|
<?php if ( $can_manage ) {
|
||||||
do_action('add_tag_form_pre', $tag); ?>
|
do_action('add_tag_form_pre'); ?>
|
||||||
|
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<h3><?php _e('Add a New Tag'); ?></h3>
|
<h3><?php _e('Add a New Tag'); ?></h3>
|
||||||
<div id="ajax-response"></div>
|
<div id="ajax-response"></div>
|
||||||
<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">
|
<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">
|
||||||
<input type="hidden" name="action" value="addtag" />
|
<input type="hidden" name="action" value="addtag" />
|
||||||
<input type="hidden" name="tag_ID" value="<?php echo $tag->term_id ?>" />
|
|
||||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?>
|
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?>
|
||||||
|
|
||||||
<div class="form-field form-required">
|
<div class="form-field form-required">
|
||||||
<label for="name"><?php _e('Tag name') ?></label>
|
<label for="name"><?php _e('Tag name') ?></label>
|
||||||
<input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
|
<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>
|
||||||
|
|
||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
<label for="slug"><?php _e('Tag slug') ?></label>
|
<label for="slug"><?php _e('Tag slug') ?></label>
|
||||||
<input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
|
<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>
|
</div>
|
||||||
|
|
||||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Tag'); ?>" /></p>
|
<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Tag'); ?>" /></p>
|
||||||
<?php do_action('edit_tag_form', $tag); ?>
|
<?php do_action('add_tag_form'); ?>
|
||||||
</form></div>
|
</form></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ function wp_dashboard_setup() {
|
||||||
'home' => get_option('home'),
|
'home' => get_option('home'),
|
||||||
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||||
'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||||
'items' => $widget_options['dashboard_incoming_links']['items'],
|
'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
|
||||||
'show_date' => $widget_options['dashboard_incoming_links']['show_date']
|
'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
|
wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
|
||||||
|
|
|
@ -25,8 +25,8 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||||
|
|
||||||
if ( $update )
|
if ( $update )
|
||||||
$post_data['ID'] = (int) $post_data['post_ID'];
|
$post_data['ID'] = (int) $post_data['post_ID'];
|
||||||
$post_data['post_content'] = $post_data['content'];
|
$post_data['post_content'] = isset($post_data['content']) ? $post_data['content'] : '';
|
||||||
$post_data['post_excerpt'] = $post_data['excerpt'];
|
$post_data['post_excerpt'] = isset($post_data['excerpt']) ? $post_data['excerpt'] : '';
|
||||||
$post_data['post_parent'] = isset($post_data['parent_id'])? $post_data['parent_id'] : '';
|
$post_data['post_parent'] = isset($post_data['parent_id'])? $post_data['parent_id'] : '';
|
||||||
if ( isset($post_data['trackback_url']) )
|
if ( isset($post_data['trackback_url']) )
|
||||||
$post_data['to_ping'] = $post_data['trackback_url'];
|
$post_data['to_ping'] = $post_data['trackback_url'];
|
||||||
|
@ -71,7 +71,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||||
if ( isset($post_data['pending']) && '' != $post_data['pending'] )
|
if ( isset($post_data['pending']) && '' != $post_data['pending'] )
|
||||||
$post_data['post_status'] = 'pending';
|
$post_data['post_status'] = 'pending';
|
||||||
|
|
||||||
$previous_status = get_post_field('post_status', $post_data['ID']);
|
$previous_status = get_post_field('post_status', isset($post_data['ID']) ? $post_data['ID'] : $post_data['temp_ID']);
|
||||||
|
|
||||||
// Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
|
// Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
|
||||||
// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
|
// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
|
||||||
|
|
|
@ -3166,7 +3166,7 @@ function screen_meta($screen) {
|
||||||
<form id="adv-settings" action="" method="get">
|
<form id="adv-settings" action="" method="get">
|
||||||
<div class="metabox-prefs">
|
<div class="metabox-prefs">
|
||||||
<?php
|
<?php
|
||||||
if ( !meta_box_prefs($screen) ) {
|
if ( !meta_box_prefs($screen) && isset($column_screens[$screen]) ) {
|
||||||
manage_columns_prefs($column_screens[$screen]);
|
manage_columns_prefs($column_screens[$screen]);
|
||||||
wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false );
|
wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false );
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,9 +89,9 @@ switch($step) {
|
||||||
|
|
||||||
display_header();
|
display_header();
|
||||||
// Fill in the data we gathered
|
// Fill in the data we gathered
|
||||||
$weblog_title = stripslashes($_POST['weblog_title']);
|
$weblog_title = isset($_POST['weblog_title']) ? stripslashes($_POST['weblog_title']) : '';
|
||||||
$admin_email = stripslashes($_POST['admin_email']);
|
$admin_email = isset($_POST['admin_email']) ? stripslashes($_POST['admin_email']) : '';
|
||||||
$public = (int) $_POST['blog_public'];
|
$public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0;
|
||||||
// check e-mail address
|
// check e-mail address
|
||||||
if (empty($admin_email)) {
|
if (empty($admin_email)) {
|
||||||
// TODO: poka-yoke
|
// TODO: poka-yoke
|
||||||
|
|
|
@ -34,18 +34,18 @@ function redirect_page($page_ID) {
|
||||||
} elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
|
} elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
|
||||||
$location = 'sidebar.php?a=b';
|
$location = 'sidebar.php?a=b';
|
||||||
} elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
|
} elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
|
||||||
if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false )
|
if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false )
|
||||||
$location = add_query_arg( array(
|
$location = add_query_arg( array(
|
||||||
'_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
|
'_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
|
||||||
'message' => 1
|
'message' => 1
|
||||||
), get_edit_post_link( $page_ID, 'url' ) );
|
), get_edit_post_link( $page_ID, 'url' ) );
|
||||||
else
|
else
|
||||||
$location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
|
$location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
|
||||||
} elseif ($_POST['addmeta']) {
|
} elseif ( isset($_POST['addmeta']) ) {
|
||||||
$location = add_query_arg( 'message', 2, wp_get_referer() );
|
$location = add_query_arg( 'message', 2, wp_get_referer() );
|
||||||
$location = explode('#', $location);
|
$location = explode('#', $location);
|
||||||
$location = $location[0] . '#postcustom';
|
$location = $location[0] . '#postcustom';
|
||||||
} elseif ($_POST['deletemeta']) {
|
} elseif ( isset($_POST['deletemeta']) ) {
|
||||||
$location = add_query_arg( 'message', 3, wp_get_referer() );
|
$location = add_query_arg( 'message', 3, wp_get_referer() );
|
||||||
$location = explode('#', $location);
|
$location = explode('#', $location);
|
||||||
$location = $location[0] . '#postcustom';
|
$location = $location[0] . '#postcustom';
|
||||||
|
|
|
@ -39,7 +39,7 @@ function redirect_post($post_ID = '') {
|
||||||
elseif ( isset($_POST['publish']) )
|
elseif ( isset($_POST['publish']) )
|
||||||
$location = 'sidebar.php?a=b';
|
$location = 'sidebar.php?a=b';
|
||||||
} elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
|
} elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
|
||||||
if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
|
if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
|
||||||
$location = add_query_arg( array(
|
$location = add_query_arg( array(
|
||||||
'_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
|
'_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
|
||||||
'message' => 1
|
'message' => 1
|
||||||
|
|
|
@ -1392,11 +1392,12 @@ function pingback($content, $post_ID) {
|
||||||
foreach ( (array) $post_links_temp[0] as $link_test ) :
|
foreach ( (array) $post_links_temp[0] as $link_test ) :
|
||||||
if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself
|
if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself
|
||||||
&& !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
|
&& !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
|
||||||
$test = parse_url($link_test);
|
if ( $test = @parse_url($link_test) ) {
|
||||||
if ( isset($test['query']) )
|
if ( isset($test['query']) )
|
||||||
$post_links[] = $link_test;
|
$post_links[] = $link_test;
|
||||||
elseif ( ($test['path'] != '/') && ($test['path'] != '') )
|
elseif ( ($test['path'] != '/') && ($test['path'] != '') )
|
||||||
$post_links[] = $link_test;
|
$post_links[] = $link_test;
|
||||||
|
}
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
|
|
@ -179,6 +179,7 @@ var autosave = function() {
|
||||||
post_data["excerpt"] = jQuery("#excerpt").val();
|
post_data["excerpt"] = jQuery("#excerpt").val();
|
||||||
if ( jQuery("#post_author").size() )
|
if ( jQuery("#post_author").size() )
|
||||||
post_data["post_author"] = jQuery("#post_author").val();
|
post_data["post_author"] = jQuery("#post_author").val();
|
||||||
|
post_data["user_ID"] = jQuery("#user-id").val();
|
||||||
|
|
||||||
// Don't run while the TinyMCE spellcheck is on. Why? Who knows.
|
// Don't run while the TinyMCE spellcheck is on. Why? Who knows.
|
||||||
if ( rich && tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) {
|
if ( rich && tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) {
|
||||||
|
|
|
@ -1336,6 +1336,10 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
|
||||||
$post_category = array(get_option('default_category'));
|
$post_category = array(get_option('default_category'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Set the default tag list
|
||||||
|
if ( !isset($tags_input) )
|
||||||
|
$tags_input = array();
|
||||||
|
|
||||||
if ( empty($post_author) )
|
if ( empty($post_author) )
|
||||||
$post_author = $user_ID;
|
$post_author = $user_ID;
|
||||||
|
|
||||||
|
|
|
@ -1691,7 +1691,7 @@ class WP_Query {
|
||||||
$q['name'] = $q['pagename'];
|
$q['name'] = $q['pagename'];
|
||||||
$where .= " AND ($wpdb->posts.ID = '$reqpage')";
|
$where .= " AND ($wpdb->posts.ID = '$reqpage')";
|
||||||
$reqpage_obj = get_page($reqpage);
|
$reqpage_obj = get_page($reqpage);
|
||||||
if ( 'attachment' == $reqpage_obj->post_type ) {
|
if ( is_object($reqpage_obj) && 'attachment' == $reqpage_obj->post_type ) {
|
||||||
$this->is_attachment = true;
|
$this->is_attachment = true;
|
||||||
$this->is_page = true;
|
$this->is_page = true;
|
||||||
$q['attachment_id'] = $reqpage;
|
$q['attachment_id'] = $reqpage;
|
||||||
|
|
|
@ -75,7 +75,7 @@ function wp_default_scripts( &$scripts ) {
|
||||||
'broken' => __('An unidentified error has occurred.')
|
'broken' => __('An unidentified error has occurred.')
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20081102' );
|
$scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20081110' );
|
||||||
|
|
||||||
$scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080729' );
|
$scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080729' );
|
||||||
$scripts->localize( 'wp-lists', 'wpListL10n', array(
|
$scripts->localize( 'wp-lists', 'wpListL10n', array(
|
||||||
|
|
|
@ -840,11 +840,16 @@ function sanitize_term($term, $taxonomy, $context = 'display') {
|
||||||
if ( is_object($term) )
|
if ( is_object($term) )
|
||||||
$do_object = true;
|
$do_object = true;
|
||||||
|
|
||||||
|
$term_id = $do_object ? $term->term_id : (isset($term['term_id']) ? $term['term_id'] : 0);
|
||||||
|
|
||||||
foreach ( (array) $fields as $field ) {
|
foreach ( (array) $fields as $field ) {
|
||||||
if ( $do_object )
|
if ( $do_object ) {
|
||||||
$term->$field = sanitize_term_field($field, $term->$field, $term->term_id, $taxonomy, $context);
|
if ( isset($term->$field) )
|
||||||
else
|
$term->$field = sanitize_term_field($field, $term->$field, $term_id, $taxonomy, $context);
|
||||||
$term[$field] = sanitize_term_field($field, $term[$field], $term['term_id'], $taxonomy, $context);
|
} else {
|
||||||
|
if ( isset($term[$field]) )
|
||||||
|
$term[$field] = sanitize_term_field($field, $term[$field], $term_id, $taxonomy, $context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $term;
|
return $term;
|
||||||
|
|
|
@ -1707,9 +1707,12 @@ function wp_widget_rss_control($widget_args) {
|
||||||
* @param array $inputs Override default display options.
|
* @param array $inputs Override default display options.
|
||||||
*/
|
*/
|
||||||
function wp_widget_rss_form( $args, $inputs = null ) {
|
function wp_widget_rss_form( $args, $inputs = null ) {
|
||||||
|
|
||||||
$default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true );
|
$default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true );
|
||||||
$inputs = wp_parse_args( $inputs, $default_inputs );
|
$inputs = wp_parse_args( $inputs, $default_inputs );
|
||||||
extract( $args );
|
extract( $args );
|
||||||
|
extract( $inputs, EXTR_SKIP);
|
||||||
|
|
||||||
$number = attribute_escape( $number );
|
$number = attribute_escape( $number );
|
||||||
$title = attribute_escape( $title );
|
$title = attribute_escape( $title );
|
||||||
$url = attribute_escape( $url );
|
$url = attribute_escape( $url );
|
||||||
|
|
|
@ -336,15 +336,11 @@ if ( !defined('WP_PLUGIN_URL') )
|
||||||
if ( !defined('PLUGINDIR') )
|
if ( !defined('PLUGINDIR') )
|
||||||
define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
|
define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
|
||||||
|
|
||||||
if ( ! defined('WP_INSTALLING') ) {
|
/**
|
||||||
// Used to guarantee unique hash cookies
|
|
||||||
$cookiehash = md5(get_option('siteurl'));
|
|
||||||
/**
|
|
||||||
* Used to guarantee unique hash cookies
|
* Used to guarantee unique hash cookies
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
define('COOKIEHASH', $cookiehash);
|
define('COOKIEHASH', md5(get_option('siteurl')));
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
|
* Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
|
||||||
|
|
Loading…
Reference in New Issue