summaryrefslogtreecommitdiffstats
path: root/wp-admin
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-21 16:41:02 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-21 16:41:02 +0000
commita5fe68e002632c190ffbd85167671ed4d4961135 (patch)
treeae57f94603111507c50cb3c212a03bedf8f7dc5a /wp-admin
parent4e38776b5b68c61a4593a84340f4654200f7568e (diff)
downloadwordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.gz
wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.xz
wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.zip
WP Merge to WP 2.2.1
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1005 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
-rw-r--r--wp-admin/admin-db.php17
-rw-r--r--wp-admin/admin-footer.php2
-rw-r--r--wp-admin/admin-functions.php37
-rw-r--r--wp-admin/categories.php1
-rw-r--r--wp-admin/comment.php10
-rw-r--r--wp-admin/edit-comments.php2
-rw-r--r--wp-admin/edit-form-advanced.php31
-rw-r--r--wp-admin/edit-form-comment.php10
-rw-r--r--wp-admin/edit-form.php8
-rw-r--r--wp-admin/edit-link-form.php514
-rw-r--r--wp-admin/edit-page-form.php15
-rw-r--r--wp-admin/edit-pages.php6
-rw-r--r--wp-admin/edit.php4
-rw-r--r--wp-admin/export.php456
-rw-r--r--wp-admin/import/livejournal.php2
-rw-r--r--wp-admin/import/textpattern.php6
-rw-r--r--wp-admin/import/wordpress.php782
-rw-r--r--wp-admin/index.php8
-rw-r--r--wp-admin/link-manager.php13
-rw-r--r--wp-admin/moderation.php8
-rw-r--r--wp-admin/options-reading.php10
-rw-r--r--wp-admin/plugins.php5
-rw-r--r--wp-admin/post-new.php4
-rw-r--r--wp-admin/upgrade-functions.php4
-rw-r--r--wp-admin/user-edit.php2
-rw-r--r--wp-admin/users.php2
-rw-r--r--wp-admin/widgets.php8
-rw-r--r--wp-admin/wp-admin.css19
28 files changed, 992 insertions, 994 deletions
diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php
index 5367297..6d18c96 100644
--- a/wp-admin/admin-db.php
+++ b/wp-admin/admin-db.php
@@ -83,7 +83,7 @@ function get_nonauthor_user_ids() {
function wp_insert_category($catarr) {
global $wpdb;
- extract($catarr);
+ extract($catarr, EXTR_SKIP);
if( trim( $cat_name ) == '' )
return 0;
@@ -125,11 +125,6 @@ function wp_insert_category($catarr) {
else
$links_private = 0;
-
- // Let's check if we have this category already, if so just do an update
- if ( !$update && $cat_ID = category_object_exists( $category_nicename ) )
- $update = true;
-
if (!$update) {
$maxcat = $wpdb->get_var( "SELECT max(cat_ID) FROM {$wpdb->categories}" );
$cat_ID = mt_rand( $maxcat+100, $maxcat+4000 );
@@ -255,14 +250,6 @@ function wp_create_categories($categories, $post_id = '') {
return $cat_ids;
}
-function category_object_exists($cat_name) {
- global $wpdb;
- if (!$category_nicename = sanitize_title($cat_name))
- return 0;
-
- return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'");
-}
-
function category_exists($cat_name) {
global $wpdb;
if (!$category_nicename = sanitize_title($cat_name))
@@ -314,7 +301,7 @@ function wp_revoke_user($id) {
function wp_insert_link($linkdata) {
global $wpdb, $current_user;
- extract($linkdata);
+ extract($linkdata, EXTR_SKIP);
$update = false;
diff --git a/wp-admin/admin-footer.php b/wp-admin/admin-footer.php
index 40a3e8c..8e30631 100644
--- a/wp-admin/admin-footer.php
+++ b/wp-admin/admin-footer.php
@@ -2,7 +2,7 @@
<div id="footer">
<p class="logo"><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
<p class="docs"><?php _e('<a href="http://codex.wordpress.org/">Documentation</a>'); ?> &#8212; <?php _e('<a href="http://wordpress.org/support/">Support Forums</a>'); ?><br />
-<?php printf( __('Version %s'), get_bloginfo('version') ); ?></p>
+<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), timer_stop(0, 2)); ?></p>
</div>
<?php do_action('admin_footer', ''); ?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 592c242..dce1350 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -347,6 +347,8 @@ function get_post_to_edit( $id ) {
$post->post_title = apply_filters( 'title_edit_pre', $post->post_title );
$post->post_password = format_to_edit( $post->post_password );
+
+ $post->menu_order = (int) $post->menu_order;
if ( $post->post_type == 'page' )
$post->page_template = get_post_meta( $id, '_wp_page_template', true );
@@ -396,12 +398,16 @@ function get_default_post_to_edit() {
function get_comment_to_edit( $id ) {
$comment = get_comment( $id );
+
+ $comment->comment_ID = (int) $comment->comment_ID;
+ $comment->comment_post_ID = (int) $comment->comment_post_ID;
- $comment->comment_content = format_to_edit( $comment->comment_content, user_can_richedit() );
+ $comment->comment_content = format_to_edit( $comment->comment_content );
$comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content);
$comment->comment_author = format_to_edit( $comment->comment_author );
$comment->comment_author_email = format_to_edit( $comment->comment_author_email );
+ $comment->comment_author_url = clean_url($comment->comment_author_url);
$comment->comment_author_url = format_to_edit( $comment->comment_author_url );
return $comment;
@@ -409,6 +415,9 @@ function get_comment_to_edit( $id ) {
function get_category_to_edit( $id ) {
$category = get_category( $id );
+
+ $category->term_id = (int) $category->term_id;
+ $category->parent = (int) $category->parent;
return $category;
}
@@ -819,8 +828,8 @@ function _cat_row( $category, $level, $name_override = false ) {
$class = ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || " class='alternate'" == $class ) ? '' : " class='alternate'";
- $category->category_count = number_format_i18n( $category->category_count );
- $category->link_count = number_format_i18n( $category->link_count );
+ $category->category_count = number_format( $category->category_count );
+ $category->link_count = number_format( $category->link_count );
$posts_count = ( $category->category_count > 0 ) ? "<a href='edit.php?cat=$category->cat_ID'>$category->category_count</a>" : $category->category_count;
return "<tr id='cat-$category->cat_ID'$class>
<th scope='row' style='text-align: center'>$category->cat_ID</th>
@@ -948,7 +957,7 @@ function _wp_comment_list_item( $id, $alt = 0 ) {
<?php
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" . __('Edit') . '</a>';
- echo ' | <a href="' . wp_nonce_url('ocomment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';
+ echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';
if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';
echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';
@@ -1039,6 +1048,7 @@ function list_meta( $meta ) {
$key_js = js_escape( $entry['meta_key'] );
$entry['meta_key'] = attribute_escape($entry['meta_key']);
$entry['meta_value'] = attribute_escape($entry['meta_value']);
+ $entry['meta_id'] = (int) $entry['meta_id'];
$r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>";
$r .= "\n\t\t<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
$r .= "\n\t\t<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
@@ -1091,7 +1101,7 @@ function meta_form() {
<?php
foreach ( $keys as $key ) {
- $key = attribute_escape( $key);
+ $key = attribute_escape( $key );
echo "\n\t<option value='$key'>$key</option>";
}
?>
@@ -1112,6 +1122,8 @@ function add_meta( $post_ID ) {
global $wpdb;
$post_ID = (int) $post_ID;
+ $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
+
$metakeyselect = $wpdb->escape( stripslashes( trim( $_POST['metakeyselect'] ) ) );
$metakeyinput = $wpdb->escape( stripslashes( trim( $_POST['metakeyinput'] ) ) );
$metavalue = maybe_serialize( stripslashes( (trim( $_POST['metavalue'] ) ) ));
@@ -1127,6 +1139,9 @@ function add_meta( $post_ID ) {
if ( $metakeyinput)
$metakey = $metakeyinput; // default
+ if ( in_array($metakey, $protected) )
+ return false;
+
$result = $wpdb->query( "
INSERT INTO $wpdb->postmeta
(post_id,meta_key,meta_value )
@@ -1146,6 +1161,12 @@ function delete_meta( $mid ) {
function update_meta( $mid, $mkey, $mvalue ) {
global $wpdb;
+
+ $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
+
+ if ( in_array($mkey, $protected) )
+ return false;
+
$mvalue = maybe_serialize( stripslashes( $mvalue ));
$mvalue = $wpdb->escape( $mvalue );
$mid = (int) $mid;
@@ -1345,7 +1366,6 @@ function get_page_templates() {
function page_template_dropdown( $default = '' ) {
$templates = get_page_templates();
- ksort( $templates );
foreach (array_keys( $templates ) as $template )
: if ( $default == $templates[$template] )
$selected = " selected='selected'";
@@ -1945,11 +1965,8 @@ function wp_handle_upload( &$file, $overrides = false ) {
extract( $wp_filetype );
- if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
+ if ( !$type || !$ext )
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
-
- if ( !$ext )
- $ext = strrchr($file['name'], '.');
}
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
diff --git a/wp-admin/categories.php b/wp-admin/categories.php
index 40bdbf9..5e77e0f 100644
--- a/wp-admin/categories.php
+++ b/wp-admin/categories.php
@@ -118,7 +118,6 @@ cat_rows();
</div>
<?php include('edit-category-form.php'); ?>
-
<?php endif; ?>
<?php
diff --git a/wp-admin/comment.php b/wp-admin/comment.php
index 6c0872d..4390571 100644
--- a/wp-admin/comment.php
+++ b/wp-admin/comment.php
@@ -39,7 +39,7 @@ case 'mac':
$nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_';
$nonce_action .= $comment;
- if ( ! $comment = get_comment($comment) )
+ if ( ! $comment = get_comment_to_edit($comment) )
wp_die(__('Oops, no comment with this ID.').sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php'));
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
@@ -91,12 +91,12 @@ case 'mac':
<?php if ( $comment->comment_author_url ) { ?>
<tr>
<th scope="row"><?php _e('URL:'); ?></th>
-<td><?php echo "<a href='$comment->comment_author_url'>$comment->comment_author_url</a>"; ?></td>
+<td><?php echo $comment->comment_author_url; ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row" valign="top"><p><?php _e('Comment:'); ?></p></th>
-<td><?php echo apply_filters( 'comment_text', $comment->comment_content ); ?></td>
+<td><?php echo $comment->comment_content; ?></td>
</tr>
</table>
@@ -155,7 +155,7 @@ case 'unapprovecomment':
if ((wp_get_referer() != "") && (false == $noredir)) {
wp_redirect(wp_get_referer());
} else {
- wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments');
+ wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='. (int) $comment->comment_post_ID.'&c=1#comments');
}
exit();
break;
@@ -185,7 +185,7 @@ case 'approvecomment':
if ((wp_get_referer() != "") && (false == $noredir)) {
wp_redirect(wp_get_referer());
} else {
- wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments');
+ wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='. (int) $comment->comment_post_ID.'&c=1#comments');
}
exit();
break;
diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php
index 7da6129..85b2a6e 100644
--- a/wp-admin/edit-comments.php
+++ b/wp-admin/edit-comments.php
@@ -157,7 +157,7 @@ if ( $extra_comments ) : ?>
$class .= ('unapproved' == $comment_status) ? ' unapproved' : '';
?>
<tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
- <td style="text-align: center"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
+ <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
<td><?php comment_author_link() ?></td>
<td><?php comment_author_email_link() ?></td>
<td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td>
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index b934ed8..81a998b 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -1,10 +1,12 @@
<?php
+if ( isset($_GET['message']) )
+ $_GET['message'] = (int) $_GET['message'];
$messages[1] = __('Post updated');
$messages[2] = __('Custom field updated');
$messages[3] = __('Custom field deleted.');
?>
<?php if (isset($_GET['message'])) : ?>
-<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<div id="message" class="updated fade"><p><?php echo wp_specialchars($messages[$_GET['message']]); ?></p></div>
<?php endif; ?>
<form name="post" action="post.php" method="post" id="post">
@@ -21,16 +23,17 @@ if (0 == $post_ID) {
$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
wp_nonce_field('add-post');
} else {
+ $post_ID = (int) $post_ID;
$form_action = 'editpost';
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
wp_nonce_field('update-post_' . $post_ID);
}
-$form_pingback = '<input type="hidden" name="post_pingback" value="' . get_option('default_pingback_flag') . '" id="post_pingback" />';
+$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';
-$form_prevstatus = '<input type="hidden" name="prev_status" value="' . $post->post_status . '" />';
+$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />';
-$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $post->to_ping) .'" />';
+$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
if ('' != $post->pinged) {
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
@@ -41,16 +44,16 @@ if ('' != $post->pinged) {
$pings .= '</ul>';
}
-$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . __('Save and Continue Editing') . '" />';
+$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />';
if (empty($post->post_status)) $post->post_status = 'draft';
?>
-<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
+<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
-<input type="hidden" name="post_author" value="<?php echo $post->post_author ?>" />
+<input type="hidden" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
<input type="hidden" id="post_type" name="post_type" value="post" />
<?php echo $form_extra ?>
@@ -88,12 +91,12 @@ addLoadEvent(focusit);
<fieldset id="passworddiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Post Password') ?></h3>
-<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
+<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div>
</fieldset>
<fieldset id="slugdiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Post Slug') ?></h3>
-<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
+<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div>
</fieldset>
<fieldset id="poststatusdiv" class="dbx-box">
@@ -125,7 +128,7 @@ foreach ($authors as $o) :
$o = get_userdata( $o->ID );
if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
else $selected = '';
-echo "<option value='$o->ID' $selected>$o->display_name</option>";
+echo "<option value='" . (int) $o->ID . "' $selected>" . wp_specialchars( $o->display_name ) . "</option>";
endforeach;
?>
</select>
@@ -140,7 +143,7 @@ endforeach;
<fieldset id="titlediv">
<legend><?php _e('Title') ?></legend>
- <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
+ <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div>
</fieldset>
<fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
@@ -168,7 +171,7 @@ endforeach;
if ('publish' != $post->post_status || 0 == $post_ID) {
?>
<?php if ( current_user_can('publish_posts') ) : ?>
- <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
+ <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish'); ?>" />
<?php endif; ?>
<?php
}
@@ -186,11 +189,11 @@ else
<?php
if (current_user_can('upload_files')) {
- $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID);
+ $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
$uploading_iframe_src = wp_nonce_url("upload.php?style=inline&amp;tab=upload&amp;post_id=$uploading_iframe_ID", 'inlineuploading');
$uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
if ( false != $uploading_iframe_src )
- echo '<iframe id="uploading" name="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
+ echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
}
?>
diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php
index 3e278bc..5d6f448 100644
--- a/wp-admin/edit-form-comment.php
+++ b/wp-admin/edit-form-comment.php
@@ -2,13 +2,13 @@
$submitbutton_text = __('Edit Comment &raquo;');
$toprow_title = sprintf(__('Editing Comment # %s'), $comment->comment_ID);
$form_action = 'editedcomment';
-$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='".$comment->comment_post_ID;
+$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='" . $comment->comment_post_ID;
?>
<form name="post" action="comment.php" method="post" id="post">
<?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
<div class="wrap">
-<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
+<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
<script type="text/javascript">
@@ -20,19 +20,19 @@ addLoadEvent(focusit);
<fieldset id="namediv">
<legend><label for="name"><?php _e('Name:') ?></label></legend>
<div>
- <input type="text" name="newcomment_author" size="25" value="<?php echo $comment->comment_author ?>" tabindex="1" id="name" />
+ <input type="text" name="newcomment_author" size="25" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" />
</div>
</fieldset>
<fieldset id="emaildiv">
<legend><label for="email"><?php _e('E-mail:') ?></label></legend>
<div>
- <input type="text" name="newcomment_author_email" size="20" value="<?php echo $comment->comment_author_email ?>" tabindex="2" id="email" />
+ <input type="text" name="newcomment_author_email" size="20" value="<?php echo attribute_escape( $comment->comment_author_email ); ?>" tabindex="2" id="email" />
</div>
</fieldset>
<fieldset id="uridiv">
<legend><label for="newcomment_author_url"><?php _e('URL:') ?></label></legend>
<div>
- <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url ?>" tabindex="3" />
+ <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="3" />
</div>
</fieldset>
diff --git a/wp-admin/edit-form.php b/wp-admin/edit-form.php
index 8ed3d54..3945e3c 100644
--- a/wp-admin/edit-form.php
+++ b/wp-admin/edit-form.php
@@ -6,7 +6,7 @@
<?php if (isset($mode) && 'bookmarklet' == $mode) : ?>
<input type="hidden" name="mode" value="bookmarklet" />
<?php endif; ?>
-<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
+<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" name="action" value='post' />
<script type="text/javascript">
@@ -21,7 +21,7 @@ addLoadEvent(focusit);
<div id="poststuff">
<fieldset id="titlediv">
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
- <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
+ <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div>
</fieldset>
<fieldset id="categorydiv">
@@ -49,7 +49,7 @@ edCanvas = document.getElementById('content');
//-->
</script>
-<input type="hidden" name="post_pingback" value="<?php echo get_option('default_pingback_flag') ?>" id="post_pingback" />
+<input type="hidden" name="post_pingback" value="<?php echo (int) get_option('default_pingback_flag') ?>" id="post_pingback" />
<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)'), 'http://wordpress.org/docs/reference/post/#trackback'); echo '<br />'; ?>
<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>
@@ -64,7 +64,7 @@ edCanvas = document.getElementById('content');
<?php if ('bookmarklet' != $mode) {
echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing &raquo;') . '" />';
} ?>
- <input name="referredby" type="hidden" id="referredby" value="<?php if ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" />
+ <input name="referredby" type="hidden" id="referredby" value="<?php if ( $refby = wp_get_referer() ) echo urlencode($refby); ?>" />
</p>
<?php do_action('simple_edit_form', ''); ?>
diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php
index 4e0eece..bd226e7 100644
--- a/wp-admin/edit-link-form.php
+++ b/wp-admin/edit-link-form.php
@@ -1,257 +1,257 @@
-<?php
-if ( ! empty($link_id) ) {
- $heading = __('Edit Link');
- $submit_text = __('Save Changes &raquo;');
- $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
- $nonce_action = 'update-bookmark_' . $link_id;
-} else {
- $heading = __('Add Link');
- $submit_text = __('Add Link &raquo;');
- $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
- $nonce_action = 'add-bookmark';
-}
-
-function xfn_check($class, $value = '', $type = 'check') {
- global $link;
-
- $link_rel = $link->link_rel;
- $rels = preg_split('/\s+/', $link_rel);
-
- if ('' != $value && in_array($value, $rels) ) {
- echo ' checked="checked"';
- }
-
- if ('' == $value) {
- if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
- if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
- if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
- if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
- }
-}
-?>
-
-<div class="wrap">
-<h2><?php echo $heading ?></h2>
-<?php echo $form ?>
-<?php wp_nonce_field($nonce_action); ?>
-
-<div id="poststuff">
-<div id="moremeta">
-<div id="grabit" class="dbx-group">
-
-<fieldset id="categorydiv" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
-<div class="dbx-content">
-<p id="jaxcat"></p>
-<ul id="categorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>
-</div>
-</fieldset>
-
-<fieldset class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Target') ?></h3>
-<div class="dbx-content">
-<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"' : ''); ?> />
-<code>_blank</code></label>
-<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"' : ''); ?> />
-<code>_top</code></label>
-<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"' : ''); ?> />
-<?php _e('none') ?></label>
-</div>
-</fieldset>
-
-<fieldset class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Visible') ?></h3>
-<div class="dbx-content">
-<label for="link_visible_yes" class="selectit">
-<input id="link_visible_yes" type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" />
-<?php _e('Yes') ?></label>
-<label for="link_visible_no" class="selectit">
-<input id="link_visible_no" type="radio" name="link_visible" <?php if ($link->link_visible == 'N') echo "checked='checked'"; ?> value="N" />
-<?php _e('No') ?></label>
-</div>
-</fieldset>
-
-</div>
-</div>
-
-<table class="editform" width="100%" cellspacing="2" cellpadding="5">
-<tr>
-<th scope="row" valign="top"><label for="link_name"><?php _e('Name:') ?></label></th>
-<td><input type="text" name="link_name" id="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
-</tr>
-<tr>
-<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('Address:') ?></label></th>
-<td width="80%"><input type="text" name="link_url" id="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td>
-</tr>
-<tr>
-<th scope="row" valign="top"><label for="link_description"><?php _e('Description:') ?></label></th>
-<td><input type="text" name="link_description" id="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
-</tr>
-</table>
-
-<p class="submit">
-<input type="submit" name="submit" value="<?php echo $submit_text ?>" />
-</p>
-
-<div id="advancedstuff" class="dbx-group" >
-
-<fieldset id="xfn" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Link Relationship (XFN)') ?></h3>
-<div class="dbx-content">
-<table class="editform" width="100%" cellspacing="2" cellpadding="5">
- <tr>
- <th width="20%" scope="row"><?php _e('rel:') ?></th>
- <td width="80%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
- </tr>
- <tr>
- <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th>
- <td>
- <table cellpadding="3" cellspacing="5">
- <tr>
- <th scope="row"> <?php _e('identity') ?> </th>
- <td>
- <label for="me">
- <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
- <?php _e('another web address of mine') ?></label>
- </td>
- </tr>
- <tr>
- <th scope="row"> <?php _e('friendship') ?> </th>
- <td>
- <label for="contact">
- <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
- <label for="acquaintance">
- <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php _e('acquaintance') ?></label>
- <label for="friend">
- <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
- <label for="friendship">
- <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
- </td>
- </tr>
- <tr>
- <th scope="row"> <?php _e('physical') ?> </th>
- <td>
- <label for="met">
- <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
- <?php _e('met') ?></label>
- </td>
- </tr>
- <tr>
- <th scope="row"> <?php _e('professional') ?> </th>
- <td>
- <label for="co-worker">
- <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
- <?php _e('co-worker') ?></label>
- <label for="colleague">
- <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
- <?php _e('colleague') ?></label>
- </td>
- </tr>
- <tr>
- <th scope="row"> <?php _e('geographical') ?> </th>
- <td>
- <label for="co-resident">
- <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
- <?php _e('co-resident') ?></label>
- <label for="neighbor">
- <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
- <?php _e('neighbor') ?></label>
- <label for="geographical">
- <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
- <?php _e('none') ?></label>
- </td>
- </tr>
- <tr>
- <th scope="row"> <?php _e('family') ?> </th>
- <td>
- <label for="child">
- <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
- <?php _e('child') ?></label>
- <label for="kin">
- <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
- <?php _e('kin') ?></label>
- <label for="parent">
- <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
- <?php _e('parent') ?></label>
- <label for="sibling">
- <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
- <?php _e('sibling') ?></label>
- <label for="spouse">
- <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
- <?php _e('spouse') ?></label>
- <label for="family">
- <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
- <?php _e('none') ?></label>
- </td>
- </tr>
- <tr>
- <th scope="row"> <?php _e('romantic') ?> </th>
- <td>
- <label for="muse">
- <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
- <?php _e('muse') ?></label>
- <label for="crush">
- <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
- <?php _e('crush') ?></label>
- <label for="date">
- <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
- <?php _e('date') ?></label>
- <label for="romantic">
- <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
- <?php _e('sweetheart') ?></label>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-</div>
-</fieldset>
-
-<fieldset id="advanced" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Advanced') ?></h3>
-<div class="dbx-content">
-<table class="editform" width="100%" cellspacing="2" cellpadding="5">
- <tr>
- <th width="20%" scope="row"><?php _e('Image Address:') ?></th>
- <td width="80%"><input type="text" name="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
- </tr>
- <tr>
- <th scope="row"><?php _e('RSS Address:') ?> </th>
- <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
- </tr>
- <tr>
- <th scope="row"><?php _e('Notes:') ?></th>
- <td><textarea name="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
- </tr>
- <tr>
- <th scope="row"><?php _e('Rating:') ?></th>
- <td><select name="link_rating" size="1">
- <?php
- for ($r = 0; $r < 10; $r++) {
- echo(' <option value="'.$r.'" ');
- if ($link->link_rating == $r)
- echo 'selected="selected"';
- echo('>'.$r.'</option>');
- }
- ?></select>&nbsp;<?php _e('(Leave at 0 for no rating.)') ?>
- </td>
- </tr>
-</table>
-</fieldset>
-</div>
-
-<?php if ( $link_id ) : ?>
-<input type="hidden" name="action" value="save" />
-<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
-<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
-<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
-<?php else: ?>
-<input type="hidden" name="action" value="add" />
-<?php endif; ?>
-</div>
-</form>
-</div>
+<?php
+if ( ! empty($link_id) ) {
+ $heading = __('Edit Link');
+ $submit_text = __('Save Changes &raquo;');
+ $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
+ $nonce_action = 'update-bookmark_' . $link_id;
+} else {
+ $heading = __('Add Link');
+ $submit_text = __('Add Link &raquo;');
+ $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
+ $nonce_action = 'add-bookmark';
+}
+
+function xfn_check($class, $value = '', $type = 'check') {
+ global $link;
+
+ $link_rel = $link->link_rel;
+ $rels = preg_split('/\s+/', $link_rel);
+
+ if ('' != $value && in_array($value, $rels) ) {
+ echo ' checked="checked"';
+ }
+
+ if ('' == $value) {
+ if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
+ if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
+ if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
+ if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
+ }
+}
+?>
+
+<div class="wrap">
+<h2><?php echo $heading ?></h2>
+<?php echo $form ?>
+<?php wp_nonce_field($nonce_action); ?>
+
+<div id="poststuff">
+<div id="moremeta">
+<div id="grabit" class="dbx-group">
+
+<fieldset id="categorydiv" class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
+<div class="dbx-content">
+<p id="jaxcat"></p>
+<ul id="categorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>
+</div>
+</fieldset>
+
+<fieldset class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Target') ?></h3>
+<div class="dbx-content">
+<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"' : ''); ?> />
+<code>_blank</code></label>
+<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"' : ''); ?> />
+<code>_top</code></label>
+<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"' : ''); ?> />
+<?php _e('none') ?></label>
+</div>
+</fieldset>
+
+<fieldset class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Visible') ?></h3>
+<div class="dbx-content">
+<label for="link_visible_yes" class="selectit">
+<input id="link_visible_yes" type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" />
+<?php _e('Yes') ?></label>
+<label for="link_visible_no" class="selectit">
+<input id="link_visible_no" type="radio" name="link_visible" <?php if ($link->link_visible == 'N') echo "checked='checked'"; ?> value="N" />
+<?php _e('No') ?></label>
+</div>
+</fieldset>
+
+</div>
+</div>
+
+<table class="editform" width="100%" cellspacing="2" cellpadding="5">
+<tr>
+<th scope="row" valign="top"><label for="link_name"><?php _e('Name:') ?></label></th>
+<td><input type="text" name="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
+</tr>
+<tr>
+<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('Address:') ?></label></th>
+<td width="80%"><input type="text" name="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td>
+</tr>
+<tr>
+<th scope="row" valign="top"><label for="link_description"><?php _e('Description:') ?></label></th>
+<td><input type="text" name="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
+</tr>
+</table>
+
+<p class="submit">
+<input type="submit" name="submit" value="<?php echo $submit_text ?>" />
+</p>
+
+<div id="advancedstuff" class="dbx-group" >
+
+<fieldset id="xfn" class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Link Relationship (XFN)') ?></h3>
+<div class="dbx-content">
+<table class="editform" width="100%" cellspacing="2" cellpadding="5">
+ <tr>
+ <th width="20%" scope="row"><?php _e('rel:') ?></th>
+ <td width="80%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th>
+ <td>
+ <table cellpadding="3" cellspacing="5">
+ <tr>
+ <th scope="row"> <?php _e('identity') ?> </th>
+ <td>
+ <label for="me">
+ <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
+ <?php _e('another web address of mine') ?></label>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php _e('friendship') ?> </th>
+ <td>
+ <label for="contact">
+ <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
+ <label for="acquaintance">
+ <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php _e('acquaintance') ?></label>
+ <label for="friend">
+ <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
+ <label for="friendship">
+ <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php _e('physical') ?> </th>
+ <td>
+ <label for="met">
+ <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
+ <?php _e('met') ?></label>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php _e('professional') ?> </th>
+ <td>
+ <label for="co-worker">
+ <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
+ <?php _e('co-worker') ?></label>
+ <label for="colleague">
+ <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
+ <?php _e('colleague') ?></label>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php _e('geographical') ?> </th>
+ <td>
+ <label for="co-resident">
+ <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
+ <?php _e('co-resident') ?></label>
+ <label for="neighbor">
+ <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
+ <?php _e('neighbor') ?></label>
+ <label for="geographical">
+ <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
+ <?php _e('none') ?></label>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php _e('family') ?> </th>
+ <td>
+ <label for="child">
+ <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
+ <?php _e('child') ?></label>
+ <label for="kin">
+ <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
+ <?php _e('kin') ?></label>
+ <label for="parent">
+ <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
+ <?php _e('parent') ?></label>
+ <label for="sibling">
+ <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
+ <?php _e('sibling') ?></label>
+ <label for="spouse">
+ <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
+ <?php _e('spouse') ?></label>
+ <label for="family">
+ <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
+ <?php _e('none') ?></label>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php _e('romantic') ?> </th>
+ <td>
+ <label for="muse">
+ <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
+ <?php _e('muse') ?></label>
+ <label for="crush">
+ <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
+ <?php _e('crush') ?></label>
+ <label for="date">
+ <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
+ <?php _e('date') ?></label>
+ <label for="romantic">
+ <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
+ <?php _e('sweetheart') ?></label>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</div>
+</fieldset>
+
+<fieldset id="advanced" class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Advanced') ?></h3>
+<div class="dbx-content">
+<table class="editform" width="100%" cellspacing="2" cellpadding="5">
+ <tr>
+ <th width="20%" scope="row"><?php _e('Image Address:') ?></th>
+ <td width="80%"><input type="text" name="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e('RSS Address:') ?> </th>
+ <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e('Notes:') ?></th>
+ <td><textarea name="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e('Rating:') ?></th>
+ <td><select name="link_rating" size="1">
+ <?php
+ for ($r = 0; $r < 10; $r++) {
+ echo(' <option value="'.$r.'" ');
+ if ($link->link_rating == $r)
+ echo 'selected="selected"';
+ echo('>'.$r.'</option>');
+ }
+ ?></select>&nbsp;<?php _e('(Leave at 0 for no rating.)') ?>
+ </td>
+ </tr>
+</table>
+</fieldset>
+</div>
+
+<?php if ( $link_id ) : ?>
+<input type="hidden" name="action" value="save" />
+<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
+<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
+<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
+<?php else: ?>
+<input type="hidden" name="action" value="add" />
+<?php endif; ?>
+</div>
+</form>
+</div>
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php
index f7083fd..93a6837 100644
--- a/wp-admin/edit-page-form.php
+++ b/wp-admin/edit-page-form.php
@@ -2,17 +2,22 @@
<div class="wrap">
<h2 id="write-post"><?php _e('Write Page'); ?></h2>
<?php
+
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()
$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
} else {
+ $post_ID = (int) $post_ID;
$form_action = 'editpost';
$nonce_action = 'update-page_' . $post_ID;
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
}
+$temp_ID = (int) $temp_ID;
+$user_ID = (int) $user_ID;
+
$sendto = clean_url(stripslashes(wp_get_referer()));
if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
@@ -68,7 +73,7 @@ addLoadEvent(focusit);
<fieldset id="passworddiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Page Password') ?></h3>
-<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
+<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div>
</fieldset>
<fieldset id="pageparent" class="dbx-box">
@@ -93,7 +98,7 @@ addLoadEvent(focusit);
<fieldset id="slugdiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Page Slug') ?></h3>
-<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
+<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div>
</fieldset>
<?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?>
@@ -106,6 +111,8 @@ foreach ($authors as $o) :
$o = get_userdata( $o->ID );
if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
else $selected = '';
+$o->ID = (int) $o->ID;
+$o->display_name = wp_specialchars( $o->display_name );
echo "<option value='$o->ID' $selected>$o->display_name</option>";
endforeach;
?>
@@ -126,7 +133,7 @@ endforeach;
<fieldset id="titlediv">
<legend><?php _e('Page Title') ?></legend>
- <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
+ <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div>
</fieldset>
@@ -163,7 +170,7 @@ if (current_user_can('upload_files')) {
$uploading_iframe_src = wp_nonce_url("upload.php?style=inline&amp;tab=upload&amp;post_id=$uploading_iframe_ID", 'inlineuploading');
$uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
if ( false != $uploading_iframe_src )
- echo '<iframe id="uploading" name="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
+ echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
}
?>
diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php
index 3218a1f..627a031 100644
--- a/wp-admin/edit-pages.php
+++ b/wp-admin/edit-pages.php
@@ -10,16 +10,14 @@ require_once('admin-header.php');
<h2><?php _e('Page Management'); ?></h2>
<p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page &raquo;'); ?></a></p>
-<form name="searchform" id="searchform" action="" method="get">
+<form name="searchform" action="" method="get">
<fieldset>
<legend><?php _e('Search Pages&hellip;') ?></legend>
- <input type="text" name="s" id="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" />
+ <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
</fieldset>
</form>
-<br style="clear:both;" />
-
<?php
wp('post_type=page&orderby=menu_order&what_to_show=posts&posts_per_page=-1&posts_per_archive_page=-1&order=asc');
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index fcb01a1..47f5ad8 100644
--- a/wp-admin/edit.php
+++ b/wp-admin/edit.php
@@ -76,7 +76,7 @@ if ( is_month() ) {
<form name="searchform" id="searchform" action="" method="get">
<fieldset>
<legend><?php _e('Search Posts&hellip;') ?></legend>
- <input type="text" name="s" id="s" value="<?php if (isset($s)) echo attribute_escape($s); ?>" size="17" />
+ <input type="text" name="s" value="<?php if (isset($s)) echo attribute_escape($s); ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" class="button" />
</fieldset>
</form>
@@ -196,7 +196,7 @@ foreach($posts_columns as $column_name=>$column_display_name) {
case 'comments':
?>
<td style="text-align: center">
- <?php comments_number("<a href='edit.php?p=$id&amp;c=1'>" . __('0') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('%') . '</a>') ?>
+ <?php comments_number(__('0'), "<a href='edit.php?p=$id&amp;c=1'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('%') . '</a>') ?>
</td>
<?php
break;
diff --git a/wp-admin/export.php b/wp-admin/export.php
index 51e007a..33ec633 100644
--- a/wp-admin/export.php
+++ b/wp-admin/export.php
@@ -1,228 +1,228 @@
-<?php
-require_once ('admin.php');
-$title = __('Export');
-$parent_file = 'edit.php';
-
-if ( isset( $_GET['download'] ) )
- export_wp();
-
-require_once ('admin-header.php');
-?>
-
-<div class="wrap">
-<h2><?php _e('Export'); ?></h2>
-<div class="narrow">
-<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
-<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.'); ?></p>
-<p><?php _e('Once you&#8217;ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
-<form action="" method="get">
-<h3><?php _e('Optional options'); ?></h3>
-
-<table>
-<tr>
-<th><?php _e('Restrict Author:'); ?></th>
-<td>
-<select name="author">
-<option value="all" selected="selected"><?php _e('All'); ?></option>
-<?php
-$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
-foreach ( $authors as $id ) {
- $o = get_userdata( $id );
- echo "<option value='$o->ID'>$o->display_name</option>";
-}
-?>
-</select>
-</td>
-</tr>
-</table>
-<p class="submit"><input type="submit" name="submit" value="<?php _e('Download Export File'); ?> &raquo;" />
-<input type="hidden" name="download" value="true" />
-</p>
-</form>
-<p><?php _e('If you are considering moving your blog to another host we recommend a number of <a href="http://wordpress.org/hosting/">hosting services</a>.'); ?></p>
-</div>
-</div>
-
-<?php
-
-function export_wp() {
-global $wpdb, $posts, $post;
-
-$filename = 'wordpress.' . date('Y-m-d') . '.xml';
-
-header('Content-Description: File Transfer');
-header("Content-Disposition: attachment; filename=$filename");
-header('Content-type: text/xml; charset=' . get_option('blog_charset'), true);
-
-$where = '';
-if ( isset( $_GET['author'] ) && $_GET['author'] != 'all' ) {
- $author_id = (int) $_GET['author'];
- $where = " WHERE post_author = '$author_id' ";
-}
-
-$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
-
-$categories = (array) $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, posts_private, links_private FROM $wpdb->categories LEFT JOIN $wpdb->post2cat ON (category_id = cat_id) LEFT JOIN $wpdb->posts ON (post_id <=> id) $where GROUP BY cat_id");
-
-function wxr_missing_parents($categories) {
- if ( !is_array($categories) || empty($categories) )
- return array();
-
- foreach ( $categories as $category )
- $parents[$category->cat_ID] = $category->category_parent;
-
- $parents = array_unique(array_diff($parents, array_keys($parents)));
-
- if ( $zero = array_search('0', $parents) )
- unset($parents[$zero]);
-
- return $parents;
-}
-
-while ( $parents = wxr_missing_parents($categories) ) {
- $found_parents = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, posts_private, links_private FROM $wpdb->categories WHERE cat_ID IN (" . join(', ', $parents) . ")");
- if ( is_array($found_parents) && count($found_parents) )
- $categories = array_merge($categories, $found_parents);
- else
- break;
-}
-
-// Put them in order to be inserted with no child going before its parent
-$pass = 0;
-$passes = 1000 + count($categories);
-while ( ( $cat = array_shift($categories) ) && ++$pass < $passes ) {
- if ( $cat->category_parent == 0 || isset($cats[$cat->category_parent]) ) {
- $cats[$cat->cat_ID] = $cat;
- } else {
- $categories[] = $cat;
- }
-}
-unset($categories);
-
-function wxr_cdata($str) {
- if ( seems_utf8($str) == false )
- $str = utf8_encode($str);
-
- // $str = ent2ncr(wp_specialchars($str));
-
- $str = "<![CDATA[$str" . ( ( substr($str, -1) == ']' ) ? ' ' : '') . "]]>";
-
- return $str;
-}
-
-function wxr_cat_name($c) {
- if ( empty($c->cat_name) )
- return;
-
- echo '<wp:cat_name>' . wxr_cdata($c->cat_name) . '</wp:cat_name>';
-}
-
-function wxr_category_description($c) {
- if ( empty($c->category_description) )
- return;
-
- echo '<wp:category_description>' . wxr_cdata($c->category_description) . '</wp:category_description>';
-}
-
-print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
-
-?>
-
-<!--
- This is a WordPress eXtended RSS file generated by WordPress as an export of
- your blog. It contains information about your blog's posts, comments, and
- categories. You may use this file to transfer that content from one site to
- another. This file is not intended to serve as a complete backup of your
- blog.
-
- To import this information into a WordPress blog follow these steps:
-
- 1. Log into that blog as an administrator.
- 2. Go to Manage > Import in the blog's admin.
- 3. Choose "WordPress" from the list of importers.
- 4. Upload this file using the form provided on that page.
- 5. You will first be asked to map the authors in this export file to users
- on the blog. For each author, you may choose to map an existing user on
- the blog or to create a new user.
- 6. WordPress will then import each of the posts, comments, and categories
- contained in this file onto your blog.
--->
-
-<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"-->
-<rss version="2.0"
- xmlns:content="http://purl.org/rss/1.0/modules/content/"
- xmlns:wfw="http://wellformedweb.org/CommentAPI/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:wp="http://wordpress.org/export/1.0/"
->
-
-<channel>
- <title><?php bloginfo_rss('name'); ?></title>
- <link><?php bloginfo_rss('url') ?></link>
- <description><?php bloginfo_rss("description") ?></description>
- <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
- <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
- <language><?php echo get_option('rss_language'); ?></language>
-<?php if ( $cats ) : foreach ( $cats as $c ) : ?>
- <wp:category><wp:category_nicename><?php echo $c->category_nicename; ?></wp:category_nicename><wp:category_parent><?php echo $c->category_parent ? $cats[$c->category_parent]->cat_name : ''; ?></wp:category_parent><wp:posts_private><?php echo $c->posts_private ? '1' : '0'; ?></wp:posts_private><wp:links_private><?php echo $c->links_private ? '1' : '0'; ?></wp:links_private><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category>
-<?php endforeach; endif; ?>
- <?php do_action('rss2_head'); ?>
- <?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
-<item>
-<title><?php the_title_rss() ?></title>
-<link><?php permalink_single_rss() ?></link>
-<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
-<dc:creator><?php the_author() ?></dc:creator>
-<?php the_category_rss() ?>
-
-<guid isPermaLink="false"><?php the_guid(); ?></guid>
-<description></description>
-<content:encoded><![CDATA[<?php echo $post->post_content ?>]]></content:encoded>
-<wp:post_id><?php echo $post->ID; ?></wp:post_id>
-<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
-<wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
-<wp:comment_status><?php echo $post->comment_status; ?></wp:comment_status>
-<wp:ping_status><?php echo $post->ping_status; ?></wp:ping_status>
-<wp:post_name><?php echo $post->post_name; ?></wp:post_name>
-<wp:status><?php echo $post->post_status; ?></wp:status>
-<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
-<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
-<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
-<?php
-$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
-if ( $postmeta ) {
-?>
-<?php foreach( $postmeta as $meta ) { ?>
-<wp:postmeta>
-<wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
-<wp:meta_value><?Php echo $meta->meta_value; ?></wp:meta_value>
-</wp:postmeta>
-<?php } ?>
-<?php } ?>
-<?php
-$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID");
-if ( $comments ) { foreach ( $comments as $c ) { ?>
-<wp:comment>
-<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
-<wp:comment_author><?php echo $c->comment_author; ?></wp:comment_author>
-<wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
-<wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url>
-<wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
-<wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
-<wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
-<wp:comment_content><?php echo $c->comment_content; ?></wp:comment_content>
-<wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
-<wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
-<wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
-</wp:comment>
-<?php } } ?>
- </item>
-<?php } } ?>
-</channel>
-</rss>
-<?php
- die();
-}
-
-include ('admin-footer.php');
-?>
+<?php
+require_once ('admin.php');
+$title = __('Export');
+$parent_file = 'edit.php';
+
+if ( isset( $_GET['download'] ) )
+ export_wp();
+
+require_once ('admin-header.php');
+?>
+
+<div class="wrap">
+<h2><?php _e('Export'); ?></h2>
+<div class="narrow">
+<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
+<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.'); ?></p>
+<p><?php _e('Once you&#8217;ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
+<form action="" method="get">
+<h3><?php _e('Optional options'); ?></h3>
+
+<table>
+<tr>
+<th><?php _e('Restrict Author:'); ?></th>
+<td>
+<select name="author">
+<option value="all" selected="selected"><?php _e('All'); ?></option>
+<?php
+$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
+foreach ( $authors as $id ) {
+ $o = get_userdata( $id );
+ echo "<option value='$o->ID'>$o->display_name</option>";
+}
+?>
+</select>
+</td>
+</tr>
+</table>
+<p class="submit"><input type="submit" name="submit" value="<?php _e('Download Export File'); ?> &raquo;" />
+<input type="hidden" name="download" value="true" />
+</p>
+</form>
+<p><?php _e('If you are considering moving your blog to another host we recommend a number of <a href="http://wordpress.org/hosting/">hosting services</a>.'); ?></p>
+</div>
+</div>
+
+<?php
+
+function export_wp() {
+global $wpdb, $posts, $post;
+
+$filename = 'wordpress.' . date('Y-m-d') . '.xml';
+
+header('Content-Description: File Transfer');
+header("Content-Disposition: attachment; filename=$filename");
+header('Content-type: text/xml; charset=' . get_option('blog_charset'), true);
+
+$where = '';
+if ( isset( $_GET['author'] ) && $_GET['author'] != 'all' ) {
+ $author_id = (int) $_GET['author'];
+ $where = " WHERE post_author = '$author_id' ";
+}
+
+$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
+
+$categories = (array) $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, posts_private, links_private FROM $wpdb->categories LEFT JOIN $wpdb->post2cat ON (category_id = cat_id) LEFT JOIN $wpdb->posts ON (post_id <=> id) $where GROUP BY cat_id");
+
+function wxr_missing_parents($categories) {
+ if ( !is_array($categories) || empty($categories) )
+ return array();
+
+ foreach ( $categories as $category )
+ $parents[$category->cat_ID] = $category->category_parent;
+
+ $parents = array_unique(array_diff($parents, array_keys($parents)));
+
+ if ( $zero = array_search('0', $parents) )
+ unset($parents[$zero]);
+
+ return $parents;
+}
+
+while ( $parents = wxr_missing_parents($categories) ) {
+ $found_parents = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, posts_private, links_private FROM $wpdb->categories WHERE cat_ID IN (" . join(', ', $parents) . ")");
+ if ( is_array($found_parents) && count($found_parents) )
+ $categories = array_merge($categories, $found_parents);
+ else
+ break;
+}
+
+// Put them in order to be inserted with no child going before its parent
+$pass = 0;
+$passes = 1000 + count($categories);
+while ( ( $cat = array_shift($categories) ) && ++$pass < $passes ) {
+ if ( $cat->category_parent == 0 || isset($cats[$cat->category_parent]) ) {
+ $cats[$cat->cat_ID] = $cat;
+ } else {
+ $categories[] = $cat;
+ }
+}
+unset($categories);
+
+function wxr_cdata($str) {
+ if ( seems_utf8($str) == false )
+ $str = utf8_encode($str);
+
+ // $str = ent2ncr(wp_specialchars($str));
+
+ $str = "<![CDATA[$str" . ( ( substr($str, -1) == ']' ) ? ' ' : '') . "]]>";
+
+ return $str;
+}
+
+function wxr_cat_name($c) {
+ if ( empty($c->cat_name) )
+ return;
+
+ echo '<wp:cat_name>' . wxr_cdata($c->cat_name) . '</wp:cat_name>';
+}
+
+function wxr_category_description($c) {
+ if ( empty($c->category_description) )
+ return;
+
+ echo '<wp:category_description>' . wxr_cdata($c->category_description) . '</wp:category_description>';
+}
+
+print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
+
+?>
+
+<!--
+ This is a WordPress eXtended RSS file generated by WordPress as an export of
+ your blog. It contains information about your blog's posts, comments, and
+ categories. You may use this file to transfer that content from one site to
+ another. This file is not intended to serve as a complete backup of your
+ blog.
+
+ To import this information into a WordPress blog follow these steps:
+
+ 1. Log into that blog as an administrator.
+ 2. Go to Manage > Import in the blog's admin.
+ 3. Choose "WordPress" from the list of importers.
+ 4. Upload this file using the form provided on that page.
+ 5. You will first be asked to map the authors in this export file to users
+ on the blog. For each author, you may choose to map an existing user on
+ the blog or to create a new user.
+ 6. WordPress will then import each of the posts, comments, and categories
+ contained in this file onto your blog.
+-->
+
+<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:i'); ?>"-->
+<rss version="2.0"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:wp="http://wordpress.org/export/1.0/"
+>
+
+<channel>
+ <title><?php bloginfo_rss('name'); ?></title>
+ <link><?php bloginfo_rss('url') ?></link>
+ <description><?php bloginfo_rss("description") ?></description>
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
+ <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
+ <language><?php echo get_option('rss_language'); ?></language>
+<?php if ( $cats ) : foreach ( $cats as $c ) : ?>
+ <wp:category><wp:category_nicename><?php echo $c->category_nicename; ?></wp:category_nicename><wp:category_parent><?php echo $c->category_parent ? $cats[$c->category_parent]->cat_name : ''; ?></wp:category_parent><wp:posts_private><?php echo $c->posts_private ? '1' : '0'; ?></wp:posts_private><wp:links_private><?php echo $c->links_private ? '1' : '0'; ?></wp:links_private><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category>
+<?php endforeach; endif; ?>
+ <?php do_action('rss2_head'); ?>
+ <?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
+<item>
+<title><?php the_title_rss() ?></title>
+<link><?php permalink_single_rss() ?></link>
+<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
+<dc:creator><?php the_author() ?></dc:creator>
+<?php the_category_rss() ?>
+
+<guid isPermaLink="false"><?php the_guid(); ?></guid>
+<description></description>
+<content:encoded><![CDATA[<?php echo $post->post_content ?>]]></content:encoded>
+<wp:post_id><?php echo $post->ID; ?></wp:post_id>
+<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
+<wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
+<wp:comment_status><?php echo $post->comment_status; ?></wp:comment_status>
+<wp:ping_status><?php echo $post->ping_status; ?></wp:ping_status>
+<wp:post_name><?php echo $post->post_name; ?></wp:post_name>
+<wp:status><?php echo $post->post_status; ?></wp:status>
+<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
+<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
+<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
+<?php
+$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
+if ( $postmeta ) {
+?>
+<?php foreach( $postmeta as $meta ) { ?>
+<wp:postmeta>
+<wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
+<wp:meta_value><?Php echo $meta->meta_value; ?></wp:meta_value>
+</wp:postmeta>
+<?php } ?>
+<?php } ?>
+<?php
+$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID");
+if ( $comments ) { foreach ( $comments as $c ) { ?>
+<wp:comment>
+<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
+<wp:comment_author><?php echo $c->comment_author; ?></wp:comment_author>
+<wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
+<wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url>
+<wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
+<wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
+<wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
+<wp:comment_content><?php echo $c->comment_content; ?></wp:comment_content>
+<wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
+<wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
+<wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
+</wp:comment>
+<?php } } ?>
+ </item>
+<?php } } ?>
+</channel>
+</rss>
+<?php
+ die();
+}
+
+include ('admin-footer.php');
+?>
diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php
index c3b821a..ceeafeb 100644
--- a/wp-admin/import/livejournal.php
+++ b/wp-admin/import/livejournal.php
@@ -49,7 +49,7 @@ class LJ_Import {
preg_match('|<eventtime>(.*?)</eventtime>|is', $post, $post_date);
$post_date = strtotime($post_date[1]);
- $post_date = date('Y-m-d H:i:s', $post_date);
+ $post_date = gmdate('Y-m-d H:i:s', $post_date);
preg_match('|<event>(.*?)</event>|is', $post, $post_content);
$post_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($post_content[1]));
diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php
index 286d74a..2d2b145 100644
--- a/wp-admin/import/textpattern.php
+++ b/wp-admin/import/textpattern.php
@@ -559,11 +559,11 @@ class Textpattern_Import {
{
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Textpattern, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
echo '<h3>'.__('Users').'</h3>';
- echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn&#8217;t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
+ echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn\'t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>';
echo '<h3>'.__('Preserving Authors').'</h3>';
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
echo '<h3>'.__('Textile').'</h3>';
- echo '<p>'.__('Also, since you&#8217;re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You&#8217;ll want it.').'</p>';
+ echo '<p>'.__('Also, since you\'re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';
echo '<h3>'.__('WordPress Resources').'</h3>';
echo '<p>'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'</p>';
echo '<ul>';
@@ -571,7 +571,7 @@ class Textpattern_Import {
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
echo '</ul>';
- echo '<p>'.sprintf(__('That&#8217;s it! What are you waiting for? Go <a href="%1$s">login</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
+ echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '/wp-login.php').'</p>';
}
function db_form()
diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php
index fa0d194..0b1aa2a 100644
--- a/wp-admin/import/wordpress.php
+++ b/wp-admin/import/wordpress.php
@@ -1,391 +1,391 @@
-<?php
-
-class WP_Import {
-
- var $posts = array ();
- var $posts_processed = array ();
- // Array of arrays. [[0] => XML fragment, [1] => New post ID]
- var $file;
- var $id;
- var $mtnames = array ();
- var $newauthornames = array ();
- var $j = -1;
-
- function header() {
- echo '<div class="wrap">';
- echo '<h2>'.__('Import WordPress').'</h2>';
- }
-
- function footer() {
- echo '</div>';
- }
-
- function unhtmlentities($string) { // From php.net for < 4.3 compat
- $trans_tbl = get_html_translation_table(HTML_ENTITIES);
- $trans_tbl = array_flip($trans_tbl);
- return strtr($string, $trans_tbl);
- }
-
- function greet() {
- echo '<div class="narrow">';
- echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we&#8217;ll import the posts, comments, custom fields, and categories into this blog.').'</p>';
- echo '<p>'.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'</p>';
- wp_import_upload_form("admin.php?import=wordpress&amp;step=1");
- echo '</div>';
- }
-
- function get_tag( $string, $tag ) {
- global $wpdb;
- preg_match("|<$tag.*?>(.*?)</$tag>|is", $string, $return);
- $return = $wpdb->escape( trim( $return[1] ) );
- return $return;
- }
-
- function users_form($n) {
- global $wpdb, $testing;
- $users = get_users_of_blog($wpdb->blogid);
-?><select name="userselect[<?php echo $n; ?>]">
- <option value="#NONE#">- Select -</option>
- <?php
- foreach ($users as $user) {
- echo '<option value="'.$user->user_login.'">'.$user->user_login.'</option>';
- }
-?>
- </select>
- <?php
- }
-
- //function to check the authorname and do the mapping
- function checkauthor($author) {
- global $wpdb;
-
- $map = $_POST['userselect'];
-
- $user_id = username_exists($map[$author]); //use that key to get the value of the author's name from $newauthornames
-
- return $user_id;
- }
-
- function get_entries() {
- set_magic_quotes_runtime(0);
- $importdata = array_map('rtrim', file($this->file)); // Read the file into an array
-
- $this->posts = array();
- $this->categories = array();
- $num = 0;
- $doing_entry = false;
- foreach ($importdata as $importline) {
- if ( false !== strpos($importline, '<wp:category>') ) {
- preg_match('|<wp:category>(.*?)</wp:category>|is', $importline, $category);
- $this->categories[] = $category[1];
- continue;
- }
- if ( false !== strpos($importline, '<item>') ) {
- $this->posts[$num] = '';
- $doing_entry = true;
- continue;
- }
- if ( false !== strpos($importline, '</item>') ) {
- $num++;
- $doing_entry = false;
- continue;
- }
- if ( $doing_entry ) {
- $this->posts[$num] .= $importline . "\n";
- }
- }
-
- foreach ($this->posts as $post) {
- $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
- if ($post_ID) {
- $this->posts_processed[$post_ID][0] = &$post;
- $this->posts_processed[$post_ID][1] = 0;
- }
- }
- }
-
- function get_wp_authors() {
- $temp = array ();
- $i = -1;
- foreach ($this->posts as $post) {
- if ('' != trim($post)) {
- ++ $i;
- $author = $this->get_tag( $post, 'dc:creator' );
- array_push($temp, "$author"); //store the extracted author names in a temporary array
- }
- }
-
- // We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting.
- $authors[0] = array_shift($temp);
- $y = count($temp) + 1;
- for ($x = 1; $x < $y; $x ++) {
- $next = array_shift($temp);
- if (!(in_array($next, $authors)))
- array_push($authors, "$next");
- }
-
- return $authors;
- }
-
- function get_authors_from_post() {
- $formnames = array ();
- $selectnames = array ();
-
- foreach ($_POST['user'] as $key => $line) {
- $newname = trim(stripslashes($line));
- if ($newname == '')
- $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form.
- array_push($formnames, "$newname");
- } // $formnames is the array with the form entered names
-
- foreach ($_POST['userselect'] as $user => $key) {
- $selected = trim(stripslashes($key));
- array_push($selectnames, "$selected");
- }
-
- $count = count($formnames);
- for ($i = 0; $i < $count; $i ++) {
- if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form
- array_push($this->newauthornames, "$selectnames[$i]");
- } else {
- array_push($this->newauthornames, "$formnames[$i]");
- }
- }
- }
-
- function wp_authors_form() {
-?>
-<h2><?php _e('Assign Authors'); ?></h2>
-<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
- <?php
-
-
- $authors = $this->get_wp_authors();
- echo '<ol id="authors">';
- echo '<form action="?import=wordpress&amp;step=2&amp;id=' . $this->id . '" method="post">';
- wp_nonce_field('import-wordpress');
- $j = -1;
- foreach ($authors as $author) {
- ++ $j;
- echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.'Map to existing: ';
- $this->users_form($j);
- echo '</li>';
- }
-
- echo '<input type="submit" value="Submit">'.'<br/>';
- echo '</form>';
- echo '</ol>';
-
- }
-
- function select_authors() {
- $file = wp_import_handle_upload();
- if ( isset($file['error']) ) {
- echo '<p>'.__('Sorry, there has been an error.').'</p>';
- echo '<p><strong>' . $file['error'] . '</strong></p>';
- return;
- }
- $this->file = $file['file'];
- $this->id = (int) $file['id'];
-
- $this->get_entries();
- $this->wp_authors_form();
- }
-
- function process_categories() {
- global $wpdb;
-
- $cat_names = (array) $wpdb->get_col("SELECT cat_name FROM $wpdb->categories");
-
- while ( $c = array_shift($this->categories) ) {
- $cat_name = trim(str_replace(array ('<![CDATA[', ']]>'), '', $this->get_tag( $c, 'wp:cat_name' )));
-
- // If the category exists we leave it alone
- if ( in_array($cat_name, $cat_names) )
- continue;
-
- $category_nicename = $this->get_tag( $c, 'wp:category_nicename' );
- $posts_private = (int) $this->get_tag( $c, 'wp:posts_private' );
- $links_private = (int) $this->get_tag( $c, 'wp:links_private' );
-
- $parent = $this->get_tag( $c, 'wp:category_parent' );
-
- if ( empty($parent) )
- $category_parent = '0';
- else
- $category_parent = category_exists($parent);
-
- $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name');
-
- $cat_ID = wp_insert_category($catarr);
- }
- }
-
- function process_posts() {
- $i = -1;
- echo '<ol>';
-
- foreach ($this->posts as $post)
- $this->process_post($post);
-
- echo '</ol>';
-
- wp_import_cleanup($this->id);
-
- echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
- }
-
- function process_post($post) {
- global $wpdb;
-
- $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
- if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already
- return 0;
-
- // There are only ever one of these
- $post_title = $this->get_tag( $post, 'title' );
- $post_date = $this->get_tag( $post, 'wp:post_date' );
- $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
- $comment_status = $this->get_tag( $post, 'wp:comment_status' );
- $ping_status = $this->get_tag( $post, 'wp:ping_status' );
- $post_status = $this->get_tag( $post, 'wp:status' );
- $post_name = $this->get_tag( $post, 'wp:post_name' );
- $post_parent = $this->get_tag( $post, 'wp:post_parent' );
- $menu_order = $this->get_tag( $post, 'wp:menu_order' );
- $post_type = $this->get_tag( $post, 'wp:post_type' );
- $guid = $this->get_tag( $post, 'guid' );
- $post_author = $this->get_tag( $post, 'dc:creator' );
-
- $post_content = $this->get_tag( $post, 'content:encoded' );
- $post_content = str_replace(array ('<![CDATA[', ']]>'), '', $post_content);
- $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
- $post_content = str_replace('<br>', '<br />', $post_content);
- $post_content = str_replace('<hr>', '<hr />', $post_content);
-
- preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
- $categories = $categories[1];
-
- $cat_index = 0;
- foreach ($categories as $category) {
- $categories[$cat_index] = $wpdb->escape($this->unhtmlentities(str_replace(array ('<![CDATA[', ']]>'), '', $category)));
- $cat_index++;
- }
-
- if ($post_id = post_exists($post_title, '', $post_date)) {
- echo '<li>';
- printf(__('Post <i>%s</i> already exists.'), stripslashes($post_title));
- } else {
-
- // If it has parent, process parent first.
- $post_parent = (int) $post_parent;
- if ($parent = $this->posts_processed[$post_parent]) {
- if (!$parent[1]) $this->process_post($parent[0]); // If not yet, process the parent first.
- $post_parent = $parent[1]; // New ID of the parent;
- }
-
- echo '<li>';
- printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
-
- $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
-
- $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'post_name', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'menu_order', 'post_type');
- $comment_post_ID = $post_id = wp_insert_post($postdata);
-
- // Memorize old and new ID.
- if ( $post_id && $post_ID && $this->posts_processed[$post_ID] )
- $this->posts_processed[$post_ID][1] = $post_id; // New ID.
-
- // Add categories.
- if (count($categories) > 0) {
- $post_cats = array();
- foreach ($categories as $category) {
- $cat_ID = (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name = '$category'");
- if ($cat_ID == 0) {
- $cat_ID = wp_insert_category(array('cat_name' => $category));
- }
- $post_cats[] = $cat_ID;
- }
- wp_set_post_categories($post_id, $post_cats);
- }
- }
-
- // Now for comments
- preg_match_all('|<wp:comment>(.*?)</wp:comment>|is', $post, $comments);
- $comments = $comments[1];
- $num_comments = 0;
- if ( $comments) { foreach ($comments as $comment) {
- $comment_author = $this->get_tag( $comment, 'wp:comment_author');
- $comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email');
- $comment_author_IP = $this->get_tag( $comment, 'wp:comment_author_IP');
- $comment_author_url = $this->get_tag( $comment, 'wp:comment_author_url');
- $comment_date = $this->get_tag( $comment, 'wp:comment_date');
- $comment_date_gmt = $this->get_tag( $comment, 'wp:comment_date_gmt');
- $comment_content = $this->get_tag( $comment, 'wp:comment_content');
- $comment_approved = $this->get_tag( $comment, 'wp:comment_approved');
- $comment_type = $this->get_tag( $comment, 'wp:comment_type');
- $comment_parent = $this->get_tag( $comment, 'wp:comment_parent');
-
- if ( !comment_exists($comment_author, $comment_date) ) {
- $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent');
- wp_insert_comment($commentdata);
- $num_comments++;
- }
- } }
-
- if ( $num_comments )
- printf(' '.__('(%s comments)'), $num_comments);
-
- // Now for post meta
- preg_match_all('|<wp:postmeta>(.*?)</wp:postmeta>|is', $post, $postmeta);
- $postmeta = $postmeta[1];
- if ( $postmeta) { foreach ($postmeta as $p) {
- $key = $this->get_tag( $p, 'wp:meta_key' );
- $value = $this->get_tag( $p, 'wp:meta_value' );
- $value = stripslashes($value); // add_post_meta() will escape.
- add_post_meta( $post_id, $key, $value );
- } }
- }
-
- function import() {
- $this->id = (int) $_GET['id'];
-
- $this->file = get_attached_file($this->id);
- $this->get_authors_from_post();
- $this->get_entries();
- $this->process_categories();
- $this->process_posts();
- }
-
- function dispatch() {
- if (empty ($_GET['step']))
- $step = 0;
- else
- $step = (int) $_GET['step'];
-
- $this->header();
- switch ($step) {
- case 0 :
- $this->greet();
- break;
- case 1 :
- check_admin_referer('import-upload');
- $this->select_authors();
- break;
- case 2:
- check_admin_referer('import-wordpress');
- $this->import();
- break;
- }
- $this->footer();
- }
-
- function WP_Import() {
- // Nothing.
- }
-}
-
-$wp_import = new WP_Import();
-
-register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, pages, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch'));
-
-?>
+<?php
+
+class WP_Import {
+
+ var $posts = array ();
+ var $posts_processed = array ();
+ // Array of arrays. [[0] => XML fragment, [1] => New post ID]
+ var $file;
+ var $id;
+ var $mtnames = array ();
+ var $newauthornames = array ();
+ var $j = -1;
+
+ function header() {
+ echo '<div class="wrap">';
+ echo '<h2>'.__('Import WordPress').'</h2>';
+ }
+
+ function footer() {
+ echo '</div>';
+ }
+
+ function unhtmlentities($string) { // From php.net for < 4.3 compat
+ $trans_tbl = get_html_translation_table(HTML_ENTITIES);
+ $trans_tbl = array_flip($trans_tbl);
+ return strtr($string, $trans_tbl);
+ }
+
+ function greet() {
+ echo '<div class="narrow">';
+ echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we&#8217;ll import the posts, comments, custom fields, and categories into this blog.').'</p>';
+ echo '<p>'.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'</p>';
+ wp_import_upload_form("admin.php?import=wordpress&amp;step=1");
+ echo '</div>';
+ }
+
+ function get_tag( $string, $tag ) {
+ global $wpdb;
+ preg_match("|<$tag.*?>(.*?)</$tag>|is", $string, $return);
+ $return = $wpdb->escape( trim( $return[1] ) );
+ return $return;
+ }
+
+ function users_form($n) {
+ global $wpdb, $testing;
+ $users = get_users_of_blog($wpdb->blogid);
+?><select name="userselect[<?php echo $n; ?>]">
+ <option value="#NONE#">- Select -</option>
+ <?php
+ foreach ($users as $user) {
+ echo '<option value="'.$user->user_login.'">'.$user->user_login.'</option>';
+ }
+?>
+ </select>
+ <?php
+ }
+
+ //function to check the authorname and do the mapping
+ function checkauthor($author) {
+ global $wpdb;
+
+ $map = $_POST['userselect'];
+
+ $user_id = username_exists($map[$author]); //use that key to get the value of the author's name from $newauthornames
+
+ return $user_id;
+ }
+
+ function get_entries() {
+ set_magic_quotes_runtime(0);
+ $importdata = array_map('rtrim', file($this->file)); // Read the file into an array
+
+ $this->posts = array();
+ $this->categories = array();
+ $num = 0;
+ $doing_entry = false;
+ foreach ($importdata as $importline) {
+ if ( false !== strpos($importline, '<wp:category>') ) {
+ preg_match('|<wp:category>(.*?)</wp:category>|is', $importline, $category);
+ $this->categories[] = $category[1];
+ continue;
+ }
+ if ( false !== strpos($importline, '<item>') ) {
+ $this->posts[$num] = '';
+ $doing_entry = true;
+ continue;
+ }
+ if ( false !== strpos($importline, '</item>') ) {
+ $num++;
+ $doing_entry = false;
+ continue;
+ }
+ if ( $doing_entry ) {
+ $this->posts[$num] .= $importline . "\n";
+ }
+ }
+
+ foreach ($this->posts as $post) {
+ $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
+ if ($post_ID) {
+ $this->posts_processed[$post_ID][0] = &$post;
+ $this->posts_processed[$post_ID][1] = 0;
+ }
+ }
+ }
+
+ function get_wp_authors() {
+ $temp = array ();
+ $i = -1;
+ foreach ($this->posts as $post) {
+ if ('' != trim($post)) {
+ ++ $i;
+ $author = $this->get_tag( $post, 'dc:creator' );
+ array_push($temp, "$author"); //store the extracted author names in a temporary array
+ }
+ }
+
+ // We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting.
+ $authors[0] = array_shift($temp);
+ $y = count($temp) + 1;
+ for ($x = 1; $x < $y; $x ++) {
+ $next = array_shift($temp);
+ if (!(in_array($next, $authors)))
+ array_push($authors, "$next");
+ }
+
+ return $authors;
+ }
+
+ function get_authors_from_post() {
+ $formnames = array ();
+ $selectnames = array ();
+
+ foreach ($_POST['user'] as $key => $line) {
+ $newname = trim(stripslashes($line));
+ if ($newname == '')
+ $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form.
+ array_push($formnames, "$newname");
+ } // $formnames is the array with the form entered names
+
+ foreach ($_POST['userselect'] as $user => $key) {
+ $selected = trim(stripslashes($key));
+ array_push($selectnames, "$selected");
+ }
+
+ $count = count($formnames);
+ for ($i = 0; $i < $count; $i ++) {
+ if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form
+ array_push($this->newauthornames, "$selectnames[$i]");
+ } else {
+ array_push($this->newauthornames, "$formnames[$i]");
+ }
+ }
+ }
+
+ function wp_authors_form() {
+?>
+<h2><?php _e('Assign Authors'); ?></h2>
+<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
+ <?php
+
+
+ $authors = $this->get_wp_authors();
+ echo '<ol id="authors">';
+ echo '<form action="?import=wordpress&amp;step=2&amp;id=' . $this->id . '" method="post">';
+ wp_nonce_field('import-wordpress');
+ $j = -1;
+ foreach ($authors as $author) {
+ ++ $j;
+ echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.'Map to existing: ';
+ $this->users_form($j);
+ echo '</li>';
+ }
+
+ echo '<input type="submit" value="Submit">'.'<br/>';
+ echo '</form>';
+ echo '</ol>';
+
+ }
+
+ function select_authors() {
+ $file = wp_import_handle_upload();
+ if ( isset($file['error']) ) {
+ echo '<p>'.__('Sorry, there has been an error.').'</p>';
+ echo '<p><strong>' . $file['error'] . '</strong></p>';
+ return;
+ }
+ $this->file = $file['file'];
+ $this->id = (int) $file['id'];
+
+ $this->get_entries();
+ $this->wp_authors_form();
+ }
+
+ function process_categories() {
+ global $wpdb;
+
+ $cat_names = (array) $wpdb->get_col("SELECT cat_name FROM $wpdb->categories");
+
+ while ( $c = array_shift($this->categories) ) {
+ $cat_name = trim(str_replace(array ('<![CDATA[', ']]>'), '', $this->get_tag( $c, 'wp:cat_name' )));
+
+ // If the category exists we leave it alone
+ if ( in_array($cat_name, $cat_names) )
+ continue;
+
+ $category_nicename = $this->get_tag( $c, 'wp:category_nicename' );
+ $posts_private = (int) $this->get_tag( $c, 'wp:posts_private' );
+ $links_private = (int) $this->get_tag( $c, 'wp:links_private' );
+
+ $parent = $this->get_tag( $c, 'wp:category_parent' );
+
+ if ( empty($parent) )
+ $category_parent = '0';
+ else
+ $category_parent = category_exists($parent);
+
+ $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name');
+
+ $cat_ID = wp_insert_category($catarr);
+ }
+ }
+
+ function process_posts() {
+ $i = -1;
+ echo '<ol>';
+
+ foreach ($this->posts as $post)
+ $this->process_post($post);
+
+ echo '</ol>';
+
+ wp_import_cleanup($this->id);
+
+ echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
+ }
+
+ function process_post($post) {
+ global $wpdb;
+
+ $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
+ if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already
+ return 0;
+
+ // There are only ever one of these
+ $post_title = $this->get_tag( $post, 'title' );
+ $post_date = $this->get_tag( $post, 'wp:post_date' );
+ $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
+ $comment_status = $this->get_tag( $post, 'wp:comment_status' );
+ $ping_status = $this->get_tag( $post, 'wp:ping_status' );
+ $post_status = $this->get_tag( $post, 'wp:status' );
+ $post_name = $this->get_tag( $post, 'wp:post_name' );
+ $post_parent = $this->get_tag( $post, 'wp:post_parent' );
+ $menu_order = $this->get_tag( $post, 'wp:menu_order' );
+ $post_type = $this->get_tag( $post, 'wp:post_type' );
+ $guid = $this->get_tag( $post, 'guid' );
+ $post_author = $this->get_tag( $post, 'dc:creator' );
+
+ $post_content = $this->get_tag( $post, 'content:encoded' );
+ $post_content = str_replace(array ('<![CDATA[', ']]>'), '', $post_content);
+ $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
+ $post_content = str_replace('<br>', '<br />', $post_content);
+ $post_content = str_replace('<hr>', '<hr />', $post_content);
+
+ preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
+ $categories = $categories[1];
+
+ $cat_index = 0;
+ foreach ($categories as $category) {
+ $categories[$cat_index] = $wpdb->escape($this->unhtmlentities(str_replace(array ('<![CDATA[', ']]>'), '', $category)));
+ $cat_index++;
+ }
+
+ if ($post_id = post_exists($post_title, '', $post_date)) {
+ echo '<li>';
+ printf(__('Post <i>%s</i> already exists.'), stripslashes($post_title));
+ } else {
+
+ // If it has parent, process parent first.
+ $post_parent = (int) $post_parent;
+ if ($parent = $this->posts_processed[$post_parent]) {
+ if (!$parent[1]) $this->process_post($parent[0]); // If not yet, process the parent first.
+ $post_parent = $parent[1]; // New ID of the parent;
+ }
+
+ echo '<li>';
+ printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
+
+ $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
+
+ $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'post_name', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'menu_order', 'post_type');
+ $comment_post_ID = $post_id = wp_insert_post($postdata);
+
+ // Memorize old and new ID.
+ if ( $post_id && $post_ID && $this->posts_processed[$post_ID] )
+ $this->posts_processed[$post_ID][1] = $post_id; // New ID.
+
+ // Add categories.
+ if (count($categories) > 0) {
+ $post_cats = array();
+ foreach ($categories as $category) {
+ $cat_ID = (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name = '$category'");
+ if ($cat_ID == 0) {
+ $cat_ID = wp_insert_category(array('cat_name' => $category));
+ }
+ $post_cats[] = $cat_ID;
+ }
+ wp_set_post_categories($post_id, $post_cats);
+ }
+ }
+
+ // Now for comments
+ preg_match_all('|<wp:comment>(.*?)</wp:comment>|is', $post, $comments);
+ $comments = $comments[1];
+ $num_comments = 0;
+ if ( $comments) { foreach ($comments as $comment) {
+ $comment_author = $this->get_tag( $comment, 'wp:comment_author');
+ $comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email');
+ $comment_author_IP = $this->get_tag( $comment, 'wp:comment_author_IP');
+ $comment_author_url = $this->get_tag( $comment, 'wp:comment_author_url');
+ $comment_date = $this->get_tag( $comment, 'wp:comment_date');
+ $comment_date_gmt = $this->get_tag( $comment, 'wp:comment_date_gmt');
+ $comment_content = $this->get_tag( $comment, 'wp:comment_content');
+ $comment_approved = $this->get_tag( $comment, 'wp:comment_approved');
+ $comment_type = $this->get_tag( $comment, 'wp:comment_type');
+ $comment_parent = $this->get_tag( $comment, 'wp:comment_parent');
+
+ if ( !comment_exists($comment_author, $comment_date) ) {
+ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent');
+ wp_insert_comment($commentdata);
+ $num_comments++;
+ }
+ } }
+
+ if ( $num_comments )
+ printf(' '.__('(%s comments)'), $num_comments);
+
+ // Now for post meta
+ preg_match_all('|<wp:postmeta>(.*?)</wp:postmeta>|is', $post, $postmeta);
+ $postmeta = $postmeta[1];
+ if ( $postmeta) { foreach ($postmeta as $p) {
+ $key = $this->get_tag( $p, 'wp:meta_key' );
+ $value = $this->get_tag( $p, 'wp:meta_value' );
+ $value = stripslashes($value); // add_post_meta() will escape.
+ add_post_meta( $post_id, $key, $value );
+ } }
+ }
+
+ function import() {
+ $this->id = (int) $_GET['id'];
+
+ $this->file = get_attached_file($this->id);
+ $this->get_authors_from_post();
+ $this->get_entries();
+ $this->process_categories();
+ $this->process_posts();
+ }
+
+ function dispatch() {
+ if (empty ($_GET['step']))
+ $step = 0;
+ else
+ $step = (int) $_GET['step'];
+
+ $this->header();
+ switch ($step) {
+ case 0 :
+ $this->greet();
+ break;
+ case 1 :
+ check_admin_referer('import-upload');
+ $this->select_authors();
+ break;
+ case 2:
+ check_admin_referer('import-wordpress');
+ $this->import();
+ break;
+ }
+ $this->footer();
+ }
+
+ function WP_Import() {
+ // Nothing.
+ }
+}
+
+$wp_import = new WP_Import();
+
+register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, pages, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch'));
+
+?>
diff --git a/wp-admin/index.php b/wp-admin/index.php
index a3d3151..7e70aec 100644
--- a/wp-admin/index.php
+++ b/wp-admin/index.php
@@ -43,7 +43,7 @@ if ( $comments || $numcomments ) :
<h3><?php _e('Comments'); ?> <a href="edit-comments.php" title="<?php _e('More comments...'); ?>">&raquo;</a></h3>
<?php if ( $numcomments ) : ?>
-<p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s)'), number_format_i18n($numcomments) ); ?> &raquo;</a></strong></p>
+<p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s)'), number_format($numcomments) ); ?> &raquo;</a></strong></p>
<?php endif; ?>
<ul>
@@ -103,9 +103,9 @@ $numposts = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_t
$numcomms = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
$numcats = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories");
-$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), number_format_i18n($numposts), 'edit.php');
-$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), number_format_i18n($numcomms), 'edit-comments.php');
-$cat_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), number_format_i18n($numcats), 'categories.php');
+$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), number_format($numposts), 'edit.php');
+$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), number_format($numcomms), 'edit-comments.php');
+$cat_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), number_format($numcats), 'categories.php');
?>
<p><?php printf(__('There are currently %1$s and %2$s, contained within %3$s.'), $post_str, $comm_str, $cat_str); ?></p>
diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php
index 77196bb..f602097 100644
--- a/wp-admin/link-manager.php
+++ b/wp-admin/link-manager.php
@@ -199,19 +199,6 @@ if ( $links ) {
</form>
<?php } ?>
-<?php
-if( wp_cache_get( "checked_bookmarks_table", "options" ) == false ) {
- $results = $wpdb->get_results( "SELECT link_id, category_id, count( * ) AS c FROM {$wpdb->link2cat} GROUP BY link_id, category_id" );
- if( $results != null ) {
- foreach( $results as $link ) {
- if( $link->c > 1 ) {
- $wpdb->query( "DELETE FROM {$wpdb->link2cat} WHERE link_id='{$link->link_id}' AND category_id='{$link->category_id}'" );
- $wpdb->query( "INSERT INTO {$wpdb->link2cat} VALUES ( 0, '{$link->link_id}', '{$link->category_id}' )" );
- }
- }
- }
- wp_cache_set( "checked_bookmarks_table", "1", "options" );
-} ?>
</div>
diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php
index caa37ec..e24a9a1 100644
--- a/wp-admin/moderation.php
+++ b/wp-admin/moderation.php
@@ -123,14 +123,14 @@ $i = 0;
<?php comment_text() ?>
<p><?php comment_date(__('M j, g:i A')); ?> &#8212; [ <?php
echo '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'">' . __('Edit') . '</a> | ';
-echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\">" . __('Delete') . "</a> "; ?> ] &#8212;
+echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\">" . __('Delete') . "</a> | "; ?>
<?php
$post = get_post($comment->comment_post_ID);
$post_title = wp_specialchars( $post->post_title, 'double' );
$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
?>
-<a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a></p>
-<p><?php _e('Bulk action:') ?>
+<a href="<?php echo get_permalink($comment->comment_post_ID); ?>" title="<?php echo $post_title; ?>"><?php _e('View Post') ?></a> ] &#8212;
+ <?php _e('Bulk action:') ?>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-approve" value="approve" /> <label for="comment-<?php echo $comment->comment_ID; ?>-approve"><?php _e('Approve') ?></label> &nbsp;
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-spam" value="spam" /> <label for="comment-<?php echo $comment->comment_ID; ?>-spam"><?php _e('Spam') ?></label> &nbsp;
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-delete" value="delete" /> <label for="comment-<?php echo $comment->comment_ID; ?>-delete"><?php _e('Delete') ?></label> &nbsp;
@@ -182,7 +182,7 @@ document.write('<ul><li><a href="javascript:markAllForApprove()"><?php _e('Mark
<noscript>
<p>
- <input name="feelinglucky" type="checkbox" id="feelinglucky" value="true" /> <label for="feelinglucky"><?php _e('Delete every comment marked &#8220;defer.&#8221; <strong>Warning: This can&#8217;t be undone.</strong>'); ?></label>
+ <input name="feelinglucky" type="checkbox" id="feelinglucky" value="true" /> <label for="feelinglucky"><?php _e('Delete every comment marked "defer." <strong>Warning: This can&#8217;t be undone.</strong>'); ?></label>
</p>
</noscript>
</form>
diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php
index f2d01ea..9e0e8df 100644
--- a/wp-admin/options-reading.php
+++ b/wp-admin/options-reading.php
@@ -5,16 +5,6 @@ $title = __('Reading Options');
$parent_file = 'options-general.php';
include('admin-header.php');
-
-// Sanity checks
-if ( 'page' == get_option('show_on_front') ) {
- $front_page = get_option('page_on_front');
- if ( empty($front_page) ) {
- update_option('show_on_front', 'posts');
- delete_option('page_for_posts');
- delete_option('page_on_front');
- }
-}
?>
<div class="wrap">
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index c4e5808..ec90396 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -138,7 +138,10 @@ if (empty($plugins)) {
if ( $style != '' )
$style = 'class="' . $style . '"';
- $edit = '';
+ if ( is_writable(ABSPATH . PLUGINDIR . '/' . $plugin_file) )
+ $edit = "<a href='plugin-editor.php?file=$plugin_file' title='".__('Open this file in the Plugin Editor')."' class='edit'>".__('Edit')."</a>";
+ else
+ $edit = '';
echo "
<tr $style>
diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php
index e2c978b..fd8a046 100644
--- a/wp-admin/post-new.php
+++ b/wp-admin/post-new.php
@@ -10,7 +10,7 @@ require_once ('./admin-header.php');
if ( ! current_user_can('edit_posts') ) { ?>
<div class="wrap">
-<p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to add the <code>edit_posts</code> capability to your user, in order to be authorized to post.<br />
+<p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />
You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)'), get_option('admin_email')); ?>
</p>
@@ -57,7 +57,7 @@ include('edit-form-advanced.php');
<?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?>
<div id="wp-bookmarklet" class="wrap">
<h3><?php _e('WordPress Bookmarklet'); ?></h3>
-<p><?php _e('Right click on the following link and choose &#0147;Bookmark This Link...&#0148; or &#0147;Add to Favorites...&#0148; to create a posting shortcut.'); ?></p>
+<p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p>
<p>
<?php
diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php
index 0e8e071..d162e58 100644
--- a/wp-admin/upgrade-functions.php
+++ b/wp-admin/upgrade-functions.php
@@ -175,6 +175,8 @@ function upgrade_all() {
upgrade_110();
upgrade_130();
}
+
+ maybe_disable_automattic_widgets();
if ( $wp_current_db_version < 3308 )
upgrade_160();
@@ -184,8 +186,6 @@ function upgrade_all() {
if ( $wp_current_db_version < 4351 )
upgrade_old_slugs();
-
- maybe_disable_automattic_widgets();
$wp_rewrite->flush_rules();
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index c025f62..e3c1a3a 100644
--- a/wp-admin/user-edit.php
+++ b/wp-admin/user-edit.php
@@ -82,7 +82,7 @@ include ('admin-header.php');
<form name="profile" id="your-profile" action="user-edit.php" method="post">
<?php wp_nonce_field('update-user_' . $user_id) ?>
<?php if ( $wp_http_referer ) : ?>
- <input type="hidden" name="wp_http_referer" value="<?php echo wp_specialchars($wp_http_referer); ?>" />
+ <input type="hidden" name="wp_http_referer" value="<?php echo clean_url($wp_http_referer); ?>" />
<?php endif; ?>
<p>
<input type="hidden" name="from" value="profile" />
diff --git a/wp-admin/users.php b/wp-admin/users.php
index bc5cac8..154a7d7 100644
--- a/wp-admin/users.php
+++ b/wp-admin/users.php
@@ -511,7 +511,7 @@ foreach($roleclasses as $role => $roleclass) {
<?php if ( !empty($role) ) : ?>
<th colspan="7"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th>
<?php else : ?>
- <th colspan="7"><h3><em><?php _e('No role for this blog'); ?></h3></th>
+ <th colspan="7"><h3><em><?php _e('No role for this blog'); ?></em></h3></th>
<?php endif; ?>
</tr>
<tr class="thead">
diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php
index a8d469e..b6b330c 100644
--- a/wp-admin/widgets.php
+++ b/wp-admin/widgets.php
@@ -68,9 +68,11 @@ function wp_widgets_admin_head() {
$A(Draggables.drags).map(function(o) {o.startDrag(null); o.finishDrag(null);});
//for ( var n in Draggables.drags ) {
for ( n=0; n<=Draggables.drags.length; n++ ) {
- if ( Draggables.drags[n].element.id == 'lastmodule' ) {
- Draggables.drags[n].destroy();
- break;
+ if ( parseInt( n ) ) {
+ if ( Draggables.drags[n].element.id == 'lastmodule' ) {
+ Draggables.drags[n].destroy();
+ break;
+ }
}
}
resetPaletteHeight();
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index 14c93a2..5fc8d55 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -120,6 +120,7 @@ a:visited {
}
a:hover {
+/* border-bottom: 1px solid #3a75ae;*/
color: #069;
}
@@ -131,7 +132,7 @@ body {
}
body, td {
- font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
}
fieldset {
@@ -169,10 +170,10 @@ form, label input {
}
h2 {
+ border-bottom: .5em solid #e5f3ff;
color: #333;
- font: normal 32px serif;
+ font: normal 32px/5px serif;
margin: 5px 10px;
- background: url( images/heading-bg.gif ) repeat-x bottom;
}
img, #footer a {
@@ -436,7 +437,7 @@ form#upload #post_content {
}
.wrap h2 {
- margin: 0 0 .5em;
+ margin: .4em 0 .5em;
clear: both;
}
@@ -537,7 +538,7 @@ input.disabled, textarea.disabled {
border: none;
}
-#postdiv, #titlediv, #guiddiv, #tagdiv {
+#postdiv, #titlediv, #guiddiv {
margin: 0 8px 0 0;
padding: 0;
}
@@ -557,7 +558,7 @@ input.disabled, textarea.disabled {
line-height: 140%;
}
-#titlediv input, #guiddiv input, #tagdiv input {
+#titlediv input, #guiddiv input {
margin: 0;
width: 100%;
}
@@ -911,13 +912,17 @@ input.delete:hover {
}
#zeitgeist h2, fieldset legend a {
- background: none;
+ border-bottom: none;
}
* html #zeitgeist h2 {
padding-top: 10px;
}
+#zeitgeist h2 {
+ margin-top: .4em;
+}
+
#zeitgeist h3 {
border-bottom: 1px solid #ccc;
font-size: 16px;