Lots of fixes for Notices when WP_DEBUG is set. See #6669 props santosj.

git-svn-id: http://svn.automattic.com/wordpress/trunk@8589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-08-08 17:05:10 +00:00
parent 5a692699b4
commit b3cb14fb80
16 changed files with 119 additions and 48 deletions

View File

@ -1,9 +1,12 @@
<?php
if ( ! isset( $post_ID ) )
$post_ID = 0;
$action = isset($action) ? $action : '';
if ( isset($_GET['message']) )
$_GET['message'] = absint( $_GET['message'] );
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Post updated.');
@ -14,7 +17,7 @@ if ( isset($_GET['revision']) )
$notice = false;
$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );
if ( !isset($post_ID) || 0 == $post_ID ) {
if ( 0 == $post_ID ) {
$form_action = 'post';
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
@ -54,7 +57,7 @@ if ( !isset($post_ID) || 0 == $post_ID ) {
<h2><?php _e('Write Post') ?></h2>
<?php
if ( !isset($post_ID) || 0 == $post_ID)
if ( 0 == $post_ID)
wp_nonce_field('add-post');
else
wp_nonce_field('update-post_' . $post_ID);
@ -123,7 +126,7 @@ if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND
<?php endif; ?>
<?php endif; ?>
<?php
if ($post_ID) {
if ( 0 != $post_ID ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
$stamp = __('Scheduled for:<br />%1$s at %2$s');
} else if ( 'publish' == $post->post_status ) { // already published
@ -167,7 +170,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
echo "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post_ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;post') . "</a>";
?>
<br class="clear" />
<?php if ($post_ID): ?>
<?php if ( 0 != $post_ID ): ?>
<?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
$last_user = get_userdata($last_id);
printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
@ -185,7 +188,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<h5><?php _e('Related') ?></h5>
<ul>
<?php if ($post_ID): ?>
<?php if ( 0 != $post_ID ): ?>
<li><a href="edit.php?p=<?php echo $post_ID ?>"><?php _e('See Comments on this Post') ?></a></li>
<?php endif; ?>
<li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li>
@ -345,7 +348,7 @@ add_meta_box('commentstatusdiv', __('Comments &amp; Pings'), 'post_comment_statu
function post_password_meta_box($post) {
?>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php if ( isset( $post->post_password ) ) : echo attribute_escape( $post->post_password ); endif; ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
<?php
}
@ -374,7 +377,7 @@ function post_author_meta_box($post) {
add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'advanced', 'core');
endif;
if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
function post_revisions_meta_box($post) {
wp_list_post_revisions();
}

View File

@ -14,7 +14,7 @@ if ( ! empty($link_id) ) {
function xfn_check($class, $value = '', $deprecated = '') {
global $link;
$link_rel = $link->link_rel;
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
$rels = preg_split('/\s+/', $link_rel);
if ('' != $value && in_array($value, $rels) ) {
@ -92,7 +92,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<div id="descriptiondiv" class="stuffbox">
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
<div class="inside">
<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo $link->link_description; ?>" id="link_description" /><br />
<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo ( isset( $link->link_description ) ? $link->link_description : ''); ?>" id="link_description" /><br />
<?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?>
</div>
</div>
@ -116,7 +116,12 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<div id="categories-all" class="ui-tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php wp_link_category_checklist($link->link_id); ?>
<?php
if ( isset($link->link_id) )
wp_link_category_checklist($link->link_id);
else
wp_link_category_checklist();
?>
</ul>
</div>
@ -137,13 +142,13 @@ add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'l
<?php function link_target_meta_box($link) { ?>
<fieldset><legend class="hidden"><?php _e('Target') ?></legend>
<label for="link_target_blank" class="selectit">
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
<code>_blank</code></label><br />
<label for="link_target_top" class="selectit">
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
<code>_top</code></label><br />
<label for="link_target_none" class="selectit">
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
<?php _e('none') ?></label>
</fieldset>
<p><?php _e('Choose the frame your link targets. Essentially this means if you choose <code>_blank</code> your link will open in a new window.'); ?></p>
@ -156,7 +161,7 @@ function link_xfn_meta_box($link) {
<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr>
<th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th>
<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? $link->link_rel : ''); ?>" /></td>
</tr>
<tr>
<td colspan="2">
@ -269,15 +274,15 @@ function link_advanced_meta_box($link) {
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr class="form-field">
<th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
<td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
<td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? $link->link_image : ''); ?>" style="width: 95%" /></td>
</tr>
<tr class="form-field">
<th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
<td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
<td><input name="link_rss" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? $link->link_rss : ''); ?>" size="50" style="width: 95%" /></td>
</tr>
<tr class="form-field">
<th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
</tr>
<tr class="form-field">
<th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
@ -285,7 +290,7 @@ function link_advanced_meta_box($link) {
<?php
for ($r = 0; $r < 10; $r++) {
echo(' <option value="'.$r.'" ');
if ($link->link_rating == $r)
if ( isset($link->link_rating) && $link->link_rating == $r)
echo 'selected="selected"';
echo('>'.$r.'</option>');
}

View File

@ -1,7 +1,11 @@
<?php
if ( ! isset( $post_ID ) )
$post_ID = 0;
if ( isset($_GET['message']) )
$_GET['message'] = absint( $_GET['message'] );
$messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
$messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Page updated.');
@ -12,7 +16,7 @@ if ( isset($_GET['revision']) )
$notice = false;
$notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );
if (!isset($post_ID) || 0 == $post_ID) {
if ( 0 == $post_ID) {
$form_action = 'post';
$nonce_action = 'add-page';
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
@ -102,7 +106,7 @@ if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND
<?php endif; ?>
<?php
if ($post_ID) {
if ( 0 != $post_ID ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
$stamp = __('Scheduled for:<br />%1$s at %2$s');
} else if ( 'publish' == $post->post_status ) { // already published
@ -144,7 +148,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
echo "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&amp;post=$post_ID", 'delete-page_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;page') . "</a>";
?>
<br class="clear" />
<?php if ($post_ID): ?>
<?php if ( 0 != $post_ID ) : ?>
<?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
$last_user = get_userdata($last_id);
printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
@ -162,7 +166,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
<h5><?php _e('Related') ?></h5>
<ul>
<?php if ($post_ID): ?>
<?php if ( 0 != $post_ID ) : ?>
<li><a href="edit-pages.php?page_id=<?php echo $post_ID ?>"><?php _e('See Comments on this Page') ?></a></li>
<?php endif; ?>
<li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li>
@ -240,7 +244,7 @@ add_meta_box('pagecommentstatusdiv', __('Comments &amp; Pings'), 'page_comments_
function page_password_meta_box($post){
?>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo ( isset( $post->post_password ) ? attribute_escape( $post->post_password ) : '' ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
<?php
}
@ -304,7 +308,7 @@ if ( $authors && count( $authors ) > 1 ) {
}
if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
function page_revisions_meta_box($post) {
wp_list_post_revisions();
}

View File

@ -89,7 +89,7 @@ foreach ( $post_stati as $status => $label ) {
if ( !in_array($status, $avail_post_stati) )
continue;
if ( $status == $_GET['post_status'] )
if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] )
$class = ' class="current"';
$status_links[] = "<li><a href=\"edit-pages.php?post_status=$status\"$class>" .
@ -119,10 +119,10 @@ endif;
<div class="tablenav">
<?php
$pagenum = absint( $_GET['pagenum'] );
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
if ( empty($pagenum) )
$pagenum = 1;
if( !$per_page || $per_page < 0 )
if( ! isset( $per_page ) || $per_page < 0 )
$per_page = 20;
$num_pages = ceil(count($posts) / $per_page);

View File

@ -295,6 +295,9 @@ function media_upload_form_handler() {
}
function media_upload_image() {
$errors = array();
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@ -359,6 +362,9 @@ function media_sideload_image($file, $post_id, $desc = null) {
}
function media_upload_audio() {
$errors = array();
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@ -399,6 +405,9 @@ function media_upload_audio() {
}
function media_upload_video() {
$errors = array();
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@ -439,6 +448,9 @@ function media_upload_video() {
}
function media_upload_file() {
$errors = array();
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
@ -479,6 +491,8 @@ function media_upload_file() {
}
function media_upload_gallery() {
$errors = array();
if ( !empty($_POST) ) {
$return = media_upload_form_handler();
@ -493,6 +507,7 @@ function media_upload_gallery() {
}
function media_upload_library() {
$errors = array();
if ( !empty($_POST) ) {
$return = media_upload_form_handler();
@ -1127,7 +1142,7 @@ function media_upload_library_form($errors) {
$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id");
$_GET['paged'] = intval($_GET['paged']);
$_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
if ( $_GET['paged'] < 1 )
$_GET['paged'] = 1;
$start = ( $_GET['paged'] - 1 ) * 10;

View File

@ -537,8 +537,9 @@ function wp_edit_attachments_query( $q = false ) {
global $wpdb;
if ( false === $q )
$q = $_GET;
$q['m'] = (int) $q['m'];
$q['cat'] = (int) $q['cat'];
$q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
$q['post_type'] = 'attachment';
$q['post_status'] = 'any';
$q['posts_per_page'] = 15;

View File

@ -263,6 +263,8 @@ function dropdown_link_categories( $default = 0 ) {
}
function wp_link_category_checklist( $link_id = 0 ) {
$default = 1;
if ( $link_id ) {
$checked_categories = wp_get_link_cats($link_id);
@ -378,15 +380,23 @@ function wp_manage_media_columns() {
function wp_manage_pages_columns() {
$posts_columns = array();
$posts_columns['cb'] = '<input type="checkbox" />';
if ( 'draft' === $_GET['post_status'] )
$post_status = isset( $_GET['post_status'] ) ? $_GET['post_status'] : '';
switch( $post_status ) {
case 'draft':
$posts_columns['modified'] = __('Modified');
elseif ( 'pending' === $_GET['post_status'] )
break;
case 'pending':
$posts_columns['modified'] = __('Submitted');
else
break;
default:
$posts_columns['date'] = __('Date');
}
$posts_columns['title'] = __('Title');
$posts_columns['author'] = __('Author');
if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
if ( !in_array($post_status, array('pending', 'draft', 'future')) )
$posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>';
$posts_columns['status'] = __('Status');
$posts_columns = apply_filters('manage_pages_columns', $posts_columns);
@ -1210,6 +1220,9 @@ function do_meta_boxes($page, $context, $object) {
return;
foreach ( array('high', 'core', 'default', 'low') as $priority ) {
if ( ! isset( $wp_meta_boxes[$page][$context][$priority] ) )
continue;
foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
if ( false === $box )
continue;

View File

@ -35,10 +35,12 @@ function get_page_templates() {
foreach ( $templates as $template ) {
$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
preg_match( '|Description:(.*)$|mi', $template_data, $description );
$name = '';
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
$name = $name[1];
$description = '';
if( preg_match( '|Description:(.*)$|mi', $template_data, $description ) )
$description = $description[1];
if ( !empty( $name ) ) {

View File

@ -7,6 +7,11 @@ function core_update_footer( $msg = '' ) {
return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
$cur = get_option( 'update_core' );
if ( ! isset( $cur->current ) )
$cur->current = '';
if ( ! isset( $cur->url ) )
$cur->url = '';
switch ( $cur->response ) {
case 'development' :

View File

@ -17,7 +17,7 @@ wp_enqueue_script('xfn');
require('admin-header.php');
?>
<?php if ($_GET['added'] && '' != $_POST['link_name']) : ?>
<?php if ( isset( $_GET['added'] ) && '' != $_POST['link_name']) : ?>
<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
<?php endif; ?>

View File

@ -79,7 +79,7 @@ if ( isset($_GET['deleted']) ) {
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e( 'Search Links' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="text" id="post-search-input" name="s" value="<?php echo ( isset( $_GET['s'] ) ? attribute_escape(stripslashes($_GET['s'])) : ''); ?>" />
<input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" />
</p>
@ -150,6 +150,8 @@ if ( $links ) {
</thead>
<tbody>
<?php
$i = 0; // It is slower incrementing an undefined and valueless variable.
foreach ($links as $link) {
$link = sanitize_bookmark($link);
$link->link_name = attribute_escape($link->link_name);

View File

@ -27,7 +27,10 @@ $menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='c
$menu[30] = array(__('Settings'), 'manage_options', 'options-general.php');
$update_plugins = get_option( 'update_plugins' );
$update_count = 0;
if ( isset( $update_plugins->response ) )
$update_count = count( $update_plugins->response );
$menu[35] = array( sprintf( __('Plugins %s'), "<span id='update-plugins' class='count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php');
if ( current_user_can('edit_users') )
$menu[40] = array(__('Users'), 'edit_users', 'users.php');

View File

@ -183,7 +183,23 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
if ( strtolower($original['host']) == strtolower($redirect['host']) )
$redirect['host'] = $original['host'];
if ( array($original['host'], $original['port'], $original['path'], $original['query']) !== array($redirect['host'], $redirect['port'], $redirect['path'], $redirect['query']) ) {
$compare_original = array($original['host'], $original['path']);
if ( isset( $original['port'] ) )
$compare_original[] = $original['port'];
if ( isset( $original['query'] ) )
$compare_original[] = $original['query'];
$compare_redirect = array($redirect['host'], $redirect['path']);
if ( isset( $redirect['port'] ) )
$compare_redirect[] = $redirect['port'];
if ( isset( $redirect['query'] ) )
$compare_redirect[] = $redirect['query'];
if ( $compare_original !== $compare_redirect ) {
$redirect_url = $redirect['scheme'] . '://' . $redirect['host'];
if ( isset($redirect['port']) )
$redirect_url .= ':' . $redirect['port'];

View File

@ -27,7 +27,7 @@ function wptexturize($text) {
for ( $i = 0; $i < $stop; $i++ ) {
$curl = $textarr[$i];
if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag
if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag
// static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions

View File

@ -1411,6 +1411,7 @@ function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) {
function wp_get_referer() {
$ref = '';
if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
$ref = $_REQUEST['_wp_http_referer'];
else if ( ! empty( $_SERVER['HTTP_REFERER'] ) )

View File

@ -472,6 +472,7 @@ class WP_Query {
, 'w'
, 'category_name'
, 'tag'
, 'cat'
, 'tag_id'
, 'author_name'
, 'feed'