From 3f5685912e89eb3b0534acd85aa0946b1ca2bbe3 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 22 Dec 2009 11:32:31 -0500 Subject: [PATCH] Wordpress 2.9 Signed-off-by: Edward Z. Yang --- readme.html | 6 +- wp-admin/admin-ajax.php | 264 +- wp-admin/admin-header.php | 2 +- wp-admin/admin.php | 6 +- wp-admin/async-upload.php | 2 + wp-admin/categories.php | 31 +- wp-admin/comment.php | 205 +- wp-admin/css/colors-classic.css | 1672 +------- wp-admin/css/colors-classic.dev.css | 1708 ++++++++ wp-admin/css/colors-fresh.css | 1661 +------- wp-admin/css/colors-fresh.dev.css | 1697 ++++++++ wp-admin/css/dashboard.css | 391 +- wp-admin/css/dashboard.dev.css | 394 ++ wp-admin/css/global-rtl.css | 3 +- wp-admin/css/global.css | 488 +-- wp-admin/css/global.dev.css | 485 +++ wp-admin/css/ie-rtl.css | 4 + wp-admin/css/ie.css | 43 + wp-admin/css/install.css | 134 +- wp-admin/css/install.dev.css | 133 + wp-admin/css/login.css | 112 +- wp-admin/css/login.dev.css | 129 + wp-admin/css/media-rtl.css | 10 +- wp-admin/css/media.css | 401 +- wp-admin/css/media.dev.css | 384 ++ wp-admin/css/plugin-install.css | 149 +- wp-admin/css/plugin-install.dev.css | 148 + wp-admin/css/press-this.css | 560 +-- wp-admin/css/press-this.dev.css | 586 +++ wp-admin/css/theme-editor.css | 61 +- wp-admin/css/theme-editor.dev.css | 60 + wp-admin/css/theme-install.css | 143 +- wp-admin/css/theme-install.dev.css | 142 + wp-admin/css/widgets.css | 366 +- wp-admin/css/widgets.dev.css | 370 ++ wp-admin/edit-attachment-rows.php | 38 +- wp-admin/edit-category-form.php | 5 +- wp-admin/edit-comments.php | 189 +- wp-admin/edit-form-advanced.php | 518 +-- wp-admin/edit-form-comment.php | 2 +- wp-admin/edit-link-categories.php | 10 +- wp-admin/edit-link-category-form.php | 3 +- wp-admin/edit-link-form.php | 309 +- wp-admin/edit-page-form.php | 396 +- wp-admin/edit-pages.php | 178 +- wp-admin/edit-tag-form.php | 3 +- wp-admin/edit-tags.php | 37 +- wp-admin/edit.php | 194 +- wp-admin/images/imgedit-icons.png | Bin 0 -> 9607 bytes wp-admin/import/blogger.php | 29 +- wp-admin/import/blogware.php | 8 +- wp-admin/import/dotclear.php | 35 +- wp-admin/import/greymatter.php | 2 +- wp-admin/import/livejournal.php | 11 +- wp-admin/import/mt.php | 10 +- wp-admin/import/rss.php | 6 +- wp-admin/import/textpattern.php | 45 +- wp-admin/import/wordpress.php | 108 +- wp-admin/includes/class-ftp.php | 5 +- wp-admin/includes/class-pclzip.php | 1084 ++--- .../includes/class-wp-filesystem-base.php | 4 +- .../includes/class-wp-filesystem-direct.php | 124 +- .../includes/class-wp-filesystem-ftpext.php | 114 +- .../class-wp-filesystem-ftpsockets.php | 104 +- .../includes/class-wp-filesystem-ssh2.php | 56 +- wp-admin/includes/class-wp-upgrader.php | 173 +- wp-admin/includes/dashboard.php | 98 +- wp-admin/includes/export.php | 53 +- wp-admin/includes/file.php | 199 +- wp-admin/includes/image-edit.php | 663 +++ wp-admin/includes/image.php | 53 +- wp-admin/includes/import.php | 5 + wp-admin/includes/media.php | 367 +- wp-admin/includes/meta-boxes.php | 826 ++++ wp-admin/includes/misc.php | 3 +- wp-admin/includes/plugin.php | 135 +- wp-admin/includes/post.php | 222 +- wp-admin/includes/schema.php | 42 +- wp-admin/includes/template.php | 304 +- wp-admin/includes/theme.php | 34 +- wp-admin/includes/update-core.php | 27 +- wp-admin/includes/update.php | 44 +- wp-admin/includes/upgrade.php | 51 +- wp-admin/includes/user.php | 111 +- wp-admin/includes/widgets.php | 24 +- wp-admin/install.php | 4 +- wp-admin/js/categories.dev.js | 16 +- wp-admin/js/categories.js | 2 +- wp-admin/js/comment.dev.js | 20 +- wp-admin/js/comment.js | 2 +- wp-admin/js/common.dev.js | 155 +- wp-admin/js/common.js | 2 +- wp-admin/js/edit-comments.dev.js | 324 +- wp-admin/js/edit-comments.js | 2 +- wp-admin/js/editor.dev.js | 137 +- wp-admin/js/editor.js | 2 +- wp-admin/js/gallery.dev.js | 3 +- wp-admin/js/gallery.js | 2 +- wp-admin/js/image-edit.dev.js | 569 +++ wp-admin/js/image-edit.js | 1 + wp-admin/js/inline-edit-post.dev.js | 40 +- wp-admin/js/inline-edit-post.js | 2 +- wp-admin/js/inline-edit-tax.dev.js | 22 +- wp-admin/js/inline-edit-tax.js | 2 +- wp-admin/js/media-upload.dev.js | 5 +- wp-admin/js/media-upload.js | 2 +- wp-admin/js/media.dev.js | 2 +- wp-admin/js/media.js | 2 +- wp-admin/js/page.dev.js | 185 - wp-admin/js/page.js | 1 - wp-admin/js/post.dev.js | 906 ++-- wp-admin/js/post.js | 2 +- wp-admin/js/postbox.dev.js | 4 +- wp-admin/js/postbox.js | 2 +- wp-admin/js/set-post-thumbnail.dev.js | 21 + wp-admin/js/set-post-thumbnail.js | 1 + wp-admin/js/slug.dev.js | 44 - wp-admin/js/slug.js | 1 - wp-admin/js/tags.dev.js | 76 +- wp-admin/js/tags.js | 2 +- wp-admin/js/widgets.dev.js | 227 +- wp-admin/js/widgets.js | 2 +- wp-admin/js/wp-gears.dev.js | 8 +- wp-admin/js/wp-gears.js | 2 +- wp-admin/link-manager.php | 7 +- wp-admin/load-scripts.php | 2 +- wp-admin/load-styles.php | 2 +- wp-admin/maint/repair.php | 90 + wp-admin/media-upload.php | 3 + wp-admin/media.php | 5 + wp-admin/menu-header.php | 2 +- wp-admin/menu.php | 2 +- wp-admin/options-discussion.php | 4 +- wp-admin/options-media.php | 29 +- wp-admin/options-misc.php | 3 +- wp-admin/options-permalink.php | 13 +- wp-admin/options-privacy.php | 2 +- wp-admin/options-reading.php | 2 +- wp-admin/options.php | 4 +- wp-admin/page-new.php | 2 +- wp-admin/page.php | 102 +- wp-admin/plugin-editor.php | 31 +- wp-admin/plugin-install.php | 8 +- wp-admin/plugins.php | 23 +- wp-admin/post.php | 109 +- wp-admin/press-this.php | 361 +- wp-admin/rtl.css | 556 +-- wp-admin/rtl.dev.css | 560 +++ wp-admin/setup-config.php | 57 +- wp-admin/theme-editor.php | 76 +- wp-admin/theme-install.php | 8 +- wp-admin/themes.php | 18 +- wp-admin/tools.php | 2 +- wp-admin/update-core.php | 168 +- wp-admin/update-links.php | 2 +- wp-admin/update.php | 7 +- wp-admin/upgrade.php | 2 +- wp-admin/upload.php | 204 +- wp-admin/user-edit.php | 35 +- wp-admin/users.php | 10 +- wp-admin/widgets.php | 28 +- wp-admin/wp-admin.css | 3302 +-------------- wp-admin/wp-admin.dev.css | 3627 +++++++++++++++++ wp-app.php | 47 +- wp-comments-post.php | 5 +- wp-config-sample.php | 2 +- wp-content/plugins/akismet/akismet.php | 14 +- wp-content/plugins/akismet/readme.txt | 6 +- wp-content/themes/classic/comments.php | 2 +- wp-content/themes/default/comments.php | 2 +- wp-content/themes/default/functions.php | 8 + wp-content/themes/default/page.php | 3 + wp-content/themes/default/rtl.css | 2 +- wp-content/themes/default/sidebar.php | 16 +- wp-cron.php | 2 +- wp-includes/author-template.php | 9 +- wp-includes/bookmark.php | 2 +- wp-includes/canonical.php | 10 +- wp-includes/capabilities.php | 91 +- wp-includes/category-template.php | 104 +- wp-includes/class-IXR.php | 37 +- wp-includes/class-feed.php | 2 +- wp-includes/class-json.php | 860 ++++ wp-includes/class-oembed.php | 270 ++ wp-includes/class-simplepie.php | 2652 +++++++++--- wp-includes/class.wp-dependencies.php | 10 +- wp-includes/classes.php | 48 +- wp-includes/comment-template.php | 18 +- wp-includes/comment.php | 293 +- wp-includes/compat.php | 58 +- wp-includes/cron.php | 4 +- wp-includes/default-embeds.php | 52 + wp-includes/default-filters.php | 325 +- wp-includes/default-widgets.php | 34 +- wp-includes/deprecated.php | 120 + wp-includes/feed-atom.php | 2 +- wp-includes/feed-rdf.php | 4 +- wp-includes/feed-rss.php | 4 - wp-includes/feed-rss2.php | 4 +- wp-includes/feed.php | 90 +- wp-includes/formatting.php | 284 +- wp-includes/functions.php | 474 ++- wp-includes/general-template.php | 8 +- wp-includes/gettext.php | 400 -- wp-includes/http.php | 141 +- wp-includes/js/autosave.dev.js | 104 +- wp-includes/js/autosave.js | 2 +- .../js/imgareaselect/border-anim-h.gif | Bin 0 -> 219 bytes .../js/imgareaselect/border-anim-v.gif | Bin 0 -> 219 bytes .../js/imgareaselect/imgareaselect.css | 41 + .../imgareaselect/jquery.imgareaselect.dev.js | 691 ++++ .../js/imgareaselect/jquery.imgareaselect.js | 1 + wp-includes/js/json2.dev.js | 481 +++ wp-includes/js/json2.js | 11 + wp-includes/js/swfupload/handlers.dev.js | 187 +- wp-includes/js/swfupload/handlers.js | 2 +- .../js/swfupload/plugins/swfupload.speed.js | 682 ++-- wp-includes/js/thickbox/thickbox.js | 112 +- .../tinymce/plugins/fullscreen/fullscreen.htm | 2 +- .../plugins/inlinepopups/editor_plugin.js | 2 +- .../tinymce/plugins/inlinepopups/template.htm | 2 +- .../js/tinymce/plugins/media/editor_plugin.js | 2 +- .../js/tinymce/plugins/media/media.htm | 14 +- .../js/tinymce/plugins/paste/editor_plugin.js | 2 +- .../js/tinymce/plugins/paste/js/pastetext.js | 2 +- .../js/tinymce/plugins/paste/js/pasteword.js | 4 +- .../js/tinymce/plugins/paste/pastetext.htm | 6 +- .../js/tinymce/plugins/paste/pasteword.htm | 4 +- .../tinymce/plugins/wordpress/css/content.css | 16 +- .../plugins/wordpress/editor_plugin.dev.js | 114 +- .../plugins/wordpress/editor_plugin.js | 2 +- .../plugins/wordpress/img/embedded.png | Bin 0 -> 28741 bytes .../plugins/wordpress/js/.preserve-dir | 0 .../plugins/wpeditimage/editor_plugin.dev.js | 114 +- .../plugins/wpeditimage/editor_plugin.js | 2 +- .../plugins/wpgallery/editor_plugin.dev.js | 81 +- .../plugins/wpgallery/editor_plugin.js | 2 +- .../js/tinymce/themes/advanced/about.htm | 6 +- .../js/tinymce/themes/advanced/anchor.htm | 4 +- .../js/tinymce/themes/advanced/charmap.htm | 4 +- .../tinymce/themes/advanced/color_picker.htm | 8 +- .../js/tinymce/themes/advanced/image.htm | 8 +- .../js/tinymce/themes/advanced/js/link.js | 8 +- .../js/tinymce/themes/advanced/link.htm | 10 +- .../advanced/skins/wp_theme/content.css | 7 - .../tinymce/themes/advanced/source_editor.htm | 4 +- wp-includes/js/tinymce/tiny_mce.js | 2 +- wp-includes/js/tinymce/tiny_mce_popup.js | 2 +- wp-includes/js/tinymce/utils/form_utils.js | 4 +- wp-includes/js/tinymce/wp-tinymce.js | 14 +- wp-includes/js/tinymce/wp-tinymce.js.gz | Bin 79103 -> 80093 bytes wp-includes/js/tinymce/wp-tinymce.php | 10 +- wp-includes/js/wp-ajax-response.dev.js | 2 +- wp-includes/js/wp-ajax-response.js | 2 +- wp-includes/js/wp-lists.dev.js | 26 +- wp-includes/js/wp-lists.js | 2 +- wp-includes/kses.php | 80 +- wp-includes/l10n.php | 92 +- wp-includes/link-template.php | 113 +- wp-includes/media.php | 583 ++- wp-includes/meta.php | 223 + wp-includes/pluggable.php | 59 +- wp-includes/plugin.php | 38 +- wp-includes/pomo/entry.php | 6 +- wp-includes/pomo/mo.php | 124 +- wp-includes/pomo/po.php | 9 +- wp-includes/pomo/streams.php | 232 +- wp-includes/pomo/translations.php | 98 +- wp-includes/post-template.php | 38 +- wp-includes/post-thumbnail-template.php | 76 + wp-includes/post.php | 654 ++- wp-includes/query.php | 155 +- wp-includes/registration.php | 46 +- wp-includes/rewrite.php | 52 +- wp-includes/script-loader.php | 171 +- wp-includes/shortcodes.php | 3 +- wp-includes/streams.php | 191 - wp-includes/taxonomy.php | 43 +- wp-includes/theme.php | 520 ++- wp-includes/update.php | 56 +- wp-includes/user.php | 146 +- wp-includes/vars.php | 34 +- wp-includes/version.php | 20 +- wp-includes/widgets.php | 41 +- wp-includes/wp-db.php | 74 +- wp-login.php | 78 +- wp-mail.php | 15 + wp-settings.php | 66 +- wp-trackback.php | 14 +- xmlrpc.php | 36 +- 290 files changed, 27348 insertions(+), 18446 deletions(-) create mode 100644 wp-admin/css/colors-classic.dev.css create mode 100644 wp-admin/css/colors-fresh.dev.css create mode 100644 wp-admin/css/dashboard.dev.css create mode 100644 wp-admin/css/global.dev.css create mode 100644 wp-admin/css/install.dev.css create mode 100644 wp-admin/css/login.dev.css create mode 100644 wp-admin/css/media.dev.css create mode 100644 wp-admin/css/plugin-install.dev.css create mode 100644 wp-admin/css/press-this.dev.css create mode 100644 wp-admin/css/theme-editor.dev.css create mode 100644 wp-admin/css/theme-install.dev.css create mode 100644 wp-admin/css/widgets.dev.css create mode 100644 wp-admin/images/imgedit-icons.png create mode 100644 wp-admin/includes/image-edit.php create mode 100644 wp-admin/includes/meta-boxes.php create mode 100644 wp-admin/js/image-edit.dev.js create mode 100644 wp-admin/js/image-edit.js delete mode 100644 wp-admin/js/page.dev.js delete mode 100644 wp-admin/js/page.js create mode 100644 wp-admin/js/set-post-thumbnail.dev.js create mode 100644 wp-admin/js/set-post-thumbnail.js delete mode 100644 wp-admin/js/slug.dev.js delete mode 100644 wp-admin/js/slug.js create mode 100644 wp-admin/maint/repair.php create mode 100644 wp-admin/rtl.dev.css create mode 100644 wp-admin/wp-admin.dev.css create mode 100644 wp-includes/class-json.php create mode 100644 wp-includes/class-oembed.php create mode 100644 wp-includes/default-embeds.php delete mode 100644 wp-includes/gettext.php create mode 100644 wp-includes/js/imgareaselect/border-anim-h.gif create mode 100644 wp-includes/js/imgareaselect/border-anim-v.gif create mode 100644 wp-includes/js/imgareaselect/imgareaselect.css create mode 100644 wp-includes/js/imgareaselect/jquery.imgareaselect.dev.js create mode 100644 wp-includes/js/imgareaselect/jquery.imgareaselect.js create mode 100644 wp-includes/js/json2.dev.js create mode 100644 wp-includes/js/json2.js create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/embedded.png delete mode 100644 wp-includes/js/tinymce/plugins/wordpress/js/.preserve-dir create mode 100644 wp-includes/meta.php create mode 100644 wp-includes/post-thumbnail-template.php delete mode 100644 wp-includes/streams.php diff --git a/readme.html b/readme.html index fa7071c6..dc3c3b05 100644 --- a/readme.html +++ b/readme.html @@ -8,7 +8,7 @@

WordPress -
Version 2.8.5 +
Version 2.9

Semantic Personal Publishing Platform

@@ -29,7 +29,7 @@

Upgrading

Before you upgrade anything, make sure you have backup copies of any files you may have modified such as index.php.

-

Upgrading from any previous WordPress to 2.8.5:

+

Upgrading from any previous WordPress to 2.9:

  1. Delete your old WP files, saving ones you've modified.
  2. Upload the new files.
  3. @@ -57,7 +57,7 @@

    System Recommendations

    • PHP version 4.3 or higher.
    • -
    • MySQL version 4.0 or higher.
    • +
    • MySQL version 4.1.2 or higher.
    • ... and a link to http://wordpress.org on your site.

    WordPress is the official continuation of b2/cafélog, which came from Michel V. The work has been continued by the WordPress developers. If you would like to support WordPress, please consider donating.

    diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 7f04dd7d..5778a12e 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -37,8 +37,8 @@ if ( ! is_user_logged_in() ) { $x->send(); } - if ( !empty( $_POST['action']) ) - do_action( 'wp_ajax_nopriv_' . $_POST['action'] ); + if ( !empty( $_REQUEST['action']) ) + do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); die('-1'); } @@ -91,6 +91,8 @@ case 'wp-compression-test' : echo $test_str; die; } elseif ( 2 == $_GET['test'] ) { + if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) + die('-1'); if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { header('Content-Encoding: deflate'); $out = gzdeflate( $test_str, 1 ); @@ -111,6 +113,23 @@ case 'wp-compression-test' : die('0'); break; +case 'imgedit-preview' : + $post_id = intval($_GET['postid']); + if ( empty($post_id) || !current_user_can('edit_post', $post_id) ) + die('-1'); + + check_ajax_referer( "image_editor-$post_id" ); + + include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); + if ( !stream_preview_image($post_id) ) + die('-1'); + + die(); + break; +case 'oembed-cache' : + $return = ( $wp_embed->cache_oembed( $_GET['post'] ) ) ? '1' : '0'; + die( $return ); + break; default : do_action( 'wp_ajax_' . $_GET['action'] ); die('0'); @@ -143,15 +162,18 @@ function _wp_ajax_delete_comment_response( $comment_id ) { if ( 0 != $total % $per_page && 1 != mt_rand( 1, $per_page ) ) // Only do the expensive stuff on a page-break, and about 1 other time per page die( (string) time() ); + $post_id = 0; $status = 'total_comments'; // What type of comment count are we looking for? $parsed = parse_url( $url ); if ( isset( $parsed['query'] ) ) { parse_str( $parsed['query'], $query_vars ); if ( !empty( $query_vars['comment_status'] ) ) $status = $query_vars['comment_status']; + if ( !empty( $query_vars['p'] ) ) + $post_id = (int) $query_vars['p']; } - $comment_count = wp_count_comments(); + $comment_count = wp_count_comments($post_id); $time = time(); // The time since the last comment count if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count @@ -181,19 +203,36 @@ function _wp_ajax_delete_comment_response( $comment_id ) { $id = isset($_POST['id'])? (int) $_POST['id'] : 0; switch ( $action = $_POST['action'] ) : case 'delete-comment' : // On success, die with time() instead of 1 - check_ajax_referer( "delete-comment_$id" ); if ( !$comment = get_comment( $id ) ) die( (string) time() ); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); - if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) { - if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) ) + check_ajax_referer( "delete-comment_$id" ); + $status = wp_get_comment_status( $comment->comment_ID ); + + if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) { + if ( 'trash' == $status ) die( (string) time() ); - $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); - } else { + $r = wp_trash_comment( $comment->comment_ID ); + } elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) { + if ( 'trash' != $status ) + die( (string) time() ); + $r = wp_untrash_comment( $comment->comment_ID ); + } elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) { + if ( 'spam' == $status ) + die( (string) time() ); + $r = wp_spam_comment( $comment->comment_ID ); + } elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) { + if ( 'spam' != $status ) + die( (string) time() ); + $r = wp_unspam_comment( $comment->comment_ID ); + } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) { $r = wp_delete_comment( $comment->comment_ID ); + } else { + die('-1'); } + if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts _wp_ajax_delete_comment_response( $comment->comment_ID ); die( '0' ); @@ -213,20 +252,18 @@ case 'delete-cat' : die('0'); break; case 'delete-tag' : - check_ajax_referer( "delete-tag_$id" ); + $tag_id = (int) $_POST['tag_ID']; + check_ajax_referer( "delete-tag_$tag_id" ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); - if ( !empty($_POST['taxonomy']) ) - $taxonomy = $_POST['taxonomy']; - else - $taxonomy = 'post_tag'; + $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; - $tag = get_term( $id, $taxonomy ); + $tag = get_term( $tag_id, $taxonomy ); if ( !$tag || is_wp_error( $tag ) ) die('1'); - if ( wp_delete_term($id, $taxonomy)) + if ( wp_delete_term($tag_id, $taxonomy)) die('1'); else die('0'); @@ -305,6 +342,25 @@ case 'delete-post' : else die('0'); break; +case 'trash-post' : +case 'untrash-post' : + check_ajax_referer( "{$action}_$id" ); + if ( !current_user_can( 'delete_post', $id ) ) + die('-1'); + + if ( !get_post( $id ) ) + die('1'); + + if ( 'trash-post' == $action ) + $done = wp_trash_post( $id ); + else + $done = wp_untrash_post( $id ); + + if ( $done ) + die('1'); + + die('0'); + break; case 'delete-page' : check_ajax_referer( "{$action}_$id" ); if ( !current_user_can( 'delete_page', $id ) ) @@ -328,23 +384,19 @@ case 'dim-comment' : // On success, die with time() instead of 1 $x->send(); } - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - die('-1'); - if ( !current_user_can( 'moderate_comments' ) ) + if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) ) die('-1'); $current = wp_get_comment_status( $comment->comment_ID ); if ( $_POST['new'] == $current ) die( (string) time() ); - $r = 0; - if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) { - check_ajax_referer( "approve-comment_$id" ); + check_ajax_referer( "approve-comment_$id" ); + if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) $result = wp_set_comment_status( $comment->comment_ID, 'approve', true ); - } else { - check_ajax_referer( "unapprove-comment_$id" ); + else $result = wp_set_comment_status( $comment->comment_ID, 'hold', true ); - } + if ( is_wp_error($result) ) { $x = new WP_Ajax_Response( array( 'what' => 'comment', @@ -366,11 +418,8 @@ case 'add-category' : // On the Fly $parent = 0; $post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array(); $checked_categories = array_map( 'absint', (array) $post_category ); - $popular_ids = isset( $_POST['popular_ids'] ) ? - array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) : - false; + $popular_ids = wp_popular_terms_checklist('category', 0, 10, false); - $x = new WP_Ajax_Response(); foreach ( $names as $cat_name ) { $cat_name = trim($cat_name); $category_nicename = sanitize_title($cat_name); @@ -385,28 +434,43 @@ case 'add-category' : // On the Fly wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids ); $data = ob_get_contents(); ob_end_clean(); - $x->add( array( + $add = array( 'what' => 'category', 'id' => $cat_id, - 'data' => $data, + 'data' => str_replace( array("\n", "\t"), '', $data), 'position' => -1 - ) ); + ); } if ( $parent ) { // Foncy - replace the parent and all its children $parent = get_category( $parent ); + $term_id = $parent->term_id; + + while ( $parent->parent ) { // get the top parent + $parent = &get_category( $parent->parent ); + if ( is_wp_error( $parent ) ) + break; + $term_id = $parent->term_id; + } + ob_start(); - dropdown_categories( 0, $parent ); + wp_category_checklist( 0, $term_id, $checked_categories, $popular_ids, null, false ); $data = ob_get_contents(); ob_end_clean(); - $x->add( array( + $add = array( 'what' => 'category', - 'id' => $parent->term_id, - 'old_id' => $parent->term_id, - 'data' => $data, + 'id' => $term_id, + 'data' => str_replace( array("\n", "\t"), '', $data), 'position' => -1 - ) ); - + ); } + + ob_start(); + wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); + $sup = ob_get_contents(); + ob_end_clean(); + $add['supplemental'] = array( 'newcat_parent' => $sup ); + + $x = new WP_Ajax_Response( $add ); $x->send(); break; case 'add-link-category' : // On the Fly @@ -527,43 +591,16 @@ case 'add-tag' : // From Manage->Tags if ( !current_user_can( 'manage_categories' ) ) die('-1'); - if ( '' === trim($_POST['name']) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'tag', - 'id' => new WP_Error( 'name', __('You did not enter a tag name.') ) - ) ); - $x->send(); - } - - if ( !empty($_POST['taxonomy']) ) - $taxonomy = $_POST['taxonomy']; - else - $taxonomy = 'post_tag'; - - $tag = wp_insert_term($_POST['name'], $taxonomy, $_POST ); + $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; + $tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST ); - if ( is_wp_error($tag) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'tag', - 'id' => $tag - ) ); - $x->send(); + if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) { + echo '

    ' . __('An error has occured. Please reload the page and try again.') . '

    '; + exit; } - if ( !$tag || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) - die('0'); - - $tag_full_name = $tag->name; - $tag_full_name = esc_attr($tag_full_name); - - $x = new WP_Ajax_Response( array( - 'what' => 'tag', - 'id' => $tag->term_id, - 'position' => '-1', - 'data' => _tag_row( $tag, '', $taxonomy ), - 'supplemental' => array('name' => $tag_full_name, 'show-link' => sprintf(__( 'Tag %s added' ), "tag-$tag->term_id", $tag_full_name)) - ) ); - $x->send(); + echo _tag_row( $tag, '', $taxonomy ); + exit; break; case 'get-tagcloud' : if ( !current_user_can( 'edit_posts' ) ) @@ -599,7 +636,7 @@ case 'get-tagcloud' : break; case 'add-comment' : check_ajax_referer( $action ); - if ( !current_user_can( 'edit_post', $id ) ) + if ( !current_user_can( 'edit_posts' ) ) die('-1'); $search = isset($_POST['s']) ? $_POST['s'] : false; $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all'; @@ -674,7 +711,7 @@ case 'replyto-comment' : if ( empty($status) ) die('1'); - elseif ( in_array($status, array('draft', 'pending') ) ) + elseif ( in_array($status, array('draft', 'pending', 'trash') ) ) die( __('Error: you are replying to a comment on a draft post.') ); $user = wp_get_current_user(); @@ -885,6 +922,8 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() $message = sprintf( __('Draft Saved at %s.'), date_i18n( $draft_saved_date_format ) ); $supplemental = array(); + if ( isset($login_grace_period) ) + $supplemental['session_expired'] = add_query_arg( 'interim-login', 1, wp_login_url() ); $id = $revision_id = 0; if($_POST['post_ID'] < 0) { @@ -964,15 +1003,10 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() case 'autosave-generate-nonces' : check_ajax_referer( 'autosave', 'autosavenonce' ); $ID = (int) $_POST['post_ID']; - if($_POST['post_type'] == 'post') { - if(current_user_can('edit_post', $ID)) - die(wp_create_nonce('update-post_' . $ID)); - } - if($_POST['post_type'] == 'page') { - if(current_user_can('edit_page', $ID)) { - die(wp_create_nonce('update-page_' . $ID)); - } - } + $post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post'; + if ( current_user_can( "edit_{$post_type}", $ID ) ) + die( json_encode( array( 'updateNonce' => wp_create_nonce( "update-{$post_type}_{$ID}" ), 'deleteURL' => str_replace( '&', '&', wp_nonce_url( admin_url( $post_type . '.php?action=trash&post=' . $ID ), "trash-{$post_type}_{$ID}" ) ) ) ) ); + do_action('autosave_generate_nonces'); die('0'); break; case 'closed-postboxes' : @@ -993,7 +1027,7 @@ case 'closed-postboxes' : update_usermeta($user->ID, 'closedpostboxes_'.$page, $closed); if ( is_array($hidden) ) { - $hidden = array_diff( $hidden, array('submitdiv', 'pagesubmitdiv', 'linksubmitdiv') ); // postboxes that are always shown + $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv') ); // postboxes that are always shown update_usermeta($user->ID, 'meta-box-hidden_'.$page, $hidden); } @@ -1148,10 +1182,7 @@ case 'inline-save-tax': break; case 'tag' : - if ( !empty($_POST['taxonomy']) ) - $taxonomy = $_POST['taxonomy']; - else - $taxonomy = 'post_tag'; + $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; $tag = get_term( $id, $taxonomy ); $_POST['description'] = $tag->description; @@ -1162,7 +1193,7 @@ case 'inline-save-tax': if ( !$tag || is_wp_error( $tag ) ) die( __('Tag not updated.') ); - echo _tag_row($tag); + echo _tag_row($tag, '', $taxonomy); } else { die( __('Tag not updated.') ); } @@ -1181,10 +1212,10 @@ case 'find_posts': $what = isset($_POST['pages']) ? 'page' : 'post'; $s = stripslashes($_POST['ps']); preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); - $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]); + $search_terms = array_map('_search_terms_tidy', $matches[0]); $searchand = $search = ''; - foreach( (array) $search_terms as $term) { + foreach ( (array) $search_terms as $term ) { $term = addslashes_gpc($term); $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))"; $searchand = ' AND '; @@ -1193,12 +1224,12 @@ case 'find_posts': if ( count($search_terms) > 1 && $search_terms[0] != $s ) $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')"; - $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND $search ORDER BY post_date_gmt DESC LIMIT 50" ); + $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" ); if ( ! $posts ) exit( __('No posts found.') ); - $html = ''; + $html = '

    '.__('Title').''.__('Time').''.__('Status').'
    '; foreach ( $posts as $post ) { switch ( $post->post_status ) { @@ -1213,7 +1244,7 @@ case 'find_posts': $stat = __('Pending Review'); break; case 'draft' : - $stat = __('Unpublished'); + $stat = __('Draft'); break; } @@ -1348,6 +1379,51 @@ case 'save-widget' : die(); break; +case 'image-editor': + $attachment_id = intval($_POST['postid']); + if ( empty($attachment_id) || !current_user_can('edit_post', $attachment_id) ) + die('-1'); + + check_ajax_referer( "image_editor-$attachment_id" ); + include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); + + $msg = false; + switch ( $_POST['do'] ) { + case 'save' : + $msg = wp_save_image($attachment_id); + $msg = json_encode($msg); + die($msg); + break; + case 'scale' : + $msg = wp_save_image($attachment_id); + break; + case 'restore' : + $msg = wp_restore_image($attachment_id); + break; + } + + wp_image_editor($attachment_id, $msg); + die(); + break; +case 'set-post-thumbnail': + $post_id = intval( $_POST['post_id'] ); + if ( !current_user_can( 'edit_post', $post_id ) ) + die( '-1' ); + $thumbnail_id = intval( $_POST['thumbnail_id'] ); + + if ( $thumbnail_id == '-1' ) { + delete_post_meta( $post_id, '_thumbnail_id' ); + die( _wp_post_thumbnail_html() ); + } + + if ( $thumbnail_id && get_post( $thumbnail_id ) ) { + $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); + if ( !empty( $thumbnail_html ) ) { + update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); + die( _wp_post_thumbnail_html( $thumbnail_id ) ); + } + } + die( '0' ); default : do_action( 'wp_ajax_' . $_POST['action'] ); die('0'); diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 27c496a7..81711f38 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -41,7 +41,7 @@ $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); //','uid':'ID; ?>','time':''}; -var ajaxurl = '', pagenow = '', adminpage = ''; +var ajaxurl = '', pagenow = '', adminpage = '', thousandsSeparator = 'number_format['thousands_sep']; ?>', decimalPoint = 'number_format['decimal_point']; ?>'; //]]> %s category: this is the default one"), $cat_name)); + wp_die( sprintf( __("Can’t delete the %s category: this is the default one"), get_cat_name($cat_ID) ) ); wp_delete_category($cat_ID); @@ -59,18 +62,20 @@ case 'bulk-delete': if ( !current_user_can('manage_categories') ) wp_die( __('You are not allowed to delete categories.') ); - foreach ( (array) $_GET['delete'] as $cat_ID ) { - $cat_name = get_cat_name($cat_ID); + $cats = (array) $_GET['delete']; + $default_cat = get_option('default_category'); + foreach ( $cats as $cat_ID ) { + $cat_ID = (int) $cat_ID; - // Don't delete the default cats. - if ( $cat_ID == get_option('default_category') ) - wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); + // Don't delete the default cat. + if ( $cat_ID == $default_cat ) + wp_die( sprintf( __("Can’t delete the %s category: this is the default one"), get_cat_name($cat_ID) ) ); wp_delete_category($cat_ID); } wp_safe_redirect( wp_get_referer() ); - exit(); + exit; break; case 'edit': @@ -161,10 +166,10 @@ $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0; if ( empty($pagenum) ) $pagenum = 1; -$cats_per_page = get_user_option('categories_per_page'); -if ( empty($cats_per_page) ) +$cats_per_page = (int) get_user_option( 'categories_per_page', 0, false ); +if ( empty( $cats_per_page ) || $cats_per_page < 1 ) $cats_per_page = 20; -$cats_per_page = apply_filters('edit_categories_per_page', $cats_per_page); +$cats_per_page = apply_filters( 'edit_categories_per_page', $cats_per_page ); if ( !empty($_GET['s']) ) $num_cats = count(get_categories(array('hide_empty' => 0, 'search' => $_GET['s']))); @@ -280,7 +285,7 @@ if ( $page_links )
    -

    +

    diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 6499c08d..8b63a57a 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -17,6 +17,18 @@ wp_reset_vars( array('action') ); if ( isset( $_POST['deletecomment'] ) ) $action = 'deletecomment'; +if ( 'cdc' == $action ) + $action = 'delete'; +elseif ( 'mac' == $action ) + $action = 'approve'; + +if ( isset( $_GET['dt'] ) ) { + if ( 'spam' == $_GET['dt'] ) + $action = 'spam'; + elseif ( 'trash' == $_GET['dt'] ) + $action = 'trash'; +} + /** * Display error message at bottom of comments. * @@ -44,68 +56,60 @@ case 'editcomment' : if ( !current_user_can('edit_post', $comment->comment_post_ID) ) comment_footer_die( __('You are not allowed to edit comments on this post.') ); + if ( 'trash' == $comment->comment_approved ) + comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') ); + $comment = get_comment_to_edit( $comment_id ); include('edit-form-comment.php'); break; -case 'cdc' : -case 'mac' : +case 'delete' : +case 'approve' : +case 'trash' : +case 'spam' : require_once('admin-header.php'); $comment_id = absint( $_GET['c'] ); - $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; - $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; + $formaction = $action . 'comment'; + $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_'; $nonce_action .= $comment_id; if ( !$comment = get_comment_to_edit( $comment_id ) ) comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - comment_footer_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); + comment_footer_die( 'approve' != $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); ?>

    -

    - -
    - -

    '.__('Title').''.__('Date').''.__('Status').'
    - - - - -
    ' onclick="self.location='" />
    - - - - - - - - - - - - +
    @@ -128,87 +132,112 @@ if ( 'spam' == $_GET['dt'] ) {
    comment_author; ?>
    +

    + +
    + + + + + + +
    + + + + + + +
    + '.__('Go back').'!', 'edit-comments.php') ); - - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) + if ( !current_user_can('edit_post', $comment->comment_post_ID ) ) comment_footer_die( __('You are not allowed to edit comments on this post.') ); - if ( 'spam' == $_REQUEST['dt'] ) - wp_set_comment_status( $comment->comment_ID, 'spam' ); - else - wp_delete_comment( $comment->comment_ID ); - - if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) ) - wp_redirect( wp_get_referer() ); - else if ( '' != wp_get_original_referer() && false == $noredir ) - wp_redirect( wp_get_original_referer() ); + if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php') ) + $redir = wp_get_referer(); + elseif ( '' != wp_get_original_referer() && false == $noredir ) + $redir = wp_get_original_referer(); else - wp_redirect( admin_url('edit-comments.php') ); + $redir = admin_url('edit-comments.php'); + + $redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $redir ); + + switch ( $action ) { + case 'deletecomment' : + wp_delete_comment( $comment_id ); + $redir = add_query_arg( array('deleted' => '1'), $redir ); + break; + case 'trashcomment' : + wp_trash_comment($comment_id); + $redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir ); + break; + case 'untrashcomment' : + wp_untrash_comment($comment_id); + $redir = add_query_arg( array('untrashed' => '1'), $redir ); + break; + case 'spamcomment' : + wp_spam_comment($comment_id); + $redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir ); + break; + case 'unspamcomment' : + wp_unspam_comment($comment_id); + $redir = add_query_arg( array('unspammed' => '1'), $redir ); + break; + } + + wp_redirect( $redir ); die; break; +case 'approvecomment' : case 'unapprovecomment' : $comment_id = absint( $_GET['c'] ); - check_admin_referer( 'unapprove-comment_' . $comment_id ); + check_admin_referer( 'approve-comment_' . $comment_id ); - if ( isset( $_GET['noredir'] ) ) - $noredir = true; - else - $noredir = false; + $noredir = isset( $_GET['noredir'] ); if ( !$comment = get_comment( $comment_id ) ) comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); - - wp_set_comment_status( $comment->comment_ID, 'hold' ); + if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) { + if ( 'approvecomment' == $action ) + comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); + else + comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); + } if ( '' != wp_get_referer() && false == $noredir ) - wp_redirect( wp_get_referer() ); + $redir = remove_query_arg( array('approved', 'unapproved'), wp_get_referer() ); else - wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); + $redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) ); - exit(); - break; - -case 'approvecomment' : - $comment_id = absint( $_GET['c'] ); - check_admin_referer( 'approve-comment_' . $comment_id ); - - if ( isset( $_GET['noredir'] ) ) - $noredir = true; - else - $noredir = false; - - if ( !$comment = get_comment( $comment_id ) ) - comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); - - if ( !current_user_can('edit_post', $comment->comment_post_ID) ) - comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); + if ( 'approvecomment' == $action ) { + wp_set_comment_status( $comment_id, 'approve' ); + $redir = add_query_arg( array( 'approved' => 1 ), $redir ); + } else { + wp_set_comment_status( $comment_id, 'hold' ); + $redir = add_query_arg( array( 'unapproved' => 1 ), $redir ); + } - wp_set_comment_status( $comment->comment_ID, 'approve' ); - - if ( '' != wp_get_referer() && false == $noredir ) - wp_redirect( wp_get_referer() ); - else - wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); + wp_redirect( $redir ); exit(); break; @@ -237,4 +266,4 @@ default: include('admin-footer.php'); -?> \ No newline at end of file +?> diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css index a6cb4f94..427f262b 100644 --- a/wp-admin/css/colors-classic.css +++ b/wp-admin/css/colors-classic.css @@ -1,1671 +1 @@ -html { - background-color: #f7f6f1; -} - -* html input, -* html .widget { - border-color: #8cbdd5; -} - -textarea, -input, -select { - border-color: #dfdfdf; -} - -kbd, -code { - background: #eaeaea; -} - -input[readonly] { - background-color: #eee; -} - -.find-box-search { - border-color: #dfdfdf; - background-color: #f1f1f1; -} - -.find-box { - background-color: #f1f1f1; -} - -.find-box-inside { - background-color: #fff; -} - -a.page-numbers:hover { - border-color: #999; -} - -body, -#wpbody, -.form-table .pre { - color: #333; -} - -body > #upload-menu { - border-bottom-color: #fff; -} - -#postcustomstuff table, -#your-profile fieldset, -#rightnow, -div.dashboard-widget, -#dashboard-widgets p.dashboard-widget-links, -#replyrow #ed_reply_toolbar input { - border-color: #ccc; -} - -#poststuff .inside label.spam { - color: red; -} - -#poststuff .inside label.waiting { - color: orange; -} - -#poststuff .inside label.approved { - color: green; -} - -#postcustomstuff table { - border-color: #dfdfdf; - background-color: #f9f9f9; -} - -#postcustomstuff thead th { - background-color: #f1f1f1; -} - -#postcustomstuff table input, -#postcustomstuff table textarea { - border-color: #dfdfdf; - background-color: #fff; -} - -.widefat { - border-color: #dfdfdf; - background-color: #fff; -} - -div.dashboard-widget-error { - background-color: #c43; -} - -div.dashboard-widget-notice { - background-color: #cfe1ef; -} - -div.dashboard-widget-submit { - border-top-color: #ccc; -} - -div.tabs-panel, -ul#category-tabs li.tabs { - border-color: #dfdfdf; -} - -ul#category-tabs li.tabs { - background-color: #f1f1f1; -} - -input.disabled, -textarea.disabled { - background-color: #ccc; -} -/* #upload-menu li a.upload-tab-link, */ -.login #backtoblog a:hover, -#plugin-information .action-button a, -#plugin-information .action-button a:hover, -#plugin-information .action-button a:visited { - color: #fff; -} - -.widget .widget-top, -.postbox h3, -.stuffbox h3 { - background: #d5e6f2 url("../images/blue-grad.png") repeat-x left top; - text-shadow: #fff 0 1px 0; -} - -.form-table th, -.form-wrap label { - color: #222; - text-shadow: #fff 0 1px 0; -} - -.description, -.form-wrap p { - color: #666; -} - -strong .post-com-count span { - background-color: #21759b; -} - -.sorthelper { - background-color: #ccf3fa; -} - -.ac_match, -.subsubsub a.current { - color: #000; -} - -.wrap h2 { - color: #093e56; -} - -.ac_over { - background-color: #f0f0b8; -} - -.ac_results { - background-color: #fff; - border-color: #808080; -} - -.ac_results li { - color: #101010; -} - -.alt -.alternate { - background-color: #edfbfc; -} - -.available-theme a.screenshot { - background-color: #f1f1f1; - border-color: #ddd; -} - -.bar { - background-color: #e8e8e8; - border-right-color: #99d; -} - -#media-upload { - background: #fff; -} - -#media-upload .slidetoggle { - border-top-color: #dfdfdf; -} - -.error, -#login #login_error { - background-color: #ffebe8; - border-color: #c00; -} - -.error a { - color: #c00; -} - -.form-invalid { - background-color: #ffebe8 !important; -} - -.form-invalid input { - border-color: #c00 !important; -} - -.submit { - border-color: #8cbdd5; -} - -.highlight { - background-color: #e4f2fd; - color: #d54e21; -} - -.howto, -.nonessential, -#edit-slug-box, -.form-input-tip, -.rss-widget span.rss-date, -.subsubsub { - color: #666; -} - -.media-item { - border-bottom-color: #dfdfdf; -} - -#wpbody-content #media-items .describe { - border-top-color: #dfdfdf; -} - -.describe input[type="text"], -.describe textarea { - border-color: #dfdfdf; -} - -.media-upload-form label.form-help, -td.help { - color: #9a9a9a; -} - -.post-com-count { - background-image: url(../images/bubble_bg.gif); - color: #fff; -} - -.post-com-count span { - background-color: #bbb; - color: #fff; -} - -.post-com-count:hover span { - background-color: #d54e21; -} - -.quicktags, .search { - background-color: #ccc; - color: #000; -} - -.side-info h5 { - border-bottom-color: #dadada; -} - -.side-info ul { - color: #666; -} - -.button, -.button-secondary, -.submit input, -input[type=button], -input[type=submit] { - border-color: #dfdfdf; - color: #464646; -} - -.button:hover, -.button-secondary:hover, -.submit input:hover, -input[type=button]:hover, -input[type=submit]:hover { - color: #000; - border-color: #adaca7; -} - -.button, -.submit input, -.button-secondary { - background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top; -} - -.button:active, -.submit input:active, -.button-secondary:active { - background: #eee url(../images/white-grad-active.png) repeat-x scroll left top; -} - -.button-primary, -.submit .button-primary, -#login form .submit input { - border-color: #5b86ab !important; - font-weight: bold; - color: #fff !important; - background: #5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top; -} - -.button-primary:active, -#login form .submit input:active { - background: #21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top !important; -} - -.button[disabled], -.button:disabled, -.button-secondary[disabled], -.button-secondary:disabled, -a.button.disabled { - color: #ccc !important; - border-color: #ccc; -} - -.button-primary[disabled], -.button-primary:disabled { - color: #80a3d2 !important; -} - -a:active, -a:focus { - color: #d54e21; -} - -a:hover, -#wphead #viewsite a:hover, -#adminmenu a:hover, -#adminmenu ul.wp-submenu a:hover, -#the-comment-list .comment a:hover, -#rightnow a:hover, -#login form .submit input:hover, -#media-upload a.del-link:hover, -div.dashboard-widget-submit input:hover, -.subsubsub a:hover, -.subsubsub a.current:hover, -.ui-tabs-nav a:hover, -.plugins .inactive a:hover, -#all-plugins-table .plugins .inactive a:hover, -#search-plugins-table .plugins .inactive a:hover { - color: #d54e21; -} - -#the-comment-list .comment-item, -#dashboard-widgets #dashboard_quick_press form p.submit { - border-color: #dfdfdf; -} - -#dashboard_right_now .table { - background:#faf9f7 !important; -} - -.button-primary:hover, -#login form .submit input:hover { - border-color: #2e5475 !important; - color: #eaf2fa !important; -} - -#side-sortables #category-tabs .tabs a { - color: #333; -} - -#rightnow .rbutton { - background-color: #ebebeb; - color: #264761; -} - -.submitbox .submit { - background-color: #464646; - color: #ccc; -} - -.plugins a.delete:hover, -#all-plugins-table .plugins a.delete:hover, -#search-plugins-table .plugins a.delete:hover, -.submitbox .submitdelete, -a.delete { - color: #f00; - border-bottom-color: #f00; -} - -.submitbox .submitdelete:hover, -#media-items a.delete:hover { - color: #fff; - background-color: #f00; - border-bottom-color: #f00; -} - -#normal-sortables .submitbox .submitdelete:hover { - color: #000; - background-color: #f00; - border-bottom-color: #f00; -} - -.tablenav .dots { - border-color: transparent; -} - -.tablenav .next, -.tablenav .prev { - border-color: transparent; - color: #21759b; -} - -.tablenav .next:hover, -.tablenav .prev:hover { - border-color: transparent; - color: #d54e21; -} - -.updated, -.login #login_error, -.login .message { - background-color: #ffffe0; - border-color: #e6db55; -} - -.update-message { - color: #000000; -} - -a.page-numbers { - border-bottom-color: #b8d3e2; -} - -.commentlist li { - border-bottom-color: #ccc; -} - -.widefat td, -.widefat th, -#install-plugins .plugins td, -#install-plugins .plugins th { - border-color: #dfdfdf; -} - -.widefat th { - text-shadow: rgba(255,255,255,0.8) 0 1px 0; -} - -.widefat thead tr th, -.widefat tfoot tr th, -h3.dashboard-widget-title, -h3.dashboard-widget-title span, -h3.dashboard-widget-title small, -.find-box-head { - color: #333; - background: #d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top; -} - -h3.dashboard-widget-title small a { - color: #d7d7d7; -} - -h3.dashboard-widget-title small a:hover { - color: #fff; -} - -a, -#adminmenu a, -#poststuff #edButtonPreview, -#poststuff #edButtonHTML, -#the-comment-list p.comment-author strong a, -#media-upload a.del-link, -#media-items a.delete, -.plugins a.delete, -.ui-tabs-nav a { - color: #1c6280; -} - -/* Because we don't want visited on these links */ -body.press-this .tabs a, -body.press-this .tabs a:hover { - background-color: #fff; - border-color: #c6d9e9; - border-bottom-color: #fff; - color: #d54e21; -} - -#adminmenu #awaiting-mod, -#adminmenu .update-plugins, -#sidemenu a .update-plugins, -#rightnow .reallynow, -#plugin-information .action-button { - background-color: #d54e21; - color: #fff; -} - -#adminmenu li a:hover #awaiting-mod, -#adminmenu li a:hover .update-plugins, -#sidemenu li a:hover .update-plugins { - background-color: #264761; - color: #fff; -} - -#adminmenu li.current a #awaiting-mod, -#adminmenu li.current a .update-plugins, -#adminmenu li.wp-has-current-submenu a .update-plugins, -#adminmenu li.wp-has-current-submenu a .update-plugins { - background-color: #ddd; - color: #000; - text-shadow: none; - -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - box-shadow: rgba(0,0,0,0.2) 0 -1px 0; -} - -#adminmenu li.current a:hover #awaiting-mod, -#adminmenu li.current a:hover .update-plugins, -#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod, -#adminmenu li.wp-has-current-submenu a:hover .update-plugins { - background-color: #264761; - color: #fff; -} - -div#media-upload-header, -div#plugin-information-header { - background-color: #f9f9f9; - border-bottom-color: #dfdfdf; -} - -#currenttheme img { - border-color: #666; -} - -#dashboard_secondary div.dashboard-widget-content ul li a { - background-color: #f9f9f9; -} - -input.readonly, textarea.readonly { - background-color: #ddd; -} - -#ed_toolbar input, -#ed_reply_toolbar input { - background: #fff url("../images/fade-butt.png") repeat-x 0 -2px; -} - -#editable-post-name { - background-color: #fffbcc; -} - -#edit-slug-box strong, -.tablenav .displaying-num, -#submitted-on { - color: #777; -} - -.login #nav a { - color: #21759b !important; -} - -.login #nav a:hover { - color: #d54e21 !important; -} - -#footer, -#footer-upgrade { - background: #1d507d; - color: #b6d1e4; -} - -#media-items { - border-color: #dfdfdf; -} - -.checkbox, -.side-info, -.plugins tr, -.postbox, -#your-profile #rich_editing { - background-color: #fff; -} - -.plugins .inactive, -.plugins .inactive th, -.plugins .inactive td, -tr.inactive + tr.plugin-update-tr .plugin-update { - background-color: #ebeeef; -} - -.plugin-update-tr .update-message { - background-color: #fffbe4; - border-color: #dfdfdf; -} - -.plugins .active, -.plugins .active th, -.plugins .active td { - color: #000; -} - -.plugins .inactive a { - color: #557799; -} - -#the-comment-list .unapproved, -#the-comment-list .unapproved th, -#the-comment-list .unapproved td { - background-color: #ffffe0; -} - -#the-comment-list .approve a { - color: #006505; -} - -#the-comment-list .unapprove a { - color: #d98500; -} - -#the-comment-list .delete a { - color: #bc0b0b; -} - -.widget, -#widget-list .widget-top, -.postbox, -#titlediv, -#poststuff .postarea, -.stuffbox { - border-color: #dfdfdf; -} - -.widget, -.postbox { - background-color: #fff; -} - -.ui-sortable .postbox h3 { - color: #093e56; -} - -.widget .widget-top, -.ui-sortable .postbox h3:hover { - color: #000; -} - -.curtime #timestamp { - background-image: url(../images/date-button.gif); -} - -#quicktags #ed_link { - color: #00f; -} - -#rightnow .youhave { - background-color: #f0f6fb; -} - -#rightnow a { - color: #448abd; -} - -.tagchecklist span a, -#bulk-titles div a { - background: url(../images/xit.gif) no-repeat; -} - -.tagchecklist span a:hover, -#bulk-titles div a:hover { - background: url(../images/xit.gif) no-repeat -10px 0; -} - -#update-nag { - background-color: #fffeeb; - border-color: #ccc; - color: #555; -} - -.login #backtoblog a { - color: #ccc; -} - -#wphead { - background-color: #1d507d; -} - -body.login { - border-top-color: #093e56; -} - -#wphead h1 a { - color: #fff; -} - -#login form input { - color: #555; -} - -#user_info { - color: #b6d1e4; -} - -#user_info a:link, -#user_info a:visited, -#footer a:link, -#footer a:visited { - color: #fff; - text-decoration: none; -} - -#user_info a:hover, -#user_info a:active, -#footer a:hover, -#footer a:active { - text-decoration: underline; -} - -div#media-upload-error, -.file-error, -abbr.required, -.widget-control-remove:hover, -.delete a:hover { - color: #f00; -} - -/* password strength meter */ -#pass-strength-result { - background-color: #eee; - border-color: #ddd !important; -} - -#pass-strength-result.bad { - background-color: #ffb78c; - border-color: #ff853c !important; -} - -#pass-strength-result.good { - background-color: #ffec8b; - border-color: #fc0 !important; -} - -#pass-strength-result.short { - background-color: #ffa0a0; - border-color: #f04040 !important; -} - -#pass-strength-result.strong { - background-color: #c3ff88; - border-color: #8dff1c !important; -} - -/* editors */ -#quicktags { - border-color: #dfdfdf; - background-color: #dfdfdf; -} - -#ed_toolbar input { - border-color: #c3c3c3; -} - -#ed_toolbar input:hover { - border-color: #aaa; - background: #ddd; -} - -#poststuff .wp_themeSkin .mceStatusbar { - border-color: #ededed; -} - -#poststuff #edButtonPreview, -#poststuff #edButtonHTML { - background-color: #f2f1eb; - border-color: #dfdfdf; - color: #999; -} - -#poststuff #editor-toolbar .active { - border-bottom-color: #e3eef7; - background-color: #e3eef7; - color: #333; -} - -/* TinyMCE */ -#post-status-info { - background-color: #ededed; -} - -.wp_themeSkin *, -.wp_themeSkin a:hover, -.wp_themeSkin a:link, -.wp_themeSkin a:visited, -.wp_themeSkin a:active { - color: #000; -} - -/* Containers */ -.wp_themeSkin iframe { - background: #fff; -} - -/* Layout */ -.wp_themeSkin .mceStatusbar { - color: #000; - background-color: #f5f5f5; -} - -/* Button */ -.wp_themeSkin .mceButton { - background-color: #e9e8e8; - border-color: #b2b2b2; -} - -.wp_themeSkin a.mceButtonEnabled:hover, -.wp_themeSkin a.mceButtonActive, -.wp_themeSkin a.mceButtonSelected { - background-color: #d5d5d5; - border-color: #777 !important; -} - -.wp_themeSkin .mceButtonDisabled { - border-color: #ccc !important; -} - -/* ListBox */ -.wp_themeSkin .mceListBox .mceText, -.wp_themeSkin .mceListBox .mceOpen { - border-color: #b2b2b2; - background-color: #d5d5d5; -} - -.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, -.wp_themeSkin .mceListBoxHover .mceOpen, -.wp_themeSkin .mceListBoxSelected .mceOpen, -.wp_themeSkin .mceListBoxSelected .mceText { - border-color: #777 !important; - background-color: #d5d5d5; -} - -.wp_themeSkin table.mceListBoxEnabled:hover .mceText, -.wp_themeSkin .mceListBoxHover .mceText { - border-color: #777 !important; -} - -.wp_themeSkin select.mceListBox { - border-color: #b2b2b2; - background-color: #fff; -} - -/* SplitButton */ -.wp_themeSkin .mceSplitButton a.mceAction, -.wp_themeSkin .mceSplitButton a.mceOpen { - border-color: #b2b2b2; -} - -.wp_themeSkin .mceSplitButton a.mceOpen:hover, -.wp_themeSkin .mceSplitButtonSelected a.mceOpen, -.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction, -.wp_themeSkin .mceSplitButton a.mceAction:hover { - background-color: #d5d5d5; - border-color: #777 !important; -} - -.wp_themeSkin .mceSplitButtonActive { - background-color: #b2b2b2; -} - -/* ColorSplitButton */ -.wp_themeSkin div.mceColorSplitMenu table { - background-color: #ebebeb; - border-color: #b2b2b2; -} - -.wp_themeSkin .mceColorSplitMenu a { - border-color: #b2b2b2; -} - -.wp_themeSkin .mceColorSplitMenu a.mceMoreColors { - border-color: #fff; -} - -.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover { - border-color: #0a246a; - background-color: #b6bdd2; -} - -.wp_themeSkin a.mceMoreColors:hover { - border-color: #0a246a; -} - -/* Menu */ -.wp_themeSkin .mceMenu { - border-color: #ddd; -} - -.wp_themeSkin .mceMenu table { - background-color: #ebeaeb; -} - -.wp_themeSkin .mceMenu .mceText { - color: #000; -} - -.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover, -.wp_themeSkin .mceMenu .mceMenuItemActive { - background-color: #f5f5f5; -} -.wp_themeSkin td.mceMenuItemSeparator { - background-color: #aaa; -} -.wp_themeSkin .mceMenuItemTitle a { - background-color: #ccc; - border-bottom-color: #aaa; -} -.wp_themeSkin .mceMenuItemTitle span.mceText { - color: #000; -} -.wp_themeSkin .mceMenuItemDisabled .mceText { - color: #888; -} - -#quicktags, -.wp_themeSkin tr.mceFirst td.mceToolbar { - background: #e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top; -} -.wp_themeSkin tr.mceFirst td.mceToolbar { - border-color: #dfdfdf; -} - -.wp-admin #mceModalBlocker { - background: #000; -} - -.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft { - background: #444; - border-left: 1px solid #999; - border-top: 1px solid #999; - -moz-border-radius: 4px 0 0 0; - -webkit-border-top-left-radius: 4px; - -khtml-border-top-left-radius: 4px; - border-top-left-radius: 4px; -} - -.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight { - background: #444; - border-right: 1px solid #999; - border-top: 1px solid #999; - border-top-right-radius: 4px; - -khtml-border-top-right-radius: 4px; - -webkit-border-top-right-radius: 4px; - -moz-border-radius: 0 4px 0 0; -} - -.wp-admin .clearlooks2 .mceMiddle .mceLeft { - background: #f1f1f1; - border-left: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceMiddle .mceRight { - background: #f1f1f1; - border-right: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom { - background: #f1f1f1; - border-bottom: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom .mceLeft { - background: #f1f1f1; - border-bottom: 1px solid #999; - border-left: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom .mceCenter { - background: #f1f1f1; - border-bottom: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom .mceRight { - background: #f1f1f1; - border-bottom: 1px solid #999; - border-right: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceFocus .mceTop span { - color: #e5e5e5; -} -/* end TinyMCE */ - -#editorcontainer, -#post-status-info, -#titlediv #title, -.editwidget .widget-inside { - border-color: #dfdfdf; -} - -#titlediv #title { - background-color: #fff; -} - -#tTips p#tTips_inside { - background-color: #ddd; - color: #333; -} - -#timestampdiv input, -#namediv input, -#poststuff .inside .the-tagcloud { - border-color: #dfdfdf; -} - -/* menu */ -#adminmenu * { - border-color: #dfdfdf; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; -} - -#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, -#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { - background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px; -} - -#adminmenu .wp-has-submenu:hover .wp-menu-toggle, -#adminmenu .wp-menu-open .wp-menu-toggle { - background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px; -} - -#adminmenu a.menu-top { - background: #eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px; -} - -#adminmenu .wp-submenu a { - background: #fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px; -} - -#adminmenu .wp-has-current-submenu ul li a { - background: none; -} - -#adminmenu .wp-has-current-submenu ul li a.current { - background: url(../images/menu-dark.gif) top left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, -#adminmenu .menu-top .current { - background: #3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x; - border-color: #1d507d; - color: #fff; - text-shadow: rgba(0,0,0,0.4) 0 -1px 0; -} - -#adminmenu li.wp-has-current-submenu .wp-submenu, -#adminmenu li.wp-has-current-submenu ul li a { - border-color: #aaa !important; -} - -#adminmenu li.wp-has-current-submenu ul li a { - background: url(../images/menu-dark.gif) bottom left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu ul { - border-bottom-color: #aaa; -} - -#adminmenu li.menu-top .current:hover { - border-color: #6583c0; -} - -#adminmenu .wp-submenu .current a.current { - background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px; -} - -#adminmenu .wp-submenu a:hover { - background-color: #eaf2fa !important; - color: #333 !important; -} - -#adminmenu .wp-submenu li.current, -#adminmenu .wp-submenu li.current a, -#adminmenu .wp-submenu li.current a:hover { - color: #333; - background-color: #f5f5f5; - background-image: none; - border-color: #e3e3e3; - text-shadow: rgba(255,255,255,1) 0 1px 0; -} - -#adminmenu .wp-submenu ul { - background-color: #fff; -} - -.folded #adminmenu li.menu-top, -#adminmenu .wp-submenu .wp-submenu-head { - background-color: #eaf2fa; -} - -.folded #adminmenu li.wp-has-current-submenu, -.folded #adminmenu li.menu-top.current { - background-color: #bbd8e7; -} - -#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { - background-color: #bbd8e7; - border-color: #8cbdd5; -} - -#adminmenu div.wp-submenu { - background-color: transparent; -} - -/* menu icons */ -#adminmenu #menu-dashboard div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px; -} - -#adminmenu #menu-dashboard:hover div.wp-menu-image, -#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-dashboard.current div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px; -} - -#adminmenu #menu-posts div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px; -} - -#adminmenu #menu-posts:hover div.wp-menu-image, -#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px; -} - -#adminmenu #menu-media div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px; -} - -#adminmenu #menu-media:hover div.wp-menu-image, -#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px; -} - -#adminmenu #menu-links div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px; -} - -#adminmenu #menu-links:hover div.wp-menu-image, -#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px; -} - -#adminmenu #menu-pages div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px; -} - -#adminmenu #menu-pages:hover div.wp-menu-image, -#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px; -} - -#adminmenu #menu-comments div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px; -} - -#adminmenu #menu-comments:hover div.wp-menu-image, -#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-comments.current div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px; -} - -#adminmenu #menu-appearance div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px; -} - -#adminmenu #menu-appearance:hover div.wp-menu-image, -#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px; -} - -#adminmenu #menu-plugins div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px; -} - -#adminmenu #menu-plugins:hover div.wp-menu-image, -#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px; -} - -#adminmenu #menu-users div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px; -} - -#adminmenu #menu-users:hover div.wp-menu-image, -#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px; -} - -#adminmenu #menu-tools div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px; -} - -#adminmenu #menu-tools:hover div.wp-menu-image, -#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px; -} - -#adminmenu #menu-settings div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px; -} - -#adminmenu #menu-settings:hover div.wp-menu-image, -#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px; -} -/* end menu */ - - -/* Diff */ -table.diff .diff-deletedline { - background-color: #fdd; -} - -table.diff .diff-deletedline del { - background-color: #f99; -} - -table.diff .diff-addedline { - background-color: #dfd; -} - -table.diff .diff-addedline ins { - background-color: #9f9; -} - -#att-info { - background-color: #e4f2fd; -} - -/* edit image */ -#sidemenu a { - background-color: #f9f9f9; - border-color: #f9f9f9; - border-bottom-color: #dfdfdf; -} - -#sidemenu a.current { - background-color: #fff; - border-color: #dfdfdf #dfdfdf #fff; - color: #d54e21; -} - -#screen-options-wrap, -#contextual-help-wrap { - background-color: #eae9e4; - border-color: #dfdfdf; -} - -#screen-meta-links a.show-settings { - color: #606060; -} - -#screen-meta-links a.show-settings:hover { - color: #000; -} - -#replysubmit { - background-color: #f1f1f1; - border-top-color: #ddd; -} - -#replyerror { - border-color: #ddd; - background-color: #f9f9f9; -} - -#edithead, -#replyhead { - background-color: #f1f1f1; -} - -#ed_reply_toolbar { - background-color: #e9e9e9; -} - -/* table vim shortcuts */ -.vim-current, -.vim-current th, -.vim-current td { - background-color: #e4f2fd !important; -} - -/* Install Plugins */ -.star-average, -.star.star-rating { - background-color: #fc0; -} - -div.star.select:hover { - background-color: #d00; -} - -#plugin-information .fyi ul { - background-color: #eaf3fa; -} - -#plugin-information .fyi h2.mainheader { - background-color: #cee1ef; -} - -#plugin-information pre, -#plugin-information code { - background-color: #ededff; -} - -#plugin-information pre { - border: 1px solid #ccc; -} - -/* inline editor */ -.inline-edit-row fieldset input[type="text"], -.inline-edit-row fieldset textarea, -#bulk-titles, -#replyrow input { - border-color: #ddd; -} - -.inline-editor div.title { - background-color: #eaf3fa; -} - -.inline-editor ul.cat-checklist { - background-color: #fff; - border-color: #ddd; -} - -.inline-editor .categories .catshow, -.inline-editor .categories .cathide { - color: #21759b; -} - -.inline-editor .quick-edit-save { - background-color: #f1f1f1; -} - -#replyrow #ed_reply_toolbar input:hover { - border-color: #aaa; - background: #ddd; -} - -fieldset.inline-edit-col-right .inline-edit-col { - border-color: #dfdfdf; -} - -.attention { - color: #d54e21; -} - -.meta-box-sortables .postbox:hover .handlediv { - background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; -} - -#major-publishing-actions { - background: #eaf2fa; -} - -.tablenav .tablenav-pages { - color: #555; -} - -.tablenav .tablenav-pages a { - border-color: #e3e3e3; - background: #eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px; -} - -.tablenav .tablenav-pages a:hover { - color: #d54e21; - border-color: #d54321; -} - -.tablenav .tablenav-pages a:active { - color: #fff !important; -} - -.tablenav .tablenav-pages .current { - background: #dfdfdf; - border-color: #d3d3d3; -} - -#availablethemes, -#availablethemes td { - border-color: #ddd; -} - -#current-theme img { - border-color: #999; -} - -#TB_window #TB_title a.tb-theme-preview-link, -#TB_window #TB_title a.tb-theme-preview-link:visited { - color: #999; -} - -#TB_window #TB_title a.tb-theme-preview-link:hover, -#TB_window #TB_title a.tb-theme-preview-link:focus { - color: #ccc; -} - -.misc-pub-section { - border-bottom-color: #eee; -} - -#minor-publishing { - border-bottom-color: #ddd; -} - -#post-body .misc-pub-section { - border-right-color: #eee; -} - -.post-com-count span { - background-color: #bbb; -} - -.form-table .color-palette td { - border-color: #fff; -} - -.sortable-placeholder { - border-color: #bbb; - background-color: #f5f5f5; -} - -#post-body ul#category-tabs li.tabs a { - color: #333; -} - -#wp_editimgbtn, -#wp_delimgbtn, -#wp_editgallery, -#wp_delgallery { - border-color: #999; - background-color: #eee; -} - -#wp_editimgbtn:hover, -#wp_delimgbtn:hover, -#wp_editgallery:hover, -#wp_delgallery:hover { - border-color: #555; - background-color: #ccc; -} - -#favorite-first { - background: #5580a6 url(../images/fav-vs.png) repeat-x 0 center; - border-color: #517ea5 !important; - border-bottom-color: #416686 !important; -} - -#favorite-actions .slide-down { - background-image: url(../images/fav-top-vs.gif); - background-position:0 0; - background-repeat: repeat-x; -} - -#favorite-inside { - border-color: #5b86ac; - background-color: #5580a6; -} - -#favorite-toggle { - background: transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px; -} - -#favorite-actions a { - color: #ddd; -} - -#favorite-actions a:hover { - color: #fff; -} - -#favorite-inside a:hover { - text-decoration: underline; -} - -#favorite-actions .slide-down { - border-bottom-color: #626262; -} - -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - text-shadow: rgba(255,255,255,1) 0 1px 0; -} - -.button-primary, -.submit .button-primary { - text-shadow: rgba(0,0,0,0.3) 0 -1px 0; -} - -#screen-meta a.show-settings { - background-color: transparent; - text-shadow: rgba(255,255,255,0.7) 0 1px 0; -} - -#icon-edit, -#icon-post { - background: transparent url(../images/icons32-vs.png) no-repeat -552px -5px; -} - -#icon-index { - background: transparent url(../images/icons32-vs.png) no-repeat -137px -5px; -} - -#icon-upload { - background: transparent url(../images/icons32-vs.png) no-repeat -251px -5px; -} - -#icon-link-manager, -#icon-link, -#icon-link-category { - background: transparent url(../images/icons32-vs.png) no-repeat -190px -5px; -} - -#icon-edit-pages, -#icon-page { - background: transparent url(../images/icons32-vs.png) no-repeat -312px -5px; -} - -#icon-edit-comments { - background: transparent url(../images/icons32-vs.png) no-repeat -72px -5px; -} - -#icon-themes { - background: transparent url(../images/icons32-vs.png) no-repeat -11px -5px; -} - -#icon-plugins { - background: transparent url(../images/icons32-vs.png) no-repeat -370px -5px; -} - -#icon-users, -#icon-profile, -#icon-user-edit { - background: transparent url(../images/icons32-vs.png) no-repeat -600px -5px; -} - -#icon-tools, -#icon-admin { - background: transparent url(../images/icons32-vs.png) no-repeat -432px -5px; -} - -#icon-options-general { - background: transparent url(../images/icons32-vs.png) no-repeat -492px -5px; -} - -.view-switch #view-switch-list { - background: transparent url(../images/list-vs.png) no-repeat 0 0; -} - -.view-switch #view-switch-list.current { - background: transparent url(../images/list-vs.png) no-repeat -40px 0; -} - -.view-switch #view-switch-excerpt { - background: transparent url(../images/list-vs.png) no-repeat -20px 0; -} - -.view-switch #view-switch-excerpt.current { - background: transparent url(../images/list-vs.png) no-repeat -60px 0; -} - -#header-logo { - background: transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center; -} - -#wphead #site-visit-button { - background-color: #3c6b95; - background-image: url(../images/visit-site-button-grad-vs.gif); - color: #b6d1e4; - text-shadow: #3f3f3f 0 -1px 0; -} - -#wphead a:hover #site-visit-button { - color: #fff; -} - -#wphead a:focus #site-visit-button, -#wphead a:active #site-visit-button { - background-position: 0 -27px; -} - -.popular-tags, -.feature-filter { - background-color: #fff; - border-color: #dfdfdf; -} - -#theme-information .action-button { - border-top-color: #dfdfdf; -} - -.theme-listing br.line { - border-bottom-color: #ccc; -} - -div.widgets-sortables, -#widgets-left .inactive { - background-color: #f1f1f1; - border-color: #ddd; -} - -#available-widgets .widget-holder { - background-color: #fff; - border-color: #ddd; -} - -#widgets-left .sidebar-name { - background-color: #aaa; - background-image: url(../images/ed-bg-vs.gif); - text-shadow: #FFFFFF 0 1px 0; - border-color: #dfdfdf; -} - -#widgets-right .sidebar-name { - background-image: url(../images/fav-vs.png); - text-shadow: #3f3f3f 0 -1px 0; - background-color: #636363; - border-color: #636363; - color: #fff; -} - -.sidebar-name:hover, -#removing-widget { - color: #d54e21; -} - -#removing-widget span { - color: black; -} - -#widgets-left .sidebar-name-arrow { - background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px; -} - -#widgets-right .sidebar-name-arrow { - background: transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px; -} - -.in-widget-title { - color: #606060; -} - -.deleting .widget-title * { - color: #aaa; -} +html{background-color:#f7f6f1;}* html input,* html .widget{border-color:#8cbdd5;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9;}#postcustomstuff thead th{background-color:#f1f1f1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul#category-tabs li.tabs{border-color:#dfdfdf;}ul#category-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}.login #backtoblog a:hover,#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#d5e6f2 url("../images/blue-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#093e56;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alt .alternate{background-color:#edfbfc;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#8cbdd5;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#dfdfdf;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#adaca7;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#5b86ab;font-weight:bold;color:#fff;background:#5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#2e5475;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#B0C3E2!important;background:#6590A6!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#dashboard_right_now .table{background:#faf9f7!important;}#side-sortables #category-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#b8d3e2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#1c6280;}body.press-this .tabs a,body.press-this .tabs a:hover{background-color:#fff;border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow,#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li a:hover #awaiting-mod,#adminmenu li a:hover .update-plugins,#sidemenu li a:hover .update-plugins{background-color:#264761;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li.current a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins{background-color:#ddd;color:#000;text-shadow:none;-moz-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-khtml-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-webkit-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;box-shadow:rgba(0,0,0,0.2) 0 -1px 0;}#adminmenu li.current a:hover #awaiting-mod,#adminmenu li.current a:hover .update-plugins,#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,#adminmenu li.wp-has-current-submenu a:hover .update-plugins{background-color:#264761;color:#fff;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer,#footer-upgrade{background:#1d507d;color:#b6d1e4;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,.postbox,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#ebeeef;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#093e56;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag{background-color:#fffeeb;border-color:#ccc;color:#555;}.login #backtoblog a{color:#ccc;}#wphead{background-color:#1d507d;}body.login{border-top-color:#093e56;}#wphead h1 a{color:#fff;}#user_info{color:#b6d1e4;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#fff;text-decoration:none;}#user_info a:hover,#user_info a:active,#footer a:hover,#footer a:active{text-decoration:underline;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover,#dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#c3c3c3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#ededed;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f2f1eb;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e3eef7;background-color:#e3eef7;color:#333;}#post-status-info{background-color:#ededed;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#b2b2b2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#b2b2b2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#b2b2b2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#b2b2b2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#b2b2b2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0a246a;background-color:#b6bdd2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0a246a;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}#quicktags,.wp_themeSkin tr.mceFirst td.mceToolbar{background:#e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top;}.wp_themeSkin tr.mceFirst td.mceToolbar{border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#dfdfdf;}#adminmenu *{border-color:#dfdfdf;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:#3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x;border-color:#1d507d;color:#fff;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu li.menu-top .current:hover{border-color:#6583c0;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#eaf2fa!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;text-shadow:rgba(255,255,255,1) 0 1px 0;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#eaf2fa;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#bbd8e7;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#bbd8e7;border-color:#8cbdd5;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu #menu-dashboard div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px;}#adminmenu #menu-dashboard:hover div.wp-menu-image,#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-dashboard.current div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px;}#adminmenu #menu-posts div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px;}#adminmenu #menu-posts:hover div.wp-menu-image,#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px;}#adminmenu #menu-media div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px;}#adminmenu #menu-media:hover div.wp-menu-image,#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px;}#adminmenu #menu-links div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px;}#adminmenu #menu-links:hover div.wp-menu-image,#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px;}#adminmenu #menu-pages div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px;}#adminmenu #menu-pages:hover div.wp-menu-image,#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px;}#adminmenu #menu-comments div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px;}#adminmenu #menu-comments:hover div.wp-menu-image,#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-comments.current div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px;}#adminmenu #menu-appearance div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px;}#adminmenu #menu-appearance:hover div.wp-menu-image,#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px;}#adminmenu #menu-plugins div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px;}#adminmenu #menu-plugins:hover div.wp-menu-image,#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px;}#adminmenu #menu-users div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px;}#adminmenu #menu-users:hover div.wp-menu-image,#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px;}#adminmenu #menu-tools div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px;}#adminmenu #menu-tools:hover div.wp-menu-image,#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px;}#adminmenu #menu-settings div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px;}#adminmenu #menu-settings:hover div.wp-menu-image,#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#e4f2fd;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21;}#screen-options-wrap,#contextual-help-wrap{background-color:#eae9e4;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#eaf3fa;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#d54e21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul#category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{background:#5580a6 url(../images/fav-vs.png) repeat-x 0 center;border-color:#517ea5!important;border-bottom-color:#416686!important;}#favorite-actions .slide-down{background-image:url(../images/fav-top-vs.gif);background-position:0 0;background-repeat:repeat-x;}#favorite-inside{border-color:#5b86ac;background-color:#5580a6;}#favorite-toggle{background:transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px;}#favorite-actions a{color:#ddd;}#favorite-actions a:hover{color:#fff;}#favorite-inside a:hover{text-decoration:underline;}#favorite-actions .slide-down{border-bottom-color:#626262;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32-vs.png) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32-vs.png) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32-vs.png) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32-vs.png) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32-vs.png) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32-vs.png) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32-vs.png) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32-vs.png) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32-vs.png) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32-vs.png) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32-vs.png) no-repeat -492px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list-vs.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list-vs.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list-vs.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list-vs.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center;}#wphead #site-visit-button{background-color:#3c6b95;background-image:url(../images/visit-site-button-grad-vs.gif);color:#b6d1e4;text-shadow:#3f3f3f 0 -1px 0;}#wphead a:hover #site-visit-button{color:#fff;}#wphead a:focus #site-visit-button,#wphead a:active #site-visit-button{background-position:0 -27px;}.popular-tags,.feature-filter{background-color:#fff;border-color:#dfdfdf;}#theme-information .action-button{border-top-color:#dfdfdf;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg-vs.gif);text-shadow:#FFF 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav-vs.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;} \ No newline at end of file diff --git a/wp-admin/css/colors-classic.dev.css b/wp-admin/css/colors-classic.dev.css new file mode 100644 index 00000000..9f244186 --- /dev/null +++ b/wp-admin/css/colors-classic.dev.css @@ -0,0 +1,1708 @@ +html { + background-color: #f7f6f1; +} + +* html input, +* html .widget { + border-color: #8cbdd5; +} + +textarea, +input[type="text"], +input[type="password"], +input[type="file"], +input[type="button"], +input[type="submit"], +input[type="reset"], +select { + border-color: #dfdfdf; + background-color: #fff; +} + +kbd, +code { + background: #eaeaea; +} + +input[readonly] { + background-color: #eee; +} + +.find-box-search { + border-color: #dfdfdf; + background-color: #f1f1f1; +} + +.find-box { + background-color: #f1f1f1; +} + +.find-box-inside { + background-color: #fff; +} + +a.page-numbers:hover { + border-color: #999; +} + +body, +#wpbody, +.form-table .pre { + color: #333; +} + +body > #upload-menu { + border-bottom-color: #fff; +} + +#postcustomstuff table, +#your-profile fieldset, +#rightnow, +div.dashboard-widget, +#dashboard-widgets p.dashboard-widget-links, +#replyrow #ed_reply_toolbar input { + border-color: #ccc; +} + +#poststuff .inside label.spam, +#poststuff .inside label.deleted { + color: red; +} + +#poststuff .inside label.waiting { + color: orange; +} + +#poststuff .inside label.approved { + color: green; +} + +#postcustomstuff table { + border-color: #dfdfdf; + background-color: #f9f9f9; +} + +#postcustomstuff thead th { + background-color: #f1f1f1; +} + +#postcustomstuff table input, +#postcustomstuff table textarea { + border-color: #dfdfdf; + background-color: #fff; +} + +.widefat { + border-color: #dfdfdf; + background-color: #fff; +} + +div.dashboard-widget-error { + background-color: #c43; +} + +div.dashboard-widget-notice { + background-color: #cfe1ef; +} + +div.dashboard-widget-submit { + border-top-color: #ccc; +} + +div.tabs-panel, +ul#category-tabs li.tabs { + border-color: #dfdfdf; +} + +ul#category-tabs li.tabs { + background-color: #f1f1f1; +} + +input.disabled, +textarea.disabled { + background-color: #ccc; +} +/* #upload-menu li a.upload-tab-link, */ +.login #backtoblog a:hover, +#plugin-information .action-button a, +#plugin-information .action-button a:hover, +#plugin-information .action-button a:visited { + color: #fff; +} + +.widget .widget-top, +.postbox h3, +.stuffbox h3 { + background: #d5e6f2 url("../images/blue-grad.png") repeat-x left top; + text-shadow: #fff 0 1px 0; +} + +.form-table th, +.form-wrap label { + color: #222; + text-shadow: #fff 0 1px 0; +} + +.description, +.form-wrap p { + color: #666; +} + +strong .post-com-count span { + background-color: #21759b; +} + +.sorthelper { + background-color: #ccf3fa; +} + +.ac_match, +.subsubsub a.current { + color: #000; +} + +.wrap h2 { + color: #093e56; +} + +.ac_over { + background-color: #f0f0b8; +} + +.ac_results { + background-color: #fff; + border-color: #808080; +} + +.ac_results li { + color: #101010; +} + +.alt +.alternate { + background-color: #edfbfc; +} + +.available-theme a.screenshot { + background-color: #f1f1f1; + border-color: #ddd; +} + +.bar { + background-color: #e8e8e8; + border-right-color: #99d; +} + +#media-upload, +#media-upload .media-item .slidetoggle { + background: #fff; +} + +#media-upload .slidetoggle { + border-top-color: #dfdfdf; +} + +.error, +.login #login_error { + background-color: #ffebe8; + border-color: #c00; +} + +.error a { + color: #c00; +} + +.form-invalid { + background-color: #ffebe8 !important; +} + +.form-invalid input, +.form-invalid select { + border-color: #c00 !important; +} + +.submit { + border-color: #8cbdd5; +} + +.highlight { + background-color: #e4f2fd; + color: #d54e21; +} + +.howto, +.nonessential, +#edit-slug-box, +.form-input-tip, +.rss-widget span.rss-date, +.subsubsub { + color: #666; +} + +.media-item { + border-bottom-color: #dfdfdf; +} + +#wpbody-content #media-items .describe { + border-top-color: #dfdfdf; +} + +.media-upload-form label.form-help, +td.help { + color: #9a9a9a; +} + +.post-com-count { + background-image: url(../images/bubble_bg.gif); + color: #fff; +} + +.post-com-count span { + background-color: #bbb; + color: #fff; +} + +.post-com-count:hover span { + background-color: #d54e21; +} + +.quicktags, .search { + background-color: #ccc; + color: #000; +} + +.side-info h5 { + border-bottom-color: #dadada; +} + +.side-info ul { + color: #666; +} + +.button, +.button-secondary, +.submit input, +input[type=button], +input[type=submit] { + border-color: #dfdfdf; + color: #464646; +} + +.button:hover, +.button-secondary:hover, +.submit input:hover, +input[type=button]:hover, +input[type=submit]:hover { + color: #000; + border-color: #adaca7; +} + +.button, +.submit input, +.button-secondary { + background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top; + text-shadow: rgba(255,255,255,1) 0 1px 0; +} + +.button:active, +.submit input:active, +.button-secondary:active { + background: #eee url(../images/white-grad-active.png) repeat-x scroll left top; +} + +input.button-primary, +button.button-primary, +a.button-primary { + border-color: #5b86ab; + font-weight: bold; + color: #fff; + background: #5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top; + text-shadow: rgba(0,0,0,0.3) 0 -1px 0; +} + +input.button-primary:active, +button.button-primary:active, +a.button-primary:active { + background: #21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top; + color: #eaf2fa; +} + +input.button-primary:hover, +button.button-primary:hover, +a.button-primary:hover, +a.button-primary:focus, +a.button-primary:active { + border-color: #2e5475; + color: #eaf2fa; +} + +.button-disabled, +.button[disabled], +.button:disabled, +.button-secondary[disabled], +.button-secondary:disabled, +a.button.disabled { + color: #aaa !important; + border-color: #ddd !important; +} + +.button-primary-disabled, +.button-primary[disabled], +.button-primary:disabled { + color: #B0C3E2 !important; + background: #6590A6 !important; +} + +a:hover, +a:active, +a:focus { + color: #d54e21; +} + +#wphead #viewsite a:hover, +#adminmenu a:hover, +#adminmenu ul.wp-submenu a:hover, +#the-comment-list .comment a:hover, +#rightnow a:hover, +#media-upload a.del-link:hover, +div.dashboard-widget-submit input:hover, +.subsubsub a:hover, +.subsubsub a.current:hover, +.ui-tabs-nav a:hover, +.plugins .inactive a:hover, +#all-plugins-table .plugins .inactive a:hover, +#search-plugins-table .plugins .inactive a:hover { + color: #d54e21; +} + +#the-comment-list .comment-item, +#dashboard-widgets #dashboard_quick_press form p.submit { + border-color: #dfdfdf; +} + +#dashboard_right_now .table { + background:#faf9f7 !important; +} + +#side-sortables #category-tabs .tabs a { + color: #333; +} + +#rightnow .rbutton { + background-color: #ebebeb; + color: #264761; +} + +.submitbox .submit { + background-color: #464646; + color: #ccc; +} + +.plugins a.delete:hover, +#all-plugins-table .plugins a.delete:hover, +#search-plugins-table .plugins a.delete:hover, +.submitbox .submitdelete { + color: #f00; + border-bottom-color: #f00; +} + +.submitbox .submitdelete:hover, +#media-items a.delete:hover { + color: #fff; + background-color: #f00; + border-bottom-color: #f00; +} + +#normal-sortables .submitbox .submitdelete:hover { + color: #000; + background-color: #f00; + border-bottom-color: #f00; +} + +.tablenav .dots { + border-color: transparent; +} + +.tablenav .next, +.tablenav .prev { + border-color: transparent; + color: #21759b; +} + +.tablenav .next:hover, +.tablenav .prev:hover { + border-color: transparent; + color: #d54e21; +} + +.updated, +.login .message { + background-color: #ffffe0; + border-color: #e6db55; +} + +.update-message { + color: #000000; +} + +a.page-numbers { + border-bottom-color: #b8d3e2; +} + +.commentlist li { + border-bottom-color: #ccc; +} + +.widefat td, +.widefat th, +#install-plugins .plugins td, +#install-plugins .plugins th { + border-color: #dfdfdf; +} + +.widefat th { + text-shadow: rgba(255,255,255,0.8) 0 1px 0; +} + +.widefat thead tr th, +.widefat tfoot tr th, +h3.dashboard-widget-title, +h3.dashboard-widget-title span, +h3.dashboard-widget-title small, +.find-box-head { + color: #333; + background: #d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top; +} + +h3.dashboard-widget-title small a { + color: #d7d7d7; +} + +h3.dashboard-widget-title small a:hover { + color: #fff; +} + +a, +#adminmenu a, +#poststuff #edButtonPreview, +#poststuff #edButtonHTML, +#the-comment-list p.comment-author strong a, +#media-upload a.del-link, +#media-items a.delete, +.plugins a.delete, +.ui-tabs-nav a { + color: #1c6280; +} + +/* Because we don't want visited on these links */ +body.press-this .tabs a, +body.press-this .tabs a:hover { + background-color: #fff; + border-color: #c6d9e9; + border-bottom-color: #fff; + color: #d54e21; +} + +#adminmenu #awaiting-mod, +#adminmenu .update-plugins, +#sidemenu a .update-plugins, +#rightnow .reallynow, +#plugin-information .action-button { + background-color: #d54e21; + color: #fff; +} + +#adminmenu li a:hover #awaiting-mod, +#adminmenu li a:hover .update-plugins, +#sidemenu li a:hover .update-plugins { + background-color: #264761; + color: #fff; +} + +#adminmenu li.current a #awaiting-mod, +#adminmenu li.current a .update-plugins, +#adminmenu li.wp-has-current-submenu a .update-plugins, +#adminmenu li.wp-has-current-submenu a .update-plugins { + background-color: #ddd; + color: #000; + text-shadow: none; + -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; + -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; + -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; + box-shadow: rgba(0,0,0,0.2) 0 -1px 0; +} + +#adminmenu li.current a:hover #awaiting-mod, +#adminmenu li.current a:hover .update-plugins, +#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod, +#adminmenu li.wp-has-current-submenu a:hover .update-plugins { + background-color: #264761; + color: #fff; +} + +div#media-upload-header, +div#plugin-information-header { + background-color: #f9f9f9; + border-bottom-color: #dfdfdf; +} + +#currenttheme img { + border-color: #666; +} + +#dashboard_secondary div.dashboard-widget-content ul li a { + background-color: #f9f9f9; +} + +input.readonly, textarea.readonly { + background-color: #ddd; +} + +#ed_toolbar input, +#ed_reply_toolbar input { + background: #fff url("../images/fade-butt.png") repeat-x 0 -2px; +} + +#editable-post-name { + background-color: #fffbcc; +} + +#edit-slug-box strong, +.tablenav .displaying-num, +#submitted-on { + color: #777; +} + +.login #nav a { + color: #21759b !important; +} + +.login #nav a:hover { + color: #d54e21 !important; +} + +#footer, +#footer-upgrade { + background: #1d507d; + color: #b6d1e4; +} + +#media-items, +.imgedit-group { + border-color: #dfdfdf; +} + +.checkbox, +.side-info, +.plugins tr, +.postbox, +#your-profile #rich_editing { + background-color: #fff; +} + +.plugins .inactive, +.plugins .inactive th, +.plugins .inactive td, +tr.inactive + tr.plugin-update-tr .plugin-update { + background-color: #ebeeef; +} + +.plugin-update-tr .update-message { + background-color: #fffbe4; + border-color: #dfdfdf; +} + +.plugins .active, +.plugins .active th, +.plugins .active td { + color: #000; +} + +.plugins .inactive a { + color: #557799; +} + +#the-comment-list tr.undo, +#the-comment-list div.undo { + background-color: #f4f4f4; +} + +#the-comment-list .unapproved { + background-color: #ffffe0; +} + +#the-comment-list .approve a { + color: #006505; +} + +#the-comment-list .unapprove a { + color: #d98500; +} + +table.widefat span.delete a, +table.widefat span.trash a, +table.widefat span.spam a, +#dashboard_recent_comments .delete a, +#dashboard_recent_comments .trash a, +#dashboard_recent_comments .spam a { + color: #bc0b0b; +} + +.widget, +#widget-list .widget-top, +.postbox, +#titlediv, +#poststuff .postarea, +.stuffbox { + border-color: #dfdfdf; +} + +.widget, +.postbox { + background-color: #fff; +} + +.ui-sortable .postbox h3 { + color: #093e56; +} + +.widget .widget-top, +.ui-sortable .postbox h3:hover { + color: #000; +} + +.curtime #timestamp { + background-image: url(../images/date-button.gif); +} + +#quicktags #ed_link { + color: #00f; +} + +#rightnow .youhave { + background-color: #f0f6fb; +} + +#rightnow a { + color: #448abd; +} + +.tagchecklist span a, +#bulk-titles div a { + background: url(../images/xit.gif) no-repeat; +} + +.tagchecklist span a:hover, +#bulk-titles div a:hover { + background: url(../images/xit.gif) no-repeat -10px 0; +} + +#update-nag { + background-color: #fffeeb; + border-color: #ccc; + color: #555; +} + +.login #backtoblog a { + color: #ccc; +} + +#wphead { + background-color: #1d507d; +} + +body.login { + border-top-color: #093e56; +} + +#wphead h1 a { + color: #fff; +} + +#user_info { + color: #b6d1e4; +} + +#user_info a:link, +#user_info a:visited, +#footer a:link, +#footer a:visited { + color: #fff; + text-decoration: none; +} + +#user_info a:hover, +#user_info a:active, +#footer a:hover, +#footer a:active { + text-decoration: underline; +} + +div#media-upload-error, +.file-error, +abbr.required, +.widget-control-remove:hover, +table.widefat .delete a:hover, +table.widefat .trash a:hover, +table.widefat .spam a:hover, +#dashboard_recent_comments .delete a:hover, +#dashboard_recent_comments .trash a:hover, +#dashboard_recent_comments .spam a:hover { + color: #f00; +} + +/* password strength meter */ +#pass-strength-result { + background-color: #eee; + border-color: #ddd !important; +} + +#pass-strength-result.bad { + background-color: #ffb78c; + border-color: #ff853c !important; +} + +#pass-strength-result.good { + background-color: #ffec8b; + border-color: #fc0 !important; +} + +#pass-strength-result.short { + background-color: #ffa0a0; + border-color: #f04040 !important; +} + +#pass-strength-result.strong { + background-color: #c3ff88; + border-color: #8dff1c !important; +} + +/* editors */ +#quicktags { + border-color: #dfdfdf; + background-color: #dfdfdf; +} + +#ed_toolbar input { + border-color: #c3c3c3; +} + +#ed_toolbar input:hover { + border-color: #aaa; + background: #ddd; +} + +#poststuff .wp_themeSkin .mceStatusbar { + border-color: #ededed; +} + +#poststuff #edButtonPreview, +#poststuff #edButtonHTML { + background-color: #f2f1eb; + border-color: #dfdfdf; + color: #999; +} + +#poststuff #editor-toolbar .active { + border-bottom-color: #e3eef7; + background-color: #e3eef7; + color: #333; +} + +/* TinyMCE */ +#post-status-info { + background-color: #ededed; +} + +.wp_themeSkin *, +.wp_themeSkin a:hover, +.wp_themeSkin a:link, +.wp_themeSkin a:visited, +.wp_themeSkin a:active { + color: #000; +} + +/* Containers */ +.wp_themeSkin iframe { + background: #fff; +} + +/* Layout */ +.wp_themeSkin .mceStatusbar { + color: #000; + background-color: #f5f5f5; +} + +/* Button */ +.wp_themeSkin .mceButton { + background-color: #e9e8e8; + border-color: #b2b2b2; +} + +.wp_themeSkin a.mceButtonEnabled:hover, +.wp_themeSkin a.mceButtonActive, +.wp_themeSkin a.mceButtonSelected { + background-color: #d5d5d5; + border-color: #777 !important; +} + +.wp_themeSkin .mceButtonDisabled { + border-color: #ccc !important; +} + +/* ListBox */ +.wp_themeSkin .mceListBox .mceText, +.wp_themeSkin .mceListBox .mceOpen { + border-color: #b2b2b2; + background-color: #d5d5d5; +} + +.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, +.wp_themeSkin .mceListBoxHover .mceOpen, +.wp_themeSkin .mceListBoxSelected .mceOpen, +.wp_themeSkin .mceListBoxSelected .mceText { + border-color: #777 !important; + background-color: #d5d5d5; +} + +.wp_themeSkin table.mceListBoxEnabled:hover .mceText, +.wp_themeSkin .mceListBoxHover .mceText { + border-color: #777 !important; +} + +.wp_themeSkin select.mceListBox { + border-color: #b2b2b2; + background-color: #fff; +} + +/* SplitButton */ +.wp_themeSkin .mceSplitButton a.mceAction, +.wp_themeSkin .mceSplitButton a.mceOpen { + border-color: #b2b2b2; +} + +.wp_themeSkin .mceSplitButton a.mceOpen:hover, +.wp_themeSkin .mceSplitButtonSelected a.mceOpen, +.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction, +.wp_themeSkin .mceSplitButton a.mceAction:hover { + background-color: #d5d5d5; + border-color: #777 !important; +} + +.wp_themeSkin .mceSplitButtonActive { + background-color: #b2b2b2; +} + +/* ColorSplitButton */ +.wp_themeSkin div.mceColorSplitMenu table { + background-color: #ebebeb; + border-color: #b2b2b2; +} + +.wp_themeSkin .mceColorSplitMenu a { + border-color: #b2b2b2; +} + +.wp_themeSkin .mceColorSplitMenu a.mceMoreColors { + border-color: #fff; +} + +.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover { + border-color: #0a246a; + background-color: #b6bdd2; +} + +.wp_themeSkin a.mceMoreColors:hover { + border-color: #0a246a; +} + +/* Menu */ +.wp_themeSkin .mceMenu { + border-color: #ddd; +} + +.wp_themeSkin .mceMenu table { + background-color: #ebeaeb; +} + +.wp_themeSkin .mceMenu .mceText { + color: #000; +} + +.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover, +.wp_themeSkin .mceMenu .mceMenuItemActive { + background-color: #f5f5f5; +} +.wp_themeSkin td.mceMenuItemSeparator { + background-color: #aaa; +} +.wp_themeSkin .mceMenuItemTitle a { + background-color: #ccc; + border-bottom-color: #aaa; +} +.wp_themeSkin .mceMenuItemTitle span.mceText { + color: #000; +} +.wp_themeSkin .mceMenuItemDisabled .mceText { + color: #888; +} + +#quicktags, +.wp_themeSkin tr.mceFirst td.mceToolbar { + background: #e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top; +} +.wp_themeSkin tr.mceFirst td.mceToolbar { + border-color: #dfdfdf; +} + +.wp-admin #mceModalBlocker { + background: #000; +} + +.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft { + background: #444; + border-left: 1px solid #999; + border-top: 1px solid #999; + -moz-border-radius: 4px 0 0 0; + -webkit-border-top-left-radius: 4px; + -khtml-border-top-left-radius: 4px; + border-top-left-radius: 4px; +} + +.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight { + background: #444; + border-right: 1px solid #999; + border-top: 1px solid #999; + border-top-right-radius: 4px; + -khtml-border-top-right-radius: 4px; + -webkit-border-top-right-radius: 4px; + -moz-border-radius: 0 4px 0 0; +} + +.wp-admin .clearlooks2 .mceMiddle .mceLeft { + background: #f1f1f1; + border-left: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceMiddle .mceRight { + background: #f1f1f1; + border-right: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom { + background: #f1f1f1; + border-bottom: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom .mceLeft { + background: #f1f1f1; + border-bottom: 1px solid #999; + border-left: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom .mceCenter { + background: #f1f1f1; + border-bottom: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom .mceRight { + background: #f1f1f1; + border-bottom: 1px solid #999; + border-right: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceFocus .mceTop span { + color: #e5e5e5; +} +/* end TinyMCE */ + +#editorcontainer, +#post-status-info, +#titlediv #title, +.editwidget .widget-inside { + border-color: #dfdfdf; +} + +#titlediv #title { + background-color: #fff; +} + +#tTips p#tTips_inside { + background-color: #ddd; + color: #333; +} + +#timestampdiv input, +#namediv input, +#poststuff .inside .the-tagcloud { + border-color: #dfdfdf; +} + +/* menu */ +#adminmenu * { + border-color: #dfdfdf; +} + +#adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; +} + +.folded #adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; +} + +#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, +#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px; +} + +#adminmenu .wp-has-submenu:hover .wp-menu-toggle, +#adminmenu .wp-menu-open .wp-menu-toggle { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px; +} + +#adminmenu a.menu-top { + background: #eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px; +} + +#adminmenu .wp-submenu a { + background: #fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px; +} + +#adminmenu .wp-has-current-submenu ul li a { + background: none; +} + +#adminmenu .wp-has-current-submenu ul li a.current { + background: url(../images/menu-dark.gif) top left no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, +#adminmenu .menu-top .current { + background: #3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x; + border-color: #1d507d; + color: #fff; + text-shadow: rgba(0,0,0,0.4) 0 -1px 0; +} + +#adminmenu li.wp-has-current-submenu .wp-submenu, +#adminmenu li.wp-has-current-submenu ul li a { + border-color: #aaa !important; +} + +#adminmenu li.wp-has-current-submenu ul li a { + background: url(../images/menu-dark.gif) bottom left no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu ul { + border-bottom-color: #aaa; +} + +#adminmenu li.menu-top .current:hover { + border-color: #6583c0; +} + +#adminmenu .wp-submenu .current a.current { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px; +} + +#adminmenu .wp-submenu a:hover { + background-color: #eaf2fa !important; + color: #333 !important; +} + +#adminmenu .wp-submenu li.current, +#adminmenu .wp-submenu li.current a, +#adminmenu .wp-submenu li.current a:hover { + color: #333; + background-color: #f5f5f5; + background-image: none; + border-color: #e3e3e3; + text-shadow: rgba(255,255,255,1) 0 1px 0; +} + +#adminmenu .wp-submenu ul { + background-color: #fff; +} + +.folded #adminmenu li.menu-top, +#adminmenu .wp-submenu .wp-submenu-head { + background-color: #eaf2fa; +} + +.folded #adminmenu li.wp-has-current-submenu, +.folded #adminmenu li.menu-top.current { + background-color: #bbd8e7; +} + +#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { + background-color: #bbd8e7; + border-color: #8cbdd5; +} + +#adminmenu div.wp-submenu { + background-color: transparent; +} + +/* menu icons */ +#adminmenu #menu-dashboard div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px; +} + +#adminmenu #menu-dashboard:hover div.wp-menu-image, +#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, +#adminmenu #menu-dashboard.current div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px; +} + +#adminmenu #menu-posts div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px; +} + +#adminmenu #menu-posts:hover div.wp-menu-image, +#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px; +} + +#adminmenu #menu-media div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px; +} + +#adminmenu #menu-media:hover div.wp-menu-image, +#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px; +} + +#adminmenu #menu-links div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px; +} + +#adminmenu #menu-links:hover div.wp-menu-image, +#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px; +} + +#adminmenu #menu-pages div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px; +} + +#adminmenu #menu-pages:hover div.wp-menu-image, +#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px; +} + +#adminmenu #menu-comments div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px; +} + +#adminmenu #menu-comments:hover div.wp-menu-image, +#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, +#adminmenu #menu-comments.current div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px; +} + +#adminmenu #menu-appearance div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px; +} + +#adminmenu #menu-appearance:hover div.wp-menu-image, +#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px; +} + +#adminmenu #menu-plugins div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px; +} + +#adminmenu #menu-plugins:hover div.wp-menu-image, +#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px; +} + +#adminmenu #menu-users div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px; +} + +#adminmenu #menu-users:hover div.wp-menu-image, +#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px; +} + +#adminmenu #menu-tools div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px; +} + +#adminmenu #menu-tools:hover div.wp-menu-image, +#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px; +} + +#adminmenu #menu-settings div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px; +} + +#adminmenu #menu-settings:hover div.wp-menu-image, +#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px; +} +/* end menu */ + + +/* Diff */ +table.diff .diff-deletedline { + background-color: #fdd; +} + +table.diff .diff-deletedline del { + background-color: #f99; +} + +table.diff .diff-addedline { + background-color: #dfd; +} + +table.diff .diff-addedline ins { + background-color: #9f9; +} + +#att-info { + background-color: #e4f2fd; +} + +/* edit image */ +#sidemenu a { + background-color: #f9f9f9; + border-color: #f9f9f9; + border-bottom-color: #dfdfdf; +} + +#sidemenu a.current { + background-color: #fff; + border-color: #dfdfdf #dfdfdf #fff; + color: #d54e21; +} + +#screen-options-wrap, +#contextual-help-wrap { + background-color: #eae9e4; + border-color: #dfdfdf; +} + +#screen-meta-links a.show-settings { + color: #606060; +} + +#screen-meta-links a.show-settings:hover { + color: #000; +} + +#replysubmit { + background-color: #f1f1f1; + border-top-color: #ddd; +} + +#replyerror { + border-color: #ddd; + background-color: #f9f9f9; +} + +#edithead, +#replyhead { + background-color: #f1f1f1; +} + +#ed_reply_toolbar { + background-color: #e9e9e9; +} + +/* table vim shortcuts */ +.vim-current, +.vim-current th, +.vim-current td { + background-color: #e4f2fd !important; +} + +/* Install Plugins */ +.star-average, +.star.star-rating { + background-color: #fc0; +} + +div.star.select:hover { + background-color: #d00; +} + +#plugin-information .fyi ul { + background-color: #eaf3fa; +} + +#plugin-information .fyi h2.mainheader { + background-color: #cee1ef; +} + +#plugin-information pre, +#plugin-information code { + background-color: #ededff; +} + +#plugin-information pre { + border: 1px solid #ccc; +} + +/* inline editor */ +.inline-edit-row fieldset input[type="text"], +.inline-edit-row fieldset textarea, +#bulk-titles, +#replyrow input { + border-color: #ddd; +} + +.inline-editor div.title { + background-color: #eaf3fa; +} + +.inline-editor ul.cat-checklist { + background-color: #fff; + border-color: #ddd; +} + +.inline-editor .categories .catshow, +.inline-editor .categories .cathide { + color: #21759b; +} + +.inline-editor .quick-edit-save { + background-color: #f1f1f1; +} + +#replyrow #ed_reply_toolbar input:hover { + border-color: #aaa; + background: #ddd; +} + +fieldset.inline-edit-col-right .inline-edit-col { + border-color: #dfdfdf; +} + +.attention { + color: #d54e21; +} + +.meta-box-sortables .postbox:hover .handlediv { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; +} + +#major-publishing-actions { + background: #eaf2fa; +} + +.tablenav .tablenav-pages { + color: #555; +} + +.tablenav .tablenav-pages a { + border-color: #e3e3e3; + background: #eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px; +} + +.tablenav .tablenav-pages a:hover { + color: #d54e21; + border-color: #d54321; +} + +.tablenav .tablenav-pages a:active { + color: #fff !important; +} + +.tablenav .tablenav-pages .current { + background: #dfdfdf; + border-color: #d3d3d3; +} + +#availablethemes, +#availablethemes td { + border-color: #ddd; +} + +#current-theme img { + border-color: #999; +} + +#TB_window #TB_title a.tb-theme-preview-link, +#TB_window #TB_title a.tb-theme-preview-link:visited { + color: #999; +} + +#TB_window #TB_title a.tb-theme-preview-link:hover, +#TB_window #TB_title a.tb-theme-preview-link:focus { + color: #ccc; +} + +.misc-pub-section { + border-bottom-color: #eee; +} + +#minor-publishing { + border-bottom-color: #ddd; +} + +#post-body .misc-pub-section { + border-right-color: #eee; +} + +.post-com-count span { + background-color: #bbb; +} + +.form-table .color-palette td { + border-color: #fff; +} + +.sortable-placeholder { + border-color: #bbb; + background-color: #f5f5f5; +} + +#post-body ul#category-tabs li.tabs a { + color: #333; +} + +#wp_editimgbtn, +#wp_delimgbtn, +#wp_editgallery, +#wp_delgallery { + border-color: #999; + background-color: #eee; +} + +#wp_editimgbtn:hover, +#wp_delimgbtn:hover, +#wp_editgallery:hover, +#wp_delgallery:hover { + border-color: #555; + background-color: #ccc; +} + +#favorite-first { + background: #5580a6 url(../images/fav-vs.png) repeat-x 0 center; + border-color: #517ea5 !important; + border-bottom-color: #416686 !important; +} + +#favorite-actions .slide-down { + background-image: url(../images/fav-top-vs.gif); + background-position:0 0; + background-repeat: repeat-x; +} + +#favorite-inside { + border-color: #5b86ac; + background-color: #5580a6; +} + +#favorite-toggle { + background: transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px; +} + +#favorite-actions a { + color: #ddd; +} + +#favorite-actions a:hover { + color: #fff; +} + +#favorite-inside a:hover { + text-decoration: underline; +} + +#favorite-actions .slide-down { + border-bottom-color: #626262; +} + +#screen-meta a.show-settings { + background-color: transparent; + text-shadow: rgba(255,255,255,0.7) 0 1px 0; +} + +#icon-edit, +#icon-post { + background: transparent url(../images/icons32-vs.png) no-repeat -552px -5px; +} + +#icon-index { + background: transparent url(../images/icons32-vs.png) no-repeat -137px -5px; +} + +#icon-upload { + background: transparent url(../images/icons32-vs.png) no-repeat -251px -5px; +} + +#icon-link-manager, +#icon-link, +#icon-link-category { + background: transparent url(../images/icons32-vs.png) no-repeat -190px -5px; +} + +#icon-edit-pages, +#icon-page { + background: transparent url(../images/icons32-vs.png) no-repeat -312px -5px; +} + +#icon-edit-comments { + background: transparent url(../images/icons32-vs.png) no-repeat -72px -5px; +} + +#icon-themes { + background: transparent url(../images/icons32-vs.png) no-repeat -11px -5px; +} + +#icon-plugins { + background: transparent url(../images/icons32-vs.png) no-repeat -370px -5px; +} + +#icon-users, +#icon-profile, +#icon-user-edit { + background: transparent url(../images/icons32-vs.png) no-repeat -600px -5px; +} + +#icon-tools, +#icon-admin { + background: transparent url(../images/icons32-vs.png) no-repeat -432px -5px; +} + +#icon-options-general { + background: transparent url(../images/icons32-vs.png) no-repeat -492px -5px; +} + +.view-switch #view-switch-list { + background: transparent url(../images/list-vs.png) no-repeat 0 0; +} + +.view-switch #view-switch-list.current { + background: transparent url(../images/list-vs.png) no-repeat -40px 0; +} + +.view-switch #view-switch-excerpt { + background: transparent url(../images/list-vs.png) no-repeat -20px 0; +} + +.view-switch #view-switch-excerpt.current { + background: transparent url(../images/list-vs.png) no-repeat -60px 0; +} + +#header-logo { + background: transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center; +} + +#wphead #site-visit-button { + background-color: #3c6b95; + background-image: url(../images/visit-site-button-grad-vs.gif); + color: #b6d1e4; + text-shadow: #3f3f3f 0 -1px 0; +} + +#wphead a:hover #site-visit-button { + color: #fff; +} + +#wphead a:focus #site-visit-button, +#wphead a:active #site-visit-button { + background-position: 0 -27px; +} + +.popular-tags, +.feature-filter { + background-color: #fff; + border-color: #dfdfdf; +} + +#theme-information .action-button { + border-top-color: #dfdfdf; +} + +.theme-listing br.line { + border-bottom-color: #ccc; +} + +div.widgets-sortables, +#widgets-left .inactive { + background-color: #f1f1f1; + border-color: #ddd; +} + +#available-widgets .widget-holder { + background-color: #fff; + border-color: #ddd; +} + +#widgets-left .sidebar-name { + background-color: #aaa; + background-image: url(../images/ed-bg-vs.gif); + text-shadow: #FFFFFF 0 1px 0; + border-color: #dfdfdf; +} + +#widgets-right .sidebar-name { + background-image: url(../images/fav-vs.png); + text-shadow: #3f3f3f 0 -1px 0; + background-color: #636363; + border-color: #636363; + color: #fff; +} + +.sidebar-name:hover, +#removing-widget { + color: #d54e21; +} + +#removing-widget span { + color: black; +} + +#widgets-left .sidebar-name-arrow { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px; +} + +#widgets-right .sidebar-name-arrow { + background: transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px; +} + +.in-widget-title { + color: #606060; +} + +.deleting .widget-title * { + color: #aaa; +} + +.imgedit-menu div { + border-color: #d5d5d5; + background-color: #f1f1f1; +} + +.imgedit-menu div:hover { + border-color: #c1c1c1; + background-color: #eaeaea; +} + +.imgedit-menu div.disabled { + border-color: #ccc; + background-color: #ddd; + filter: alpha(opacity=50); + opacity: 0.5; +} + +#dashboard_recent_comments div.undo { + border-top-color: #dfdfdf; +} + +.comment-ays, +.comment-ays th { + border-color: #ddd; +} + +.comment-ays th { + background-color: #f1f1f1; +} diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css index 7b73e98c..f9448c8d 100644 --- a/wp-admin/css/colors-fresh.css +++ b/wp-admin/css/colors-fresh.css @@ -1,1660 +1 @@ -html { - background-color: #f9f9f9; -} - -* html input, -* html .widget { - border-color: #dfdfdf; -} - -textarea, -input, -select { - border-color: #DFDFDF; -} - -kbd, -code { - background: #eaeaea; -} - -input[readonly] { - background-color: #eee; -} - -.find-box-search { - border-color: #dfdfdf; - background-color: #f1f1f1; -} - -.find-box { - background-color: #f1f1f1; -} - -.find-box-inside { - background-color: #fff; -} - -a.page-numbers:hover { - border-color: #999; -} - -body, -#wpbody, -.form-table .pre { - color: #333; -} - -body > #upload-menu { - border-bottom-color: #fff; -} - -#postcustomstuff table, -#your-profile fieldset, -#rightnow, -div.dashboard-widget, -#dashboard-widgets p.dashboard-widget-links, -#replyrow #ed_reply_toolbar input { - border-color: #ccc; -} - -#poststuff .inside label.spam { - color: red; -} - -#poststuff .inside label.waiting { - color: orange; -} - -#poststuff .inside label.approved { - color: green; -} - -#postcustomstuff table { - border-color: #dfdfdf; - background-color: #F9F9F9; -} - -#postcustomstuff thead th { - background-color: #F1F1F1; -} - -#postcustomstuff table input, -#postcustomstuff table textarea { - border-color: #dfdfdf; - background-color: #fff; -} - -.widefat { - border-color: #dfdfdf; - background-color: #fff; -} - -div.dashboard-widget-error { - background-color: #c43; -} - -div.dashboard-widget-notice { - background-color: #cfe1ef; -} - -div.dashboard-widget-submit { - border-top-color: #ccc; -} - -div.tabs-panel, -ul#category-tabs li.tabs { - border-color: #dfdfdf; -} - -ul#category-tabs li.tabs { - background-color: #f1f1f1; -} - -input.disabled, -textarea.disabled { - background-color: #ccc; -} -/* #upload-menu li a.upload-tab-link, */ -.login #backtoblog a:hover, -#plugin-information .action-button a, -#plugin-information .action-button a:hover, -#plugin-information .action-button a:visited { - color: #fff; -} - -.widget .widget-top, -.postbox h3, -.stuffbox h3 { - background: #dfdfdf url("../images/gray-grad.png") repeat-x left top; - text-shadow: #fff 0 1px 0; -} - -.form-table th, -.form-wrap label { - color: #222; - text-shadow: #fff 0 1px 0; -} - -.description, -.form-wrap p { - color: #666; -} - -strong .post-com-count span { - background-color: #21759b; -} - -.sorthelper { - background-color: #ccf3fa; -} - -.ac_match, -.subsubsub a.current { - color: #000; -} - -.wrap h2 { - color: #464646; -} - -.ac_over { - background-color: #f0f0b8; -} - -.ac_results { - background-color: #fff; - border-color: #808080; -} - -.ac_results li { - color: #101010; -} - -.alternate, -.alt { - background-color: #f9f9f9; -} - -.available-theme a.screenshot { - background-color: #f1f1f1; - border-color: #ddd; -} - -.bar { - background-color: #e8e8e8; - border-right-color: #99d; -} - -#media-upload { - background: #fff; -} - -#media-upload .slidetoggle { - border-top-color: #dfdfdf; -} - -.error, -#login #login_error { - background-color: #ffebe8; - border-color: #c00; -} - -.error a { - color: #c00; -} - -.form-invalid { - background-color: #ffebe8 !important; -} - -.form-invalid input { - border-color: #c00 !important; -} - -.submit { - border-color: #DFDFDF; -} - -.highlight { - background-color: #e4f2fd; - color: #d54e21; -} - -.howto, -.nonessential, -#edit-slug-box, -.form-input-tip, -.rss-widget span.rss-date, -.subsubsub { - color: #666; -} - -.media-item { - border-bottom-color: #dfdfdf; -} - -#wpbody-content #media-items .describe { - border-top-color: #dfdfdf; -} - -.describe input[type="text"], -.describe textarea { - border-color: #dfdfdf; -} - -.media-upload-form label.form-help, -td.help { - color: #9a9a9a; -} - -.post-com-count { - background-image: url(../images/bubble_bg.gif); - color: #fff; -} - -.post-com-count span { - background-color: #bbb; - color: #fff; -} - -.post-com-count:hover span { - background-color: #d54e21; -} - -.quicktags, .search { - background-color: #ccc; - color: #000; -} - -.side-info h5 { - border-bottom-color: #dadada; -} - -.side-info ul { - color: #666; -} - -.button, -.button-secondary, -.submit input, -input[type=button], -input[type=submit] { - border-color: #bbb; - color: #464646; -} - -.button:hover, -.button-secondary:hover, -.submit input:hover, -input[type=button]:hover, -input[type=submit]:hover { - color: #000; - border-color: #666; -} - -.button, -.submit input, -.button-secondary { - background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top; -} - -.button:active, -.submit input:active, -.button-secondary:active { - background: #eee url(../images/white-grad-active.png) repeat-x scroll left top; -} - -.button-primary, -.submit .button-primary, -#login form .submit input { - border-color: #298cba !important; - font-weight: bold; - color: #FFF !important; - background: #21759B url(../images/button-grad.png) repeat-x scroll left top; -} - -.button-primary:active, -#login form .submit input:active { - background: #21759b url(../images/button-grad-active.png) repeat-x scroll left top !important; -} - -.button[disabled], -.button:disabled, -.button-secondary[disabled], -.button-secondary:disabled, -a.button.disabled { - color: #ccc !important; - border-color: #ccc; -} - -.button-primary[disabled], -.button-primary:disabled { - color: #2fa0d5 !important; -} - -a:active, -a:focus { - color: #d54e21; -} - -a:hover, -#wphead #viewsite a:hover, -#adminmenu a:hover, -#adminmenu ul.wp-submenu a:hover, -#the-comment-list .comment a:hover, -#rightnow a:hover, -#login form .submit input:hover, -#media-upload a.del-link:hover, -div.dashboard-widget-submit input:hover, -.subsubsub a:hover, -.subsubsub a.current:hover, -.ui-tabs-nav a:hover, -.plugins .inactive a:hover, -#all-plugins-table .plugins .inactive a:hover, -#search-plugins-table .plugins .inactive a:hover { - color: #d54e21; -} - -#the-comment-list .comment-item, -#dashboard-widgets #dashboard_quick_press form p.submit { - border-color: #dfdfdf; -} - -.button-primary:hover, -#login form .submit input:hover { - border-color: #13455b !important; - color: #EAF2FA !important; -} - -#side-sortables #category-tabs .tabs a { - color: #333; -} - -#rightnow .rbutton { - background-color: #ebebeb; - color: #264761; -} - -.submitbox .submit { - background-color: #464646; - color: #ccc; -} - -.plugins a.delete:hover, -#all-plugins-table .plugins a.delete:hover, -#search-plugins-table .plugins a.delete:hover, -.submitbox .submitdelete, -a.delete { - color: #f00; - border-bottom-color: #f00; -} - -.submitbox .submitdelete:hover, -#media-items a.delete:hover { - color: #fff; - background-color: #f00; - border-bottom-color: #f00; -} - -#normal-sortables .submitbox .submitdelete:hover { - color: #000; - background-color: #f00; - border-bottom-color: #f00; -} - -.tablenav .dots { - border-color: transparent; -} - -.tablenav .next, -.tablenav .prev { - border-color: transparent; - color: #21759b; -} - -.tablenav .next:hover, -.tablenav .prev:hover { - border-color: transparent; - color: #d54e21; -} - -.updated, -.login #login_error, -.login .message { - background-color: #ffffe0; - border-color: #e6db55; -} - -.update-message { - color: #000000; -} - -a.page-numbers { - border-bottom-color: #B8D3E2; -} - -.commentlist li { - border-bottom-color: #ccc; -} - -.widefat td, -.widefat th, -#install-plugins .plugins td, -#install-plugins .plugins th { - border-color: #dfdfdf; -} - -.widefat th { - text-shadow: rgba(255,255,255,0.8) 0 1px 0; -} - -.widefat thead tr th, -.widefat tfoot tr th, -h3.dashboard-widget-title, -h3.dashboard-widget-title span, -h3.dashboard-widget-title small, -.find-box-head { - color: #333; - background: #dfdfdf url(../images/gray-grad.png) repeat-x scroll left top; -} - -h3.dashboard-widget-title small a { - color: #d7d7d7; -} - -h3.dashboard-widget-title small a:hover { - color: #fff; -} - -a, -#adminmenu a, -#poststuff #edButtonPreview, -#poststuff #edButtonHTML, -#the-comment-list p.comment-author strong a, -#media-upload a.del-link, -#media-items a.delete, -.plugins a.delete, -.ui-tabs-nav a { - color: #21759b; -} - -/* Because we don't want visited on these links */ -body.press-this .tabs a, -body.press-this .tabs a:hover { - background-color: #fff; - border-color: #c6d9e9; - border-bottom-color: #fff; - color: #d54e21; -} - -#adminmenu #awaiting-mod, -#adminmenu .update-plugins, -#sidemenu a .update-plugins, -#rightnow .reallynow, -#plugin-information .action-button { - background-color: #d54e21; - color: #fff; -} - -#adminmenu li a:hover #awaiting-mod, -#adminmenu li a:hover .update-plugins, -#sidemenu li a:hover .update-plugins { - background-color: #264761; - color: #fff; -} - -#adminmenu li.current a #awaiting-mod, -#adminmenu li.current a .update-plugins, -#adminmenu li.wp-has-current-submenu a .update-plugins, -#adminmenu li.wp-has-current-submenu a .update-plugins { - background-color: #ddd; - color: #000; - text-shadow: none; - -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - box-shadow: rgba(0,0,0,0.2) 0 -1px 0; -} - -#adminmenu li.current a:hover #awaiting-mod, -#adminmenu li.current a:hover .update-plugins, -#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod, -#adminmenu li.wp-has-current-submenu a:hover .update-plugins { - background-color: #264761; - color: #fff; -} - -div#media-upload-header, -div#plugin-information-header { - background-color: #f9f9f9; - border-bottom-color: #dfdfdf; -} - -#currenttheme img { - border-color: #666; -} - -#dashboard_secondary div.dashboard-widget-content ul li a { - background-color: #f9f9f9; -} - -input.readonly, textarea.readonly { - background-color: #ddd; -} - -#ed_toolbar input, -#ed_reply_toolbar input { - background: #fff url("../images/fade-butt.png") repeat-x 0 -2px; -} - -#editable-post-name { - background-color: #fffbcc; -} - -#edit-slug-box strong, -.tablenav .displaying-num, -#submitted-on { - color: #777; -} - -.login #nav a { - color: #21759b !important; -} - -.login #nav a:hover { - color: #d54e21 !important; -} - -#footer, -#footer-upgrade { - background: #464646; - color: #999; -} - -#media-items { - border-color: #dfdfdf; -} - -.checkbox, -.side-info, -.plugins tr, -#your-profile #rich_editing { - background-color: #fff; -} - -.plugins .inactive, -.plugins .inactive th, -.plugins .inactive td, -tr.inactive + tr.plugin-update-tr .plugin-update { - background-color: #eee; -} - -.plugin-update-tr .update-message { - background-color: #fffbe4; - border-color: #dfdfdf; -} - -.plugins .active, -.plugins .active th, -.plugins .active td { - color: #000; -} - -.plugins .inactive a { - color: #557799; -} - -#the-comment-list .unapproved, -#the-comment-list .unapproved th, -#the-comment-list .unapproved td { - background-color: #ffffe0; -} - -#the-comment-list .approve a { - color: #006505; -} - -#the-comment-list .unapprove a { - color: #d98500; -} - -#the-comment-list .delete a { - color: #bc0b0b; -} - -.widget, -#widget-list .widget-top, -.postbox, -#titlediv, -#poststuff .postarea, -.stuffbox { - border-color: #dfdfdf; -} - -.widget, -.postbox { - background-color: #fff; -} - -.ui-sortable .postbox h3 { - color: #464646; -} - -.widget .widget-top, -.ui-sortable .postbox h3:hover { - color: #000; -} - -.curtime #timestamp { - background-image: url(../images/date-button.gif); -} - -#quicktags #ed_link { - color: #00f; -} - -#rightnow .youhave { - background-color: #f0f6fb; -} - -#rightnow a { - color: #448abd; -} - -.tagchecklist span a, -#bulk-titles div a { - background: url(../images/xit.gif) no-repeat; -} - -.tagchecklist span a:hover, -#bulk-titles div a:hover { - background: url(../images/xit.gif) no-repeat -10px 0; -} - -#update-nag { - background-color: #fffeeb; - border-color: #ccc; - color: #555; -} - -.login #backtoblog a { - color: #ccc; -} - -#wphead { - background-color: #464646; -} - -body.login { - border-top-color: #464646; -} - -#wphead h1 a { - color: #fff; -} - -#login form input { - color: #555; -} - -#user_info { - color: #999; -} - -#user_info a:link, -#user_info a:visited, -#footer a:link, -#footer a:visited { - color: #ccc; - text-decoration: none; -} - -#user_info a:hover, -#footer a:hover { - color: #fff; - text-decoration: underline !important; -} - -#user_info a:active, -#footer a:active { - color: #ccc !important; -} - -div#media-upload-error, -.file-error, -abbr.required, -.widget-control-remove:hover, -.delete a:hover { - color: #f00; -} - -#pass-strength-result { - background-color: #eee; - border-color: #ddd !important; -} - -#pass-strength-result.bad { - background-color: #ffb78c; - border-color: #ff853c !important; -} - -#pass-strength-result.good { - background-color: #ffec8b; - border-color: #fc0 !important; -} - -#pass-strength-result.short { - background-color: #ffa0a0; - border-color: #f04040 !important; -} - -#pass-strength-result.strong { - background-color: #c3ff88; - border-color: #8dff1c !important; -} - -/* editors */ -#quicktags { - border-color: #dfdfdf; - background-color: #dfdfdf; -} - -#ed_toolbar input { - border-color: #C3C3C3; -} - -#ed_toolbar input:hover { - border-color: #aaa; - background: #ddd; -} - -#poststuff .wp_themeSkin .mceStatusbar { - border-color: #EDEDED; -} - -#poststuff #edButtonPreview, -#poststuff #edButtonHTML { - background-color: #f1f1f1; - border-color: #dfdfdf; - color: #999; -} - -#poststuff #editor-toolbar .active { - border-bottom-color: #e9e9e9; - background-color: #e9e9e9; - color: #333; -} - -/* TinyMCE */ -#post-status-info { - background-color: #EDEDED; -} - -.wp_themeSkin *, -.wp_themeSkin a:hover, -.wp_themeSkin a:link, -.wp_themeSkin a:visited, -.wp_themeSkin a:active { - color: #000; -} - -/* Containers */ -.wp_themeSkin iframe { - background: #fff; -} - -/* Layout */ -.wp_themeSkin .mceStatusbar { - color: #000; - background-color: #f5f5f5; -} - -/* Button */ -.wp_themeSkin .mceButton { - background-color: #e9e8e8; - border-color: #B2B2B2; -} - -.wp_themeSkin a.mceButtonEnabled:hover, -.wp_themeSkin a.mceButtonActive, -.wp_themeSkin a.mceButtonSelected { - background-color: #d5d5d5; - border-color: #777 !important; -} - -.wp_themeSkin .mceButtonDisabled { - border-color: #ccc !important; -} - -/* ListBox */ -.wp_themeSkin .mceListBox .mceText, -.wp_themeSkin .mceListBox .mceOpen { - border-color: #B2B2B2; - background-color: #d5d5d5; -} - -.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, -.wp_themeSkin .mceListBoxHover .mceOpen, -.wp_themeSkin .mceListBoxSelected .mceOpen, -.wp_themeSkin .mceListBoxSelected .mceText { - border-color: #777 !important; - background-color: #d5d5d5; -} - -.wp_themeSkin table.mceListBoxEnabled:hover .mceText, -.wp_themeSkin .mceListBoxHover .mceText { - border-color: #777 !important; -} - -.wp_themeSkin select.mceListBox { - border-color: #B2B2B2; - background-color: #fff; -} - -/* SplitButton */ -.wp_themeSkin .mceSplitButton a.mceAction, -.wp_themeSkin .mceSplitButton a.mceOpen { - border-color: #B2B2B2; -} - -.wp_themeSkin .mceSplitButton a.mceOpen:hover, -.wp_themeSkin .mceSplitButtonSelected a.mceOpen, -.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction, -.wp_themeSkin .mceSplitButton a.mceAction:hover { - background-color: #d5d5d5; - border-color: #777 !important; -} - -.wp_themeSkin .mceSplitButtonActive { - background-color: #B2B2B2; -} - -/* ColorSplitButton */ -.wp_themeSkin div.mceColorSplitMenu table { - background-color: #ebebeb; - border-color: #B2B2B2; -} - -.wp_themeSkin .mceColorSplitMenu a { - border-color: #B2B2B2; -} - -.wp_themeSkin .mceColorSplitMenu a.mceMoreColors { - border-color: #fff; -} - -.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover { - border-color: #0A246A; - background-color: #B6BDD2; -} - -.wp_themeSkin a.mceMoreColors:hover { - border-color: #0A246A; -} - -/* Menu */ -.wp_themeSkin .mceMenu { - border-color: #ddd; -} - -.wp_themeSkin .mceMenu table { - background-color: #ebeaeb; -} - -.wp_themeSkin .mceMenu .mceText { - color: #000; -} - -.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover, -.wp_themeSkin .mceMenu .mceMenuItemActive { - background-color: #f5f5f5; -} -.wp_themeSkin td.mceMenuItemSeparator { - background-color: #aaa; -} -.wp_themeSkin .mceMenuItemTitle a { - background-color: #ccc; - border-bottom-color: #aaa; -} -.wp_themeSkin .mceMenuItemTitle span.mceText { - color: #000; -} -.wp_themeSkin .mceMenuItemDisabled .mceText { - color: #888; -} - -.wp_themeSkin tr.mceFirst td.mceToolbar { - background: #dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top; - border-color: #dfdfdf; -} - -.wp-admin #mceModalBlocker { - background: #000; -} - -.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft { - background: #444444; - border-left: 1px solid #999; - border-top: 1px solid #999; - -moz-border-radius: 4px 0 0 0; - -webkit-border-top-left-radius: 4px; - -khtml-border-top-left-radius: 4px; - border-top-left-radius: 4px; -} - -.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight { - background: #444444; - border-right: 1px solid #999; - border-top: 1px solid #999; - border-top-right-radius: 4px; - -khtml-border-top-right-radius: 4px; - -webkit-border-top-right-radius: 4px; - -moz-border-radius: 0 4px 0 0; -} - -.wp-admin .clearlooks2 .mceMiddle .mceLeft { - background: #f1f1f1; - border-left: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceMiddle .mceRight { - background: #f1f1f1; - border-right: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom { - background: #f1f1f1; - border-bottom: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom .mceLeft { - background: #f1f1f1; - border-bottom: 1px solid #999; - border-left: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom .mceCenter { - background: #f1f1f1; - border-bottom: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceBottom .mceRight { - background: #f1f1f1; - border-bottom: 1px solid #999; - border-right: 1px solid #999; -} - -.wp-admin .clearlooks2 .mceFocus .mceTop span { - color: #e5e5e5; -} -/* end TinyMCE */ - -#editorcontainer, -#post-status-info, -#titlediv #title, -.editwidget .widget-inside { - border-color: #dfdfdf; -} - -#titlediv #title { - background-color: #fff; -} - -#tTips p#tTips_inside { - background-color: #ddd; - color: #333; -} - -#timestampdiv input, -#namediv input, -#poststuff .inside .the-tagcloud { - border-color: #ddd; -} - -/* menu */ -#adminmenu * { - border-color: #e3e3e3; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; -} - -#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, -#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -207px; -} - -#adminmenu .wp-has-submenu:hover .wp-menu-toggle, -#adminmenu .wp-menu-open .wp-menu-toggle { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px; -} - -#adminmenu a.menu-top { - background: #f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px; -} - -#adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px; -} - -#adminmenu .wp-has-current-submenu ul li a { - background: none; -} - -#adminmenu .wp-has-current-submenu ul li a.current { - background: url(../images/menu-dark.gif) top left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, -#adminmenu .menu-top .current { - background: #6d6d6d url(../images/menu-bits.gif) top left repeat-x; - border-color: #6d6d6d; - color: #fff; - text-shadow: rgba(0,0,0,0.4) 0px -1px 0px; -} - -#adminmenu li.wp-has-current-submenu .wp-submenu, -#adminmenu li.wp-has-current-submenu ul li a { - border-color: #aaa !important; -} - -#adminmenu li.wp-has-current-submenu ul li a { - background: url(../images/menu-dark.gif) bottom left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu ul { - border-bottom-color: #aaa; -} - -#adminmenu li.menu-top .current:hover { - border-color: #B5B5B5; -} - -#adminmenu .wp-submenu .current a.current { - background: transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px; -} - -#adminmenu .wp-submenu a:hover { - background-color: #EAF2FA !important; - color: #333 !important; -} - -#adminmenu .wp-submenu li.current, -#adminmenu .wp-submenu li.current a, -#adminmenu .wp-submenu li.current a:hover { - color: #333; - background-color: #f5f5f5; - background-image: none; - border-color: #e3e3e3; - text-shadow: rgba(255,255,255,1) 0px 1px 0px; -} - -#adminmenu .wp-submenu ul { - background-color: #fff; -} - -.folded #adminmenu li.menu-top, -#adminmenu .wp-submenu .wp-submenu-head { - background-color: #F1F1F1; -} - -.folded #adminmenu li.wp-has-current-submenu, -.folded #adminmenu li.menu-top.current { - background-color: #e6e6e6; -} - -#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { - background-color: #EAEAEA; - border-color: #aaa; -} - -#adminmenu div.wp-submenu { - background-color: transparent; -} - -/* menu icons */ -#adminmenu #menu-dashboard div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -61px -33px; -} - -#adminmenu #menu-dashboard:hover div.wp-menu-image, -#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-dashboard.current div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -61px -1px; -} - -#adminmenu #menu-posts div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -272px -33px; -} - -#adminmenu #menu-posts:hover div.wp-menu-image, -#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -272px -1px; -} - -#adminmenu #menu-media div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -121px -33px; -} - -#adminmenu #menu-media:hover div.wp-menu-image, -#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -121px -1px; -} - -#adminmenu #menu-links div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -91px -33px; -} - -#adminmenu #menu-links:hover div.wp-menu-image, -#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -91px -1px; -} - -#adminmenu #menu-pages div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -151px -33px; -} - -#adminmenu #menu-pages:hover div.wp-menu-image, -#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -151px -1px; -} - -#adminmenu #menu-comments div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -31px -33px; -} - -#adminmenu #menu-comments:hover div.wp-menu-image, -#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-comments.current div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -31px -1px; -} - -#adminmenu #menu-appearance div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -1px -33px; -} - -#adminmenu #menu-appearance:hover div.wp-menu-image, -#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -1px -1px; -} - -#adminmenu #menu-plugins div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -181px -33px; -} - -#adminmenu #menu-plugins:hover div.wp-menu-image, -#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -181px -1px; -} - -#adminmenu #menu-users div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -301px -33px; -} - -#adminmenu #menu-users:hover div.wp-menu-image, -#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -301px -1px; -} - -#adminmenu #menu-tools div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -211px -33px; -} - -#adminmenu #menu-tools:hover div.wp-menu-image, -#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -211px -1px; -} - -#adminmenu #menu-settings div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -241px -33px; -} - -#adminmenu #menu-settings:hover div.wp-menu-image, -#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -241px -1px; -} -/* end menu */ - - -/* Diff */ -table.diff .diff-deletedline { - background-color: #ffdddd; -} - -table.diff .diff-deletedline del { - background-color: #ff9999; -} - -table.diff .diff-addedline { - background-color: #ddffdd; -} - -table.diff .diff-addedline ins { - background-color: #99ff99; -} - -#att-info { - background-color: #E4F2FD; -} - -/* edit image */ -#sidemenu a { - background-color: #f9f9f9; - border-color: #f9f9f9; - border-bottom-color: #dfdfdf; -} - -#sidemenu a.current { - background-color: #fff; - border-color: #dfdfdf #dfdfdf #fff; - color: #D54E21; -} - -#screen-options-wrap, -#contextual-help-wrap { - background-color: #f1f1f1; - border-color: #dfdfdf; -} - -#screen-meta-links a.show-settings { - color: #606060; -} - -#screen-meta-links a.show-settings:hover { - color: #000; -} - -#replysubmit { - background-color: #f1f1f1; - border-top-color: #ddd; -} - -#replyerror { - border-color: #ddd; - background-color: #f9f9f9; -} - -#edithead, -#replyhead { - background-color: #f1f1f1; -} - -#ed_reply_toolbar { - background-color: #e9e9e9; -} - -/* table vim shortcuts */ -.vim-current, -.vim-current th, -.vim-current td { - background-color: #E4F2FD !important; -} - -/* Install Plugins */ -.star-average, -.star.star-rating { - background-color: #fc0; -} - -div.star.select:hover { - background-color: #d00; -} - -#plugin-information .fyi ul { - background-color: #eaf3fa; -} - -#plugin-information .fyi h2.mainheader { - background-color: #cee1ef; -} - -#plugin-information pre, -#plugin-information code { - background-color: #ededff; -} - -#plugin-information pre { - border: 1px solid #ccc; -} - -/* inline editor */ -.inline-edit-row fieldset input[type="text"], -.inline-edit-row fieldset textarea, -#bulk-titles, -#replyrow input { - border-color: #ddd; -} - -.inline-editor div.title { - background-color: #EAF3FA; -} - -.inline-editor ul.cat-checklist { - background-color: #FFFFFF; - border-color: #ddd; -} - -.inline-editor .categories .catshow, -.inline-editor .categories .cathide { - color: #21759b; -} - -.inline-editor .quick-edit-save { - background-color: #f1f1f1; -} - -#replyrow #ed_reply_toolbar input:hover { - border-color: #aaa; - background: #ddd; -} - -fieldset.inline-edit-col-right .inline-edit-col { - border-color: #dfdfdf; -} - -.attention { - color: #D54E21; -} - -.meta-box-sortables .postbox:hover .handlediv { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px; -} - -#major-publishing-actions { - background: #eaf2fa; -} - -.tablenav .tablenav-pages { - color: #555; -} - -.tablenav .tablenav-pages a { - border-color: #e3e3e3; - background: #eee url('../images/menu-bits.gif') repeat-x scroll left -379px; -} - -.tablenav .tablenav-pages a:hover { - color: #d54e21; - border-color: #d54321; -} - -.tablenav .tablenav-pages a:active { - color: #fff !important; -} - -.tablenav .tablenav-pages .current { - background: #dfdfdf; - border-color: #d3d3d3; -} - -#availablethemes, -#availablethemes td { - border-color: #ddd; -} - -#current-theme img { - border-color: #999; -} - -#TB_window #TB_title a.tb-theme-preview-link, -#TB_window #TB_title a.tb-theme-preview-link:visited { - color: #999; -} - -#TB_window #TB_title a.tb-theme-preview-link:hover, -#TB_window #TB_title a.tb-theme-preview-link:focus { - color: #ccc; -} - -.misc-pub-section { - border-bottom-color: #eee; -} - -#minor-publishing { - border-bottom-color: #ddd; -} - -#post-body .misc-pub-section { - border-right-color: #eee; -} - -.post-com-count span { - background-color: #bbb; -} - -.form-table .color-palette td { - border-color: #fff; -} - -.sortable-placeholder { - border-color: #bbb; - background-color: #f5f5f5; -} - -#post-body ul#category-tabs li.tabs a { - color: #333; -} - -#wp_editimgbtn, -#wp_delimgbtn, -#wp_editgallery, -#wp_delgallery { - border-color: #999; - background-color: #eee; -} - -#wp_editimgbtn:hover, -#wp_delimgbtn:hover, -#wp_editgallery:hover, -#wp_delgallery:hover { - border-color: #555; - background-color: #ccc; -} - -#favorite-first { - background: #797979 url(../images/fav.png) repeat-x left center; - border-color: #777 !important; - border-bottom-color: #666 !important; -} - -#favorite-inside { - border-color: #797979; - background-color: #797979; -} - -#favorite-toggle { - background: transparent url(../images/fav-arrow.gif) no-repeat 0 -4px; -} - -#favorite-actions a { - color: #ddd; -} - -#favorite-actions a:hover { - color: #fff; -} - -#favorite-inside a:hover { - text-decoration: underline; -} - -#favorite-actions .slide-down { - border-bottom-color: #626262; -} - -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - text-shadow: rgba(255,255,255,1) 0 1px 0; -} - -.button-primary, -.submit .button-primary { - text-shadow: rgba(0,0,0,0.3) 0 -1px 0; -} - -#screen-meta a.show-settings { - background-color: transparent; - text-shadow: rgba(255,255,255,0.7) 0 1px 0; -} - -#icon-edit, -#icon-post { - background: transparent url(../images/icons32.png) no-repeat -552px -5px; -} - -#icon-index { - background: transparent url(../images/icons32.png) no-repeat -137px -5px; -} - -#icon-upload { - background: transparent url(../images/icons32.png) no-repeat -251px -5px; -} - -#icon-link-manager, -#icon-link, -#icon-link-category { - background: transparent url(../images/icons32.png) no-repeat -190px -5px; -} - -#icon-edit-pages, -#icon-page { - background: transparent url(../images/icons32.png) no-repeat -312px -5px; -} - -#icon-edit-comments { - background: transparent url(../images/icons32.png) no-repeat -72px -5px; -} - -#icon-themes { - background: transparent url(../images/icons32.png) no-repeat -11px -5px; -} - -#icon-plugins { - background: transparent url(../images/icons32.png) no-repeat -370px -5px; -} - -#icon-users, -#icon-profile, -#icon-user-edit { - background: transparent url(../images/icons32.png) no-repeat -600px -5px; -} - -#icon-tools, -#icon-admin { - background: transparent url(../images/icons32.png) no-repeat -432px -5px; -} - -#icon-options-general { - background: transparent url(../images/icons32.png) no-repeat -492px -5px; -} - -.view-switch #view-switch-list { - background: transparent url(../images/list.png) no-repeat 0 0; -} - -.view-switch #view-switch-list.current { - background: transparent url(../images/list.png) no-repeat -40px 0; -} - -.view-switch #view-switch-excerpt { - background: transparent url(../images/list.png) no-repeat -20px 0; -} - -.view-switch #view-switch-excerpt.current { - background: transparent url(../images/list.png) no-repeat -60px 0; -} - -#header-logo { - background: transparent url(../images/wp-logo.gif) no-repeat scroll center center; -} - -#wphead #site-visit-button { - background-color:#585858; - background-image: url(../images/visit-site-button-grad.gif); - color:#aaa; - text-shadow: #3F3F3F 0 -1px 0; -} - -#wphead a:hover #site-visit-button { - color:#fff; -} - -#wphead a:focus #site-visit-button, -#wphead a:active #site-visit-button { - background-position:0 -27px; -} - -.popular-tags, -.feature-filter { - background-color: #FFFFFF; - border-color: #DFDFDF; -} - -#theme-information .action-button { - border-top-color: #DFDFDF; -} - -.theme-listing br.line { - border-bottom-color: #ccc; -} - -div.widgets-sortables, -#widgets-left .inactive { - background-color: #f1f1f1; - border-color: #ddd; -} - -#available-widgets .widget-holder { - background-color: #fff; - border-color: #ddd; -} - -#widgets-left .sidebar-name { - background-color: #aaa; - background-image: url(../images/ed-bg.gif); - text-shadow: #FFFFFF 0 1px 0; - border-color: #dfdfdf; -} - -#widgets-right .sidebar-name { - background-image: url(../images/fav.png); - text-shadow: #3f3f3f 0 -1px 0; - background-color: #636363; - border-color: #636363; - color: #fff; -} - -.sidebar-name:hover, -#removing-widget { - color: #d54e21; -} - -#removing-widget span { - color: black; -} - -#widgets-left .sidebar-name-arrow { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px; -} - -#widgets-right .sidebar-name-arrow { - background: transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px; -} - -.in-widget-title { - color: #606060; -} - -.deleting .widget-title * { - color: #aaa; -} +html{background-color:#f9f9f9;}* html input,* html .widget{border-color:#dfdfdf;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#F9F9F9;}#postcustomstuff thead th{background-color:#F1F1F1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul#category-tabs li.tabs{border-color:#dfdfdf;}ul#category-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}.login #backtoblog a:hover,#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#dfdfdf url("../images/gray-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#464646;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#f9f9f9;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#DFDFDF;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#bbb;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#298cba;font-weight:bold;color:#fff;background:#21759B url(../images/button-grad.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#13455b;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#9FD0D5!important;background:#298CBA!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables #category-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#B8D3E2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#21759b;}body.press-this .tabs a,body.press-this .tabs a:hover{background-color:#fff;border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow,#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li a:hover #awaiting-mod,#adminmenu li a:hover .update-plugins,#sidemenu li a:hover .update-plugins{background-color:#264761;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li.current a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins{background-color:#ddd;color:#000;text-shadow:none;-moz-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-khtml-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-webkit-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;box-shadow:rgba(0,0,0,0.2) 0 -1px 0;}#adminmenu li.current a:hover #awaiting-mod,#adminmenu li.current a:hover .update-plugins,#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,#adminmenu li.wp-has-current-submenu a:hover .update-plugins{background-color:#264761;color:#fff;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer,#footer-upgrade{background:#464646;color:#999;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#eee;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#464646;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag{background-color:#fffeeb;border-color:#ccc;color:#555;}.login #backtoblog a{color:#ccc;}#wphead{background-color:#464646;}body.login{border-top-color:#464646;}#wphead h1 a{color:#fff;}#user_info{color:#999;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#ccc;text-decoration:none;}#user_info a:hover,#footer a:hover{color:#fff;text-decoration:underline!important;}#user_info a:active,#footer a:active{color:#ccc!important;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#C3C3C3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#EDEDED;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f1f1f1;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e9e9e9;background-color:#e9e9e9;color:#333;}#post-status-info{background-color:#EDEDED;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#B2B2B2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#B2B2B2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#B2B2B2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#B2B2B2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#B2B2B2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0A246A;background-color:#B6BDD2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0A246A;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}.wp_themeSkin tr.mceFirst td.mceToolbar{background:#dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#ddd;}#adminmenu *{border-color:#e3e3e3;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#FFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:#6d6d6d url(../images/menu-bits.gif) top left repeat-x;border-color:#6d6d6d;color:#fff;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu li.menu-top .current:hover{border-color:#B5B5B5;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#EAF2FA!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;text-shadow:rgba(255,255,255,1) 0 1px 0;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#F1F1F1;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#e6e6e6;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#EAEAEA;border-color:#aaa;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu #menu-dashboard div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -61px -33px;}#adminmenu #menu-dashboard:hover div.wp-menu-image,#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-dashboard.current div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -61px -1px;}#adminmenu #menu-posts div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -272px -33px;}#adminmenu #menu-posts:hover div.wp-menu-image,#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -272px -1px;}#adminmenu #menu-media div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -121px -33px;}#adminmenu #menu-media:hover div.wp-menu-image,#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -121px -1px;}#adminmenu #menu-links div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -91px -33px;}#adminmenu #menu-links:hover div.wp-menu-image,#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -91px -1px;}#adminmenu #menu-pages div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -151px -33px;}#adminmenu #menu-pages:hover div.wp-menu-image,#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -151px -1px;}#adminmenu #menu-comments div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -31px -33px;}#adminmenu #menu-comments:hover div.wp-menu-image,#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-comments.current div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -31px -1px;}#adminmenu #menu-appearance div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -1px -33px;}#adminmenu #menu-appearance:hover div.wp-menu-image,#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -1px -1px;}#adminmenu #menu-plugins div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -181px -33px;}#adminmenu #menu-plugins:hover div.wp-menu-image,#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -181px -1px;}#adminmenu #menu-users div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -301px -33px;}#adminmenu #menu-users:hover div.wp-menu-image,#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -301px -1px;}#adminmenu #menu-tools div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -211px -33px;}#adminmenu #menu-tools:hover div.wp-menu-image,#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -211px -1px;}#adminmenu #menu-settings div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -241px -33px;}#adminmenu #menu-settings:hover div.wp-menu-image,#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -241px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#E4F2FD;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#D54E21;}#screen-options-wrap,#contextual-help-wrap{background-color:#f1f1f1;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#E4F2FD!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#EAF3FA;}.inline-editor ul.cat-checklist{background-color:#FFF;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#D54E21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits.gif') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul#category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{background:#797979 url(../images/fav.png) repeat-x left center;border-color:#777!important;border-bottom-color:#666!important;}#favorite-inside{border-color:#797979;background-color:#797979;}#favorite-toggle{background:transparent url(../images/fav-arrow.gif) no-repeat 0 -4px;}#favorite-actions a{color:#ddd;}#favorite-actions a:hover{color:#fff;}#favorite-inside a:hover{text-decoration:underline;}#favorite-actions .slide-down{border-bottom-color:#626262;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32.png) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32.png) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32.png) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32.png) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32.png) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32.png) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32.png) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32.png) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32.png) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32.png) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32.png) no-repeat -492px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo.gif) no-repeat scroll center center;}#wphead #site-visit-button{background-color:#585858;background-image:url(../images/visit-site-button-grad.gif);color:#aaa;text-shadow:#3F3F3F 0 -1px 0;}#wphead a:hover #site-visit-button{color:#fff;}#wphead a:focus #site-visit-button,#wphead a:active #site-visit-button{background-position:0 -27px;}.popular-tags,.feature-filter{background-color:#FFF;border-color:#DFDFDF;}#theme-information .action-button{border-top-color:#DFDFDF;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg.gif);text-shadow:#FFF 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;} \ No newline at end of file diff --git a/wp-admin/css/colors-fresh.dev.css b/wp-admin/css/colors-fresh.dev.css new file mode 100644 index 00000000..41a86aed --- /dev/null +++ b/wp-admin/css/colors-fresh.dev.css @@ -0,0 +1,1697 @@ +html { + background-color: #f9f9f9; +} + +* html input, +* html .widget { + border-color: #dfdfdf; +} + +textarea, +input[type="text"], +input[type="password"], +input[type="file"], +input[type="button"], +input[type="submit"], +input[type="reset"], +select { + border-color: #dfdfdf; + background-color: #fff; +} + +kbd, +code { + background: #eaeaea; +} + +input[readonly] { + background-color: #eee; +} + +.find-box-search { + border-color: #dfdfdf; + background-color: #f1f1f1; +} + +.find-box { + background-color: #f1f1f1; +} + +.find-box-inside { + background-color: #fff; +} + +a.page-numbers:hover { + border-color: #999; +} + +body, +#wpbody, +.form-table .pre { + color: #333; +} + +body > #upload-menu { + border-bottom-color: #fff; +} + +#postcustomstuff table, +#your-profile fieldset, +#rightnow, +div.dashboard-widget, +#dashboard-widgets p.dashboard-widget-links, +#replyrow #ed_reply_toolbar input { + border-color: #ccc; +} + +#poststuff .inside label.spam, +#poststuff .inside label.deleted { + color: red; +} + +#poststuff .inside label.waiting { + color: orange; +} + +#poststuff .inside label.approved { + color: green; +} + +#postcustomstuff table { + border-color: #dfdfdf; + background-color: #F9F9F9; +} + +#postcustomstuff thead th { + background-color: #F1F1F1; +} + +#postcustomstuff table input, +#postcustomstuff table textarea { + border-color: #dfdfdf; + background-color: #fff; +} + +.widefat { + border-color: #dfdfdf; + background-color: #fff; +} + +div.dashboard-widget-error { + background-color: #c43; +} + +div.dashboard-widget-notice { + background-color: #cfe1ef; +} + +div.dashboard-widget-submit { + border-top-color: #ccc; +} + +div.tabs-panel, +ul#category-tabs li.tabs { + border-color: #dfdfdf; +} + +ul#category-tabs li.tabs { + background-color: #f1f1f1; +} + +input.disabled, +textarea.disabled { + background-color: #ccc; +} +/* #upload-menu li a.upload-tab-link, */ +.login #backtoblog a:hover, +#plugin-information .action-button a, +#plugin-information .action-button a:hover, +#plugin-information .action-button a:visited { + color: #fff; +} + +.widget .widget-top, +.postbox h3, +.stuffbox h3 { + background: #dfdfdf url("../images/gray-grad.png") repeat-x left top; + text-shadow: #fff 0 1px 0; +} + +.form-table th, +.form-wrap label { + color: #222; + text-shadow: #fff 0 1px 0; +} + +.description, +.form-wrap p { + color: #666; +} + +strong .post-com-count span { + background-color: #21759b; +} + +.sorthelper { + background-color: #ccf3fa; +} + +.ac_match, +.subsubsub a.current { + color: #000; +} + +.wrap h2 { + color: #464646; +} + +.ac_over { + background-color: #f0f0b8; +} + +.ac_results { + background-color: #fff; + border-color: #808080; +} + +.ac_results li { + color: #101010; +} + +.alternate, +.alt { + background-color: #f9f9f9; +} + +.available-theme a.screenshot { + background-color: #f1f1f1; + border-color: #ddd; +} + +.bar { + background-color: #e8e8e8; + border-right-color: #99d; +} + +#media-upload, +#media-upload .media-item .slidetoggle { + background: #fff; +} + +#media-upload .slidetoggle { + border-top-color: #dfdfdf; +} + +.error, +.login #login_error { + background-color: #ffebe8; + border-color: #c00; +} + +.error a { + color: #c00; +} + +.form-invalid { + background-color: #ffebe8 !important; +} + +.form-invalid input, +.form-invalid select { + border-color: #c00 !important; +} + +.submit { + border-color: #DFDFDF; +} + +.highlight { + background-color: #e4f2fd; + color: #d54e21; +} + +.howto, +.nonessential, +#edit-slug-box, +.form-input-tip, +.rss-widget span.rss-date, +.subsubsub { + color: #666; +} + +.media-item { + border-bottom-color: #dfdfdf; +} + +#wpbody-content #media-items .describe { + border-top-color: #dfdfdf; +} + +.media-upload-form label.form-help, +td.help { + color: #9a9a9a; +} + +.post-com-count { + background-image: url(../images/bubble_bg.gif); + color: #fff; +} + +.post-com-count span { + background-color: #bbb; + color: #fff; +} + +.post-com-count:hover span { + background-color: #d54e21; +} + +.quicktags, .search { + background-color: #ccc; + color: #000; +} + +.side-info h5 { + border-bottom-color: #dadada; +} + +.side-info ul { + color: #666; +} + +.button, +.button-secondary, +.submit input, +input[type=button], +input[type=submit] { + border-color: #bbb; + color: #464646; +} + +.button:hover, +.button-secondary:hover, +.submit input:hover, +input[type=button]:hover, +input[type=submit]:hover { + color: #000; + border-color: #666; +} + +.button, +.submit input, +.button-secondary { + background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top; + text-shadow: rgba(255,255,255,1) 0 1px 0; +} + +.button:active, +.submit input:active, +.button-secondary:active { + background: #eee url(../images/white-grad-active.png) repeat-x scroll left top; +} + +input.button-primary, +button.button-primary, +a.button-primary { + border-color: #298cba; + font-weight: bold; + color: #fff; + background: #21759B url(../images/button-grad.png) repeat-x scroll left top; + text-shadow: rgba(0,0,0,0.3) 0 -1px 0; +} + +input.button-primary:active, +button.button-primary:active, +a.button-primary:active { + background: #21759b url(../images/button-grad-active.png) repeat-x scroll left top; + color: #eaf2fa; +} + +input.button-primary:hover, +button.button-primary:hover, +a.button-primary:hover, +a.button-primary:focus, +a.button-primary:active { + border-color: #13455b; + color: #eaf2fa; +} + +.button-disabled, +.button[disabled], +.button:disabled, +.button-secondary[disabled], +.button-secondary:disabled, +a.button.disabled { + color: #aaa !important; + border-color: #ddd !important; +} + +.button-primary-disabled, +.button-primary[disabled], +.button-primary:disabled { + color: #9FD0D5 !important; + background: #298CBA !important; +} + +a:hover, +a:active, +a:focus { + color: #d54e21; +} + +#wphead #viewsite a:hover, +#adminmenu a:hover, +#adminmenu ul.wp-submenu a:hover, +#the-comment-list .comment a:hover, +#rightnow a:hover, +#media-upload a.del-link:hover, +div.dashboard-widget-submit input:hover, +.subsubsub a:hover, +.subsubsub a.current:hover, +.ui-tabs-nav a:hover, +.plugins .inactive a:hover, +#all-plugins-table .plugins .inactive a:hover, +#search-plugins-table .plugins .inactive a:hover { + color: #d54e21; +} + +#the-comment-list .comment-item, +#dashboard-widgets #dashboard_quick_press form p.submit { + border-color: #dfdfdf; +} + +#side-sortables #category-tabs .tabs a { + color: #333; +} + +#rightnow .rbutton { + background-color: #ebebeb; + color: #264761; +} + +.submitbox .submit { + background-color: #464646; + color: #ccc; +} + +.plugins a.delete:hover, +#all-plugins-table .plugins a.delete:hover, +#search-plugins-table .plugins a.delete:hover, +.submitbox .submitdelete { + color: #f00; + border-bottom-color: #f00; +} + +.submitbox .submitdelete:hover, +#media-items a.delete:hover { + color: #fff; + background-color: #f00; + border-bottom-color: #f00; +} + +#normal-sortables .submitbox .submitdelete:hover { + color: #000; + background-color: #f00; + border-bottom-color: #f00; +} + +.tablenav .dots { + border-color: transparent; +} + +.tablenav .next, +.tablenav .prev { + border-color: transparent; + color: #21759b; +} + +.tablenav .next:hover, +.tablenav .prev:hover { + border-color: transparent; + color: #d54e21; +} + +.updated, +.login .message { + background-color: #ffffe0; + border-color: #e6db55; +} + +.update-message { + color: #000000; +} + +a.page-numbers { + border-bottom-color: #B8D3E2; +} + +.commentlist li { + border-bottom-color: #ccc; +} + +.widefat td, +.widefat th, +#install-plugins .plugins td, +#install-plugins .plugins th { + border-color: #dfdfdf; +} + +.widefat th { + text-shadow: rgba(255,255,255,0.8) 0 1px 0; +} + +.widefat thead tr th, +.widefat tfoot tr th, +h3.dashboard-widget-title, +h3.dashboard-widget-title span, +h3.dashboard-widget-title small, +.find-box-head { + color: #333; + background: #dfdfdf url(../images/gray-grad.png) repeat-x scroll left top; +} + +h3.dashboard-widget-title small a { + color: #d7d7d7; +} + +h3.dashboard-widget-title small a:hover { + color: #fff; +} + +a, +#adminmenu a, +#poststuff #edButtonPreview, +#poststuff #edButtonHTML, +#the-comment-list p.comment-author strong a, +#media-upload a.del-link, +#media-items a.delete, +.plugins a.delete, +.ui-tabs-nav a { + color: #21759b; +} + +/* Because we don't want visited on these links */ +body.press-this .tabs a, +body.press-this .tabs a:hover { + background-color: #fff; + border-color: #c6d9e9; + border-bottom-color: #fff; + color: #d54e21; +} + +#adminmenu #awaiting-mod, +#adminmenu .update-plugins, +#sidemenu a .update-plugins, +#rightnow .reallynow, +#plugin-information .action-button { + background-color: #d54e21; + color: #fff; +} + +#adminmenu li a:hover #awaiting-mod, +#adminmenu li a:hover .update-plugins, +#sidemenu li a:hover .update-plugins { + background-color: #264761; + color: #fff; +} + +#adminmenu li.current a #awaiting-mod, +#adminmenu li.current a .update-plugins, +#adminmenu li.wp-has-current-submenu a .update-plugins, +#adminmenu li.wp-has-current-submenu a .update-plugins { + background-color: #ddd; + color: #000; + text-shadow: none; + -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; + -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; + -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; + box-shadow: rgba(0,0,0,0.2) 0 -1px 0; +} + +#adminmenu li.current a:hover #awaiting-mod, +#adminmenu li.current a:hover .update-plugins, +#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod, +#adminmenu li.wp-has-current-submenu a:hover .update-plugins { + background-color: #264761; + color: #fff; +} + +div#media-upload-header, +div#plugin-information-header { + background-color: #f9f9f9; + border-bottom-color: #dfdfdf; +} + +#currenttheme img { + border-color: #666; +} + +#dashboard_secondary div.dashboard-widget-content ul li a { + background-color: #f9f9f9; +} + +input.readonly, textarea.readonly { + background-color: #ddd; +} + +#ed_toolbar input, +#ed_reply_toolbar input { + background: #fff url("../images/fade-butt.png") repeat-x 0 -2px; +} + +#editable-post-name { + background-color: #fffbcc; +} + +#edit-slug-box strong, +.tablenav .displaying-num, +#submitted-on { + color: #777; +} + +.login #nav a { + color: #21759b !important; +} + +.login #nav a:hover { + color: #d54e21 !important; +} + +#footer, +#footer-upgrade { + background: #464646; + color: #999; +} + +#media-items, +.imgedit-group { + border-color: #dfdfdf; +} + +.checkbox, +.side-info, +.plugins tr, +#your-profile #rich_editing { + background-color: #fff; +} + +.plugins .inactive, +.plugins .inactive th, +.plugins .inactive td, +tr.inactive + tr.plugin-update-tr .plugin-update { + background-color: #eee; +} + +.plugin-update-tr .update-message { + background-color: #fffbe4; + border-color: #dfdfdf; +} + +.plugins .active, +.plugins .active th, +.plugins .active td { + color: #000; +} + +.plugins .inactive a { + color: #557799; +} + +#the-comment-list tr.undo, +#the-comment-list div.undo { + background-color: #f4f4f4; +} + +#the-comment-list .unapproved { + background-color: #ffffe0; +} + +#the-comment-list .approve a { + color: #006505; +} + +#the-comment-list .unapprove a { + color: #d98500; +} + +table.widefat span.delete a, +table.widefat span.trash a, +table.widefat span.spam a, +#dashboard_recent_comments .delete a, +#dashboard_recent_comments .trash a, +#dashboard_recent_comments .spam a { + color: #bc0b0b; +} + +.widget, +#widget-list .widget-top, +.postbox, +#titlediv, +#poststuff .postarea, +.stuffbox { + border-color: #dfdfdf; +} + +.widget, +.postbox { + background-color: #fff; +} + +.ui-sortable .postbox h3 { + color: #464646; +} + +.widget .widget-top, +.ui-sortable .postbox h3:hover { + color: #000; +} + +.curtime #timestamp { + background-image: url(../images/date-button.gif); +} + +#quicktags #ed_link { + color: #00f; +} + +#rightnow .youhave { + background-color: #f0f6fb; +} + +#rightnow a { + color: #448abd; +} + +.tagchecklist span a, +#bulk-titles div a { + background: url(../images/xit.gif) no-repeat; +} + +.tagchecklist span a:hover, +#bulk-titles div a:hover { + background: url(../images/xit.gif) no-repeat -10px 0; +} + +#update-nag { + background-color: #fffeeb; + border-color: #ccc; + color: #555; +} + +.login #backtoblog a { + color: #ccc; +} + +#wphead { + background-color: #464646; +} + +body.login { + border-top-color: #464646; +} + +#wphead h1 a { + color: #fff; +} + +#user_info { + color: #999; +} + +#user_info a:link, +#user_info a:visited, +#footer a:link, +#footer a:visited { + color: #ccc; + text-decoration: none; +} + +#user_info a:hover, +#footer a:hover { + color: #fff; + text-decoration: underline !important; +} + +#user_info a:active, +#footer a:active { + color: #ccc !important; +} + +div#media-upload-error, +.file-error, +abbr.required, +.widget-control-remove:hover, +table.widefat .delete a:hover, +table.widefat .trash a:hover, +table.widefat .spam a:hover, +#dashboard_recent_comments .delete a:hover, +#dashboard_recent_comments .trash a:hover +#dashboard_recent_comments .spam a:hover { + color: #f00; +} + +#pass-strength-result { + background-color: #eee; + border-color: #ddd !important; +} + +#pass-strength-result.bad { + background-color: #ffb78c; + border-color: #ff853c !important; +} + +#pass-strength-result.good { + background-color: #ffec8b; + border-color: #fc0 !important; +} + +#pass-strength-result.short { + background-color: #ffa0a0; + border-color: #f04040 !important; +} + +#pass-strength-result.strong { + background-color: #c3ff88; + border-color: #8dff1c !important; +} + +/* editors */ +#quicktags { + border-color: #dfdfdf; + background-color: #dfdfdf; +} + +#ed_toolbar input { + border-color: #C3C3C3; +} + +#ed_toolbar input:hover { + border-color: #aaa; + background: #ddd; +} + +#poststuff .wp_themeSkin .mceStatusbar { + border-color: #EDEDED; +} + +#poststuff #edButtonPreview, +#poststuff #edButtonHTML { + background-color: #f1f1f1; + border-color: #dfdfdf; + color: #999; +} + +#poststuff #editor-toolbar .active { + border-bottom-color: #e9e9e9; + background-color: #e9e9e9; + color: #333; +} + +/* TinyMCE */ +#post-status-info { + background-color: #EDEDED; +} + +.wp_themeSkin *, +.wp_themeSkin a:hover, +.wp_themeSkin a:link, +.wp_themeSkin a:visited, +.wp_themeSkin a:active { + color: #000; +} + +/* Containers */ +.wp_themeSkin iframe { + background: #fff; +} + +/* Layout */ +.wp_themeSkin .mceStatusbar { + color: #000; + background-color: #f5f5f5; +} + +/* Button */ +.wp_themeSkin .mceButton { + background-color: #e9e8e8; + border-color: #B2B2B2; +} + +.wp_themeSkin a.mceButtonEnabled:hover, +.wp_themeSkin a.mceButtonActive, +.wp_themeSkin a.mceButtonSelected { + background-color: #d5d5d5; + border-color: #777 !important; +} + +.wp_themeSkin .mceButtonDisabled { + border-color: #ccc !important; +} + +/* ListBox */ +.wp_themeSkin .mceListBox .mceText, +.wp_themeSkin .mceListBox .mceOpen { + border-color: #B2B2B2; + background-color: #d5d5d5; +} + +.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, +.wp_themeSkin .mceListBoxHover .mceOpen, +.wp_themeSkin .mceListBoxSelected .mceOpen, +.wp_themeSkin .mceListBoxSelected .mceText { + border-color: #777 !important; + background-color: #d5d5d5; +} + +.wp_themeSkin table.mceListBoxEnabled:hover .mceText, +.wp_themeSkin .mceListBoxHover .mceText { + border-color: #777 !important; +} + +.wp_themeSkin select.mceListBox { + border-color: #B2B2B2; + background-color: #fff; +} + +/* SplitButton */ +.wp_themeSkin .mceSplitButton a.mceAction, +.wp_themeSkin .mceSplitButton a.mceOpen { + border-color: #B2B2B2; +} + +.wp_themeSkin .mceSplitButton a.mceOpen:hover, +.wp_themeSkin .mceSplitButtonSelected a.mceOpen, +.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction, +.wp_themeSkin .mceSplitButton a.mceAction:hover { + background-color: #d5d5d5; + border-color: #777 !important; +} + +.wp_themeSkin .mceSplitButtonActive { + background-color: #B2B2B2; +} + +/* ColorSplitButton */ +.wp_themeSkin div.mceColorSplitMenu table { + background-color: #ebebeb; + border-color: #B2B2B2; +} + +.wp_themeSkin .mceColorSplitMenu a { + border-color: #B2B2B2; +} + +.wp_themeSkin .mceColorSplitMenu a.mceMoreColors { + border-color: #fff; +} + +.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover { + border-color: #0A246A; + background-color: #B6BDD2; +} + +.wp_themeSkin a.mceMoreColors:hover { + border-color: #0A246A; +} + +/* Menu */ +.wp_themeSkin .mceMenu { + border-color: #ddd; +} + +.wp_themeSkin .mceMenu table { + background-color: #ebeaeb; +} + +.wp_themeSkin .mceMenu .mceText { + color: #000; +} + +.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover, +.wp_themeSkin .mceMenu .mceMenuItemActive { + background-color: #f5f5f5; +} +.wp_themeSkin td.mceMenuItemSeparator { + background-color: #aaa; +} +.wp_themeSkin .mceMenuItemTitle a { + background-color: #ccc; + border-bottom-color: #aaa; +} +.wp_themeSkin .mceMenuItemTitle span.mceText { + color: #000; +} +.wp_themeSkin .mceMenuItemDisabled .mceText { + color: #888; +} + +.wp_themeSkin tr.mceFirst td.mceToolbar { + background: #dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top; + border-color: #dfdfdf; +} + +.wp-admin #mceModalBlocker { + background: #000; +} + +.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft { + background: #444444; + border-left: 1px solid #999; + border-top: 1px solid #999; + -moz-border-radius: 4px 0 0 0; + -webkit-border-top-left-radius: 4px; + -khtml-border-top-left-radius: 4px; + border-top-left-radius: 4px; +} + +.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight { + background: #444444; + border-right: 1px solid #999; + border-top: 1px solid #999; + border-top-right-radius: 4px; + -khtml-border-top-right-radius: 4px; + -webkit-border-top-right-radius: 4px; + -moz-border-radius: 0 4px 0 0; +} + +.wp-admin .clearlooks2 .mceMiddle .mceLeft { + background: #f1f1f1; + border-left: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceMiddle .mceRight { + background: #f1f1f1; + border-right: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom { + background: #f1f1f1; + border-bottom: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom .mceLeft { + background: #f1f1f1; + border-bottom: 1px solid #999; + border-left: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom .mceCenter { + background: #f1f1f1; + border-bottom: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceBottom .mceRight { + background: #f1f1f1; + border-bottom: 1px solid #999; + border-right: 1px solid #999; +} + +.wp-admin .clearlooks2 .mceFocus .mceTop span { + color: #e5e5e5; +} +/* end TinyMCE */ + +#editorcontainer, +#post-status-info, +#titlediv #title, +.editwidget .widget-inside { + border-color: #dfdfdf; +} + +#titlediv #title { + background-color: #fff; +} + +#tTips p#tTips_inside { + background-color: #ddd; + color: #333; +} + +#timestampdiv input, +#namediv input, +#poststuff .inside .the-tagcloud { + border-color: #ddd; +} + +/* menu */ +#adminmenu * { + border-color: #e3e3e3; +} + +#adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; +} + +.folded #adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; +} + +#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, +#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { + background: transparent url(../images/menu-bits.gif) no-repeat scroll left -207px; +} + +#adminmenu .wp-has-submenu:hover .wp-menu-toggle, +#adminmenu .wp-menu-open .wp-menu-toggle { + background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px; +} + +#adminmenu a.menu-top { + background: #f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px; +} + +#adminmenu .wp-submenu a { + background: #FFFFFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px; +} + +#adminmenu .wp-has-current-submenu ul li a { + background: none; +} + +#adminmenu .wp-has-current-submenu ul li a.current { + background: url(../images/menu-dark.gif) top left no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, +#adminmenu .menu-top .current { + background: #6d6d6d url(../images/menu-bits.gif) top left repeat-x; + border-color: #6d6d6d; + color: #fff; + text-shadow: rgba(0,0,0,0.4) 0px -1px 0px; +} + +#adminmenu li.wp-has-current-submenu .wp-submenu, +#adminmenu li.wp-has-current-submenu ul li a { + border-color: #aaa !important; +} + +#adminmenu li.wp-has-current-submenu ul li a { + background: url(../images/menu-dark.gif) bottom left no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu ul { + border-bottom-color: #aaa; +} + +#adminmenu li.menu-top .current:hover { + border-color: #B5B5B5; +} + +#adminmenu .wp-submenu .current a.current { + background: transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px; +} + +#adminmenu .wp-submenu a:hover { + background-color: #EAF2FA !important; + color: #333 !important; +} + +#adminmenu .wp-submenu li.current, +#adminmenu .wp-submenu li.current a, +#adminmenu .wp-submenu li.current a:hover { + color: #333; + background-color: #f5f5f5; + background-image: none; + border-color: #e3e3e3; + text-shadow: rgba(255,255,255,1) 0px 1px 0px; +} + +#adminmenu .wp-submenu ul { + background-color: #fff; +} + +.folded #adminmenu li.menu-top, +#adminmenu .wp-submenu .wp-submenu-head { + background-color: #F1F1F1; +} + +.folded #adminmenu li.wp-has-current-submenu, +.folded #adminmenu li.menu-top.current { + background-color: #e6e6e6; +} + +#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { + background-color: #EAEAEA; + border-color: #aaa; +} + +#adminmenu div.wp-submenu { + background-color: transparent; +} + +/* menu icons */ +#adminmenu #menu-dashboard div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -61px -33px; +} + +#adminmenu #menu-dashboard:hover div.wp-menu-image, +#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, +#adminmenu #menu-dashboard.current div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -61px -1px; +} + +#adminmenu #menu-posts div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -272px -33px; +} + +#adminmenu #menu-posts:hover div.wp-menu-image, +#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -272px -1px; +} + +#adminmenu #menu-media div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -121px -33px; +} + +#adminmenu #menu-media:hover div.wp-menu-image, +#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -121px -1px; +} + +#adminmenu #menu-links div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -91px -33px; +} + +#adminmenu #menu-links:hover div.wp-menu-image, +#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -91px -1px; +} + +#adminmenu #menu-pages div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -151px -33px; +} + +#adminmenu #menu-pages:hover div.wp-menu-image, +#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -151px -1px; +} + +#adminmenu #menu-comments div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -31px -33px; +} + +#adminmenu #menu-comments:hover div.wp-menu-image, +#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, +#adminmenu #menu-comments.current div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -31px -1px; +} + +#adminmenu #menu-appearance div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -1px -33px; +} + +#adminmenu #menu-appearance:hover div.wp-menu-image, +#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -1px -1px; +} + +#adminmenu #menu-plugins div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -181px -33px; +} + +#adminmenu #menu-plugins:hover div.wp-menu-image, +#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -181px -1px; +} + +#adminmenu #menu-users div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -301px -33px; +} + +#adminmenu #menu-users:hover div.wp-menu-image, +#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -301px -1px; +} + +#adminmenu #menu-tools div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -211px -33px; +} + +#adminmenu #menu-tools:hover div.wp-menu-image, +#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -211px -1px; +} + +#adminmenu #menu-settings div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -241px -33px; +} + +#adminmenu #menu-settings:hover div.wp-menu-image, +#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { + background: transparent url("../images/menu.png") no-repeat scroll -241px -1px; +} +/* end menu */ + + +/* Diff */ +table.diff .diff-deletedline { + background-color: #ffdddd; +} + +table.diff .diff-deletedline del { + background-color: #ff9999; +} + +table.diff .diff-addedline { + background-color: #ddffdd; +} + +table.diff .diff-addedline ins { + background-color: #99ff99; +} + +#att-info { + background-color: #E4F2FD; +} + +/* edit image */ +#sidemenu a { + background-color: #f9f9f9; + border-color: #f9f9f9; + border-bottom-color: #dfdfdf; +} + +#sidemenu a.current { + background-color: #fff; + border-color: #dfdfdf #dfdfdf #fff; + color: #D54E21; +} + +#screen-options-wrap, +#contextual-help-wrap { + background-color: #f1f1f1; + border-color: #dfdfdf; +} + +#screen-meta-links a.show-settings { + color: #606060; +} + +#screen-meta-links a.show-settings:hover { + color: #000; +} + +#replysubmit { + background-color: #f1f1f1; + border-top-color: #ddd; +} + +#replyerror { + border-color: #ddd; + background-color: #f9f9f9; +} + +#edithead, +#replyhead { + background-color: #f1f1f1; +} + +#ed_reply_toolbar { + background-color: #e9e9e9; +} + +/* table vim shortcuts */ +.vim-current, +.vim-current th, +.vim-current td { + background-color: #E4F2FD !important; +} + +/* Install Plugins */ +.star-average, +.star.star-rating { + background-color: #fc0; +} + +div.star.select:hover { + background-color: #d00; +} + +#plugin-information .fyi ul { + background-color: #eaf3fa; +} + +#plugin-information .fyi h2.mainheader { + background-color: #cee1ef; +} + +#plugin-information pre, +#plugin-information code { + background-color: #ededff; +} + +#plugin-information pre { + border: 1px solid #ccc; +} + +/* inline editor */ +.inline-edit-row fieldset input[type="text"], +.inline-edit-row fieldset textarea, +#bulk-titles, +#replyrow input { + border-color: #ddd; +} + +.inline-editor div.title { + background-color: #EAF3FA; +} + +.inline-editor ul.cat-checklist { + background-color: #FFFFFF; + border-color: #ddd; +} + +.inline-editor .categories .catshow, +.inline-editor .categories .cathide { + color: #21759b; +} + +.inline-editor .quick-edit-save { + background-color: #f1f1f1; +} + +#replyrow #ed_reply_toolbar input:hover { + border-color: #aaa; + background: #ddd; +} + +fieldset.inline-edit-col-right .inline-edit-col { + border-color: #dfdfdf; +} + +.attention { + color: #D54E21; +} + +.meta-box-sortables .postbox:hover .handlediv { + background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px; +} + +#major-publishing-actions { + background: #eaf2fa; +} + +.tablenav .tablenav-pages { + color: #555; +} + +.tablenav .tablenav-pages a { + border-color: #e3e3e3; + background: #eee url('../images/menu-bits.gif') repeat-x scroll left -379px; +} + +.tablenav .tablenav-pages a:hover { + color: #d54e21; + border-color: #d54321; +} + +.tablenav .tablenav-pages a:active { + color: #fff !important; +} + +.tablenav .tablenav-pages .current { + background: #dfdfdf; + border-color: #d3d3d3; +} + +#availablethemes, +#availablethemes td { + border-color: #ddd; +} + +#current-theme img { + border-color: #999; +} + +#TB_window #TB_title a.tb-theme-preview-link, +#TB_window #TB_title a.tb-theme-preview-link:visited { + color: #999; +} + +#TB_window #TB_title a.tb-theme-preview-link:hover, +#TB_window #TB_title a.tb-theme-preview-link:focus { + color: #ccc; +} + +.misc-pub-section { + border-bottom-color: #eee; +} + +#minor-publishing { + border-bottom-color: #ddd; +} + +#post-body .misc-pub-section { + border-right-color: #eee; +} + +.post-com-count span { + background-color: #bbb; +} + +.form-table .color-palette td { + border-color: #fff; +} + +.sortable-placeholder { + border-color: #bbb; + background-color: #f5f5f5; +} + +#post-body ul#category-tabs li.tabs a { + color: #333; +} + +#wp_editimgbtn, +#wp_delimgbtn, +#wp_editgallery, +#wp_delgallery { + border-color: #999; + background-color: #eee; +} + +#wp_editimgbtn:hover, +#wp_delimgbtn:hover, +#wp_editgallery:hover, +#wp_delgallery:hover { + border-color: #555; + background-color: #ccc; +} + +#favorite-first { + background: #797979 url(../images/fav.png) repeat-x left center; + border-color: #777 !important; + border-bottom-color: #666 !important; +} + +#favorite-inside { + border-color: #797979; + background-color: #797979; +} + +#favorite-toggle { + background: transparent url(../images/fav-arrow.gif) no-repeat 0 -4px; +} + +#favorite-actions a { + color: #ddd; +} + +#favorite-actions a:hover { + color: #fff; +} + +#favorite-inside a:hover { + text-decoration: underline; +} + +#favorite-actions .slide-down { + border-bottom-color: #626262; +} + +#screen-meta a.show-settings { + background-color: transparent; + text-shadow: rgba(255,255,255,0.7) 0 1px 0; +} + +#icon-edit, +#icon-post { + background: transparent url(../images/icons32.png) no-repeat -552px -5px; +} + +#icon-index { + background: transparent url(../images/icons32.png) no-repeat -137px -5px; +} + +#icon-upload { + background: transparent url(../images/icons32.png) no-repeat -251px -5px; +} + +#icon-link-manager, +#icon-link, +#icon-link-category { + background: transparent url(../images/icons32.png) no-repeat -190px -5px; +} + +#icon-edit-pages, +#icon-page { + background: transparent url(../images/icons32.png) no-repeat -312px -5px; +} + +#icon-edit-comments { + background: transparent url(../images/icons32.png) no-repeat -72px -5px; +} + +#icon-themes { + background: transparent url(../images/icons32.png) no-repeat -11px -5px; +} + +#icon-plugins { + background: transparent url(../images/icons32.png) no-repeat -370px -5px; +} + +#icon-users, +#icon-profile, +#icon-user-edit { + background: transparent url(../images/icons32.png) no-repeat -600px -5px; +} + +#icon-tools, +#icon-admin { + background: transparent url(../images/icons32.png) no-repeat -432px -5px; +} + +#icon-options-general { + background: transparent url(../images/icons32.png) no-repeat -492px -5px; +} + +.view-switch #view-switch-list { + background: transparent url(../images/list.png) no-repeat 0 0; +} + +.view-switch #view-switch-list.current { + background: transparent url(../images/list.png) no-repeat -40px 0; +} + +.view-switch #view-switch-excerpt { + background: transparent url(../images/list.png) no-repeat -20px 0; +} + +.view-switch #view-switch-excerpt.current { + background: transparent url(../images/list.png) no-repeat -60px 0; +} + +#header-logo { + background: transparent url(../images/wp-logo.gif) no-repeat scroll center center; +} + +#wphead #site-visit-button { + background-color:#585858; + background-image: url(../images/visit-site-button-grad.gif); + color:#aaa; + text-shadow: #3F3F3F 0 -1px 0; +} + +#wphead a:hover #site-visit-button { + color:#fff; +} + +#wphead a:focus #site-visit-button, +#wphead a:active #site-visit-button { + background-position:0 -27px; +} + +.popular-tags, +.feature-filter { + background-color: #FFFFFF; + border-color: #DFDFDF; +} + +#theme-information .action-button { + border-top-color: #DFDFDF; +} + +.theme-listing br.line { + border-bottom-color: #ccc; +} + +div.widgets-sortables, +#widgets-left .inactive { + background-color: #f1f1f1; + border-color: #ddd; +} + +#available-widgets .widget-holder { + background-color: #fff; + border-color: #ddd; +} + +#widgets-left .sidebar-name { + background-color: #aaa; + background-image: url(../images/ed-bg.gif); + text-shadow: #FFFFFF 0 1px 0; + border-color: #dfdfdf; +} + +#widgets-right .sidebar-name { + background-image: url(../images/fav.png); + text-shadow: #3f3f3f 0 -1px 0; + background-color: #636363; + border-color: #636363; + color: #fff; +} + +.sidebar-name:hover, +#removing-widget { + color: #d54e21; +} + +#removing-widget span { + color: black; +} + +#widgets-left .sidebar-name-arrow { + background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px; +} + +#widgets-right .sidebar-name-arrow { + background: transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px; +} + +.in-widget-title { + color: #606060; +} + +.deleting .widget-title * { + color: #aaa; +} + +.imgedit-menu div { + border-color: #d5d5d5; + background-color: #f1f1f1; +} + +.imgedit-menu div:hover { + border-color: #c1c1c1; + background-color: #eaeaea; +} + +.imgedit-menu div.disabled { + border-color: #ccc; + background-color: #ddd; + filter: alpha(opacity=50); + opacity: 0.5; +} + +#dashboard_recent_comments div.undo { + border-top-color: #dfdfdf; +} + +.comment-ays, +.comment-ays th { + border-color: #ddd; +} + +.comment-ays th { + background-color: #f1f1f1; +} diff --git a/wp-admin/css/dashboard.css b/wp-admin/css/dashboard.css index 2784301e..51a8ea9d 100644 --- a/wp-admin/css/dashboard.css +++ b/wp-admin/css/dashboard.css @@ -1,390 +1 @@ -.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; } - -.edit-box { - display: none; -} - -h3:hover .edit-box { - display: inline; -} - -form .input-text-wrap { - border-style: solid; - border-width: 1px; - padding: 2px 3px; - border-color: #ccc; -} - -#dashboard-widgets form .input-text-wrap input { - border: 0 none; - outline: none; - margin: 0; - padding: 0; - width: 99%; - color: #333; -} - -form .textarea-wrap { - border-style: solid; - border-width: 1px; - padding: 2px; - border-color: #ccc; -} - -#dashboard-widgets form .textarea-wrap textarea { - border: 0 none; - padding: 0; - outline: none; - width: 99%; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -#dashboard-widgets .postbox form .submit { - float: none; - margin: .5em 0 0; - padding: 0; - border: none; -} - -#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input { - margin: 0; -} - -#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish { - min-width: 0; -} - -div.postbox div.inside { - margin: 10px; - position: relative; -} - -#dashboard-widgets a { - text-decoration: none; -} - -#dashboard-widgets h3 a { - text-decoration: underline; -} - -#dashboard-widgets h3 .postbox-title-action { - position: absolute; - right: 30px; - padding: 0; -} - -#dashboard-widgets h4 { - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-size: 13px; - margin: 0 0 .2em; - padding: 0; -} - -/* Right Now */ - -#dashboard_right_now p.sub, -#dashboard_right_now .table, #dashboard_right_now .versions { - margin: -12px; -} - -#dashboard_right_now .inside { - font-size: 12px; -} - -#dashboard_right_now p.sub { - font-style: italic; - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - padding: 5px 10px 15px; - color: #777; - font-size: 13px; -} - -#dashboard_right_now .table { - background: #f9f9f9; - border-top: #ececec 1px solid; - border-bottom: #ececec 1px solid; - margin: 0 -9px 10px; - padding: 0 10px; -} - -#dashboard_right_now table { - width: 100%; -} - -#dashboard_right_now table td { - border-top: #ececec 1px solid; - padding: 3px 0; - white-space: nowrap; -} - -#dashboard_right_now table tr.first td { - border-top: none; -} - -#dashboard_right_now td.b { - padding-right: 6px; - text-align: right; - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-size: 14px; -} - -#dashboard_right_now td.b a { - font-size: 18px; -} - -#dashboard_right_now td.b a:hover { - color: #d54e21; -} - -#dashboard_right_now .t { - font-size: 12px; - padding-right: 12px; - padding-top: 6px; - color: #777; -} - -#dashboard_right_now td.first, -#dashboard_right_now td.last { - width: 1px; -} - -#dashboard_right_now .spam { - color: red; -} - -#dashboard_right_now .waiting { - color: #e66f00; -} - -#dashboard_right_now .approved { - color: green; -} - -#dashboard_right_now .versions { - padding: 6px 10px 12px; -} - -#dashboard_right_now .versions .b { - font-weight: bold; -} - -#dashboard_right_now a.button { - float: right; - clear: right; - position: relative; - top: -5px; -} - -/* Recent Comments */ - -#dashboard_recent_comments h3 { - margin-bottom: 0; -} - -#dashboard_recent_comments .inside { - margin-top: 0; -} - -#dashboard_recent_comments .comment-meta .approve { - font-style: italic; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - font-size: 10px; -} - -#the-comment-list { - position: relative; -} - -#the-comment-list .comment-item { - padding: 1em 10px; - border-top: 1px solid; -} - -#the-comment-list .pingback { - padding-left: 9px !important; -} - -#the-comment-list .comment-item, -#the-comment-list #replyrow { - margin: 0 -10px; -} - -#the-comment-list .comment-item:first-child { - border-top: none; -} - -#the-comment-list .comment-item .avatar { - float: left; - margin: 0 10px 5px 0; -} - -#the-comment-list .comment-item h4 { - line-height: 1.4; - margin-top: -.2em; - font-weight: normal; - color: #999; -} - -#the-comment-list .comment-item h4 cite { - font-style: normal; - font-weight: normal; -} - -#the-comment-list .comment-item blockquote, -#the-comment-list .comment-item blockquote p { - margin: 0; - padding: 0; - display: inline; -} - -#dashboard_recent_comments #the-comment-list .trackback blockquote, -#dashboard_recent_comments #the-comment-list .pingback blockquote { - display: block; -} - -#the-comment-list .comment-item p.row-actions { - margin: 3px 0 0; - padding: 0; - font-size: 10px; -} - -/* QuickPress */ - -#dashboard_quick_press h4 { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - float: left; - width: 5.5em; - clear: both; - font-weight: normal; - text-align: right; - padding-top: 5px; - font-size: 12px; -} - -#dashboard_quick_press h4 label { - margin-right: 10px; -} - -#dashboard_quick_press .input-text-wrap, -#dashboard_quick_press .textarea-wrap { - margin: 0 0 1em 5em; -} - -#dashboard_quick_press #media-buttons { - margin: 0 0 .5em 5em; - padding: 0 0 0 10px; - font-size: 11px; -} - -#dashboard_quick_press #media-buttons a { - vertical-align: bottom; -} - -#dashboard-widgets #dashboard_quick_press form p.submit { - margin-left: 4.6em; -} - -#dashboard-widgets #dashboard_quick_press form p.submit input { - float: left; -} - -#dashboard-widgets #dashboard_quick_press form p.submit #save-post { - margin: 0 1em 0 10px; -} - -#dashboard-widgets #dashboard_quick_press form p.submit #publish { - float: right; -} - -/* Recent Drafts */ -#dashboard_recent_drafts ul { - margin: 0; - padding: 0; - list-style: none; -} - -#dashboard_recent_drafts ul li { - margin-bottom: 0.6em; -} - -#dashboard_recent_drafts h4 { - font-weight: normal; -} - -#dashboard_recent_drafts h4 abbr { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - font-size: 11px; - color: #999; - margin-left: 3px; -} - -#dashboard_recent_drafts p { - margin: 0; - padding: 0; -} - -/* Feeds */ - -.rss-widget ul { - margin: 0; - padding: 0; - list-style: none; -} - -a.rsswidget { - font-size: 13px; - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - line-height: 1.7em; -} - -.rss-widget ul li { - line-height: 1.5em; - margin-bottom: 12px; -} - -.rss-widget span.rss-date { - margin-left: 3px; -} - -.rss-widget cite { - display: block; - text-align: right; - margin: 0 0 1em; - padding: 0; -} - -.rss-widget cite:before { - content: '\2014'; -} - -/* Plugins */ - -#dashboard_plugins h4 { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; -} - -#dashboard_plugins h5 { - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-size: 13px !important; - margin: 0; - display: inline; - line-height: 1.4em; -} - -#dashboard_plugins h5 a { - font-weight: normal; - line-height: 1.7em; -} - -#dashboard_plugins p { - margin: 0 0 1.4em; - line-height: 1.4em; -} - -.dashboard-comment-wrap { - overflow: hidden; - word-wrap: break-word; -} - +.postbox p,.postbox ul,.postbox ol,.postbox blockquote,#wp-version-message{font-size:11px;}.edit-box{display:none;}h3:hover .edit-box{display:inline;}form .input-text-wrap{border-style:solid;border-width:1px;padding:2px 3px;border-color:#ccc;}#dashboard-widgets form .input-text-wrap input{border:0 none;outline:none;margin:0;padding:0;width:99%;color:#333;}form .textarea-wrap{border-style:solid;border-width:1px;padding:2px;border-color:#ccc;}#dashboard-widgets form .textarea-wrap textarea{border:0 none;padding:0;outline:none;width:99%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input{margin:0;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0;}div.postbox div.inside{margin:10px;position:relative;}#dashboard-widgets a{text-decoration:none;}#dashboard-widgets h3 a{text-decoration:underline;}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:30px;padding:0;}#dashboard-widgets h4{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px;margin:0 0 .2em;padding:0;}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px;}#dashboard_right_now .inside{font-size:12px;}#dashboard_right_now p.sub{font-style:italic;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:5px 10px 15px;color:#777;font-size:13px;}#dashboard_right_now .table{background:#f9f9f9;border-top:#ececec 1px solid;border-bottom:#ececec 1px solid;margin:0 -9px 10px;padding:0 10px;}#dashboard_right_now table{width:100%;}#dashboard_right_now table td{border-top:#ececec 1px solid;padding:3px 0;white-space:nowrap;}#dashboard_right_now table tr.first td{border-top:none;}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;}#dashboard_right_now td.b a{font-size:18px;}#dashboard_right_now td.b a:hover{color:#d54e21;}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777;}#dashboard_right_now .t a{white-space:nowrap;}#dashboard_right_now td.first,#dashboard_right_now td.last{width:1%;}#dashboard_right_now .spam{color:red;}#dashboard_right_now .waiting{color:#e66f00;}#dashboard_right_now .approved{color:green;}#dashboard_right_now .versions{padding:6px 10px 12px;}#dashboard_right_now .versions .b{font-weight:bold;}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px;}#dashboard_recent_comments h3{margin-bottom:0;}#dashboard_recent_comments .inside{margin-top:0;}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:10px;}#the-comment-list{position:relative;}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid;}#the-comment-list .pingback{padding-left:9px!important;}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px;}#the-comment-list .comment-item:first-child{border-top:none;}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0;}#the-comment-list .comment-item h4{line-height:1.4;margin-top:-.2em;font-weight:normal;color:#999;}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal;}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline;}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block;}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:10px;}#dashboard_quick_press h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;float:left;width:5.5em;clear:both;font-weight:normal;text-align:right;padding-top:5px;font-size:12px;}#dashboard_quick_press h4 label{margin-right:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 5em;}#dashboard_quick_press #media-buttons{margin:0 0 .5em 5em;padding:0 0 0 10px;font-size:11px;}#dashboard_quick_press #media-buttons a{vertical-align:bottom;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1em 0 10px;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right;}#dashboard_recent_drafts ul{margin:0;padding:0;list-style:none;}#dashboard_recent_drafts ul li{margin-bottom:.6em;}#dashboard_recent_drafts h4{font-weight:normal;}#dashboard_recent_drafts h4 abbr{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:11px;color:#999;margin-left:3px;}#dashboard_recent_drafts p{margin:0;padding:0;}.rss-widget ul{margin:0;padding:0;list-style:none;}a.rsswidget{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;line-height:1.7em;}.rss-widget ul li{line-height:1.5em;margin-bottom:12px;}.rss-widget span.rss-date{margin-left:3px;}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0;}.rss-widget cite:before{content:'\2014';}#dashboard_plugins h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#dashboard_plugins h5{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px!important;margin:0;display:inline;line-height:1.4em;}#dashboard_plugins h5 a{font-weight:normal;line-height:1.7em;}#dashboard_plugins p{margin:0 0 1.4em;line-height:1.4em;}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word;} \ No newline at end of file diff --git a/wp-admin/css/dashboard.dev.css b/wp-admin/css/dashboard.dev.css new file mode 100644 index 00000000..fe477b1c --- /dev/null +++ b/wp-admin/css/dashboard.dev.css @@ -0,0 +1,394 @@ +.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; } + +.edit-box { + display: none; +} + +h3:hover .edit-box { + display: inline; +} + +form .input-text-wrap { + border-style: solid; + border-width: 1px; + padding: 2px 3px; + border-color: #ccc; +} + +#dashboard-widgets form .input-text-wrap input { + border: 0 none; + outline: none; + margin: 0; + padding: 0; + width: 99%; + color: #333; +} + +form .textarea-wrap { + border-style: solid; + border-width: 1px; + padding: 2px; + border-color: #ccc; +} + +#dashboard-widgets form .textarea-wrap textarea { + border: 0 none; + padding: 0; + outline: none; + width: 99%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +#dashboard-widgets .postbox form .submit { + float: none; + margin: .5em 0 0; + padding: 0; + border: none; +} + +#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input { + margin: 0; +} + +#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish { + min-width: 0; +} + +div.postbox div.inside { + margin: 10px; + position: relative; +} + +#dashboard-widgets a { + text-decoration: none; +} + +#dashboard-widgets h3 a { + text-decoration: underline; +} + +#dashboard-widgets h3 .postbox-title-action { + position: absolute; + right: 30px; + padding: 0; +} + +#dashboard-widgets h4 { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-size: 13px; + margin: 0 0 .2em; + padding: 0; +} + +/* Right Now */ + +#dashboard_right_now p.sub, +#dashboard_right_now .table, #dashboard_right_now .versions { + margin: -12px; +} + +#dashboard_right_now .inside { + font-size: 12px; +} + +#dashboard_right_now p.sub { + font-style: italic; + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + padding: 5px 10px 15px; + color: #777; + font-size: 13px; +} + +#dashboard_right_now .table { + background: #f9f9f9; + border-top: #ececec 1px solid; + border-bottom: #ececec 1px solid; + margin: 0 -9px 10px; + padding: 0 10px; +} + +#dashboard_right_now table { + width: 100%; +} + +#dashboard_right_now table td { + border-top: #ececec 1px solid; + padding: 3px 0; + white-space: nowrap; +} + +#dashboard_right_now table tr.first td { + border-top: none; +} + +#dashboard_right_now td.b { + padding-right: 6px; + text-align: right; + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-size: 14px; +} + +#dashboard_right_now td.b a { + font-size: 18px; +} + +#dashboard_right_now td.b a:hover { + color: #d54e21; +} + +#dashboard_right_now .t { + font-size: 12px; + padding-right: 12px; + padding-top: 6px; + color: #777; +} + +#dashboard_right_now .t a { + white-space: nowrap; +} + +#dashboard_right_now td.first, +#dashboard_right_now td.last { + width: 1%; +} + +#dashboard_right_now .spam { + color: red; +} + +#dashboard_right_now .waiting { + color: #e66f00; +} + +#dashboard_right_now .approved { + color: green; +} + +#dashboard_right_now .versions { + padding: 6px 10px 12px; +} + +#dashboard_right_now .versions .b { + font-weight: bold; +} + +#dashboard_right_now a.button { + float: right; + clear: right; + position: relative; + top: -5px; +} + +/* Recent Comments */ + +#dashboard_recent_comments h3 { + margin-bottom: 0; +} + +#dashboard_recent_comments .inside { + margin-top: 0; +} + +#dashboard_recent_comments .comment-meta .approve { + font-style: italic; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + font-size: 10px; +} + +#the-comment-list { + position: relative; +} + +#the-comment-list .comment-item { + padding: 1em 10px; + border-top: 1px solid; +} + +#the-comment-list .pingback { + padding-left: 9px !important; +} + +#the-comment-list .comment-item, +#the-comment-list #replyrow { + margin: 0 -10px; +} + +#the-comment-list .comment-item:first-child { + border-top: none; +} + +#the-comment-list .comment-item .avatar { + float: left; + margin: 0 10px 5px 0; +} + +#the-comment-list .comment-item h4 { + line-height: 1.4; + margin-top: -.2em; + font-weight: normal; + color: #999; +} + +#the-comment-list .comment-item h4 cite { + font-style: normal; + font-weight: normal; +} + +#the-comment-list .comment-item blockquote, +#the-comment-list .comment-item blockquote p { + margin: 0; + padding: 0; + display: inline; +} + +#dashboard_recent_comments #the-comment-list .trackback blockquote, +#dashboard_recent_comments #the-comment-list .pingback blockquote { + display: block; +} + +#the-comment-list .comment-item p.row-actions { + margin: 3px 0 0; + padding: 0; + font-size: 10px; +} + +/* QuickPress */ + +#dashboard_quick_press h4 { + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + float: left; + width: 5.5em; + clear: both; + font-weight: normal; + text-align: right; + padding-top: 5px; + font-size: 12px; +} + +#dashboard_quick_press h4 label { + margin-right: 10px; +} + +#dashboard_quick_press .input-text-wrap, +#dashboard_quick_press .textarea-wrap { + margin: 0 0 1em 5em; +} + +#dashboard_quick_press #media-buttons { + margin: 0 0 .5em 5em; + padding: 0 0 0 10px; + font-size: 11px; +} + +#dashboard_quick_press #media-buttons a { + vertical-align: bottom; +} + +#dashboard-widgets #dashboard_quick_press form p.submit { + margin-left: 4.6em; +} + +#dashboard-widgets #dashboard_quick_press form p.submit input { + float: left; +} + +#dashboard-widgets #dashboard_quick_press form p.submit #save-post { + margin: 0 1em 0 10px; +} + +#dashboard-widgets #dashboard_quick_press form p.submit #publish { + float: right; +} + +/* Recent Drafts */ +#dashboard_recent_drafts ul { + margin: 0; + padding: 0; + list-style: none; +} + +#dashboard_recent_drafts ul li { + margin-bottom: 0.6em; +} + +#dashboard_recent_drafts h4 { + font-weight: normal; +} + +#dashboard_recent_drafts h4 abbr { + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + font-size: 11px; + color: #999; + margin-left: 3px; +} + +#dashboard_recent_drafts p { + margin: 0; + padding: 0; +} + +/* Feeds */ + +.rss-widget ul { + margin: 0; + padding: 0; + list-style: none; +} + +a.rsswidget { + font-size: 13px; + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + line-height: 1.7em; +} + +.rss-widget ul li { + line-height: 1.5em; + margin-bottom: 12px; +} + +.rss-widget span.rss-date { + margin-left: 3px; +} + +.rss-widget cite { + display: block; + text-align: right; + margin: 0 0 1em; + padding: 0; +} + +.rss-widget cite:before { + content: '\2014'; +} + +/* Plugins */ + +#dashboard_plugins h4 { + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; +} + +#dashboard_plugins h5 { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-size: 13px !important; + margin: 0; + display: inline; + line-height: 1.4em; +} + +#dashboard_plugins h5 a { + font-weight: normal; + line-height: 1.7em; +} + +#dashboard_plugins p { + margin: 0 0 1.4em; + line-height: 1.4em; +} + +.dashboard-comment-wrap { + overflow: hidden; + word-wrap: break-word; +} + diff --git a/wp-admin/css/global-rtl.css b/wp-admin/css/global-rtl.css index 78b2c408..f5f7632e 100644 --- a/wp-admin/css/global-rtl.css +++ b/wp-admin/css/global-rtl.css @@ -78,6 +78,5 @@ body, td, textarea, input, select { .screen-reader-text, .screen-reader-text span { left:auto; - right:-1000em; -} + text-indent:-1000em; } \ No newline at end of file diff --git a/wp-admin/css/global.css b/wp-admin/css/global.css index 0ca08320..cb69b96f 100644 --- a/wp-admin/css/global.css +++ b/wp-admin/css/global.css @@ -1,487 +1 @@ -/* http://meyerweb.com/eric/tools/css/reset/ */ -/* v1.0 | 20080212 */ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, font, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td { - margin: 0; - padding: 0; - border: 0; - outline: 0; -/* font-size: 100%; - vertical-align: baseline; */ - background: transparent; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} - -/* remember to define focus styles! */ -/* -:focus { - outline: 0; -} -*/ -/* remember to highlight inserts somehow! */ -ins { - text-decoration: none; -} -del { - text-decoration: line-through; -} - -/* tables still need 'cellspacing="0"' in the markup */ -/* -table { - border-collapse: collapse; - border-spacing: 0; -} -*/ -/* end reset css */ - - -/* 2 column liquid layout */ -#wpwrap { - height: auto; - min-height: 100%; - width: 100%; -} - -#wpcontent { - height: 100%; - padding-bottom: 50px; -} - -#wpbody { - clear: both; - margin-left: 175px; -} - -.folded #wpbody { - margin-left: 60px; -} - -#wpbody-content { - float: left; - width: 100%; -} - -#adminmenu { - float: left; - clear: left; - width: 145px; - margin-top: 15px; - margin-right: 5px; - margin-bottom: 15px; - margin-left: -160px; - position: relative; - padding: 0; - list-style: none; -} - -.folded #adminmenu { - margin-left: -45px; -} - -.folded #adminmenu, -.folded #adminmenu li.menu-top { - width: 28px; -} - -#footer { - clear: both; - position: relative; - width: 100%; -} - -/* inner 2 column liquid layout */ -.inner-sidebar { - float: right; - clear: right; - display: none; - width: 281px; - position: relative; -} - -.inner-sidebar #side-sortables { - width: 280px; - min-height: 300px; -} - -.has-right-sidebar .inner-sidebar { - display: block; -} - -.has-right-sidebar #post-body { - float: left; - clear: left; - width: 100%; - margin-right: -340px; -} - -.has-right-sidebar #post-body-content { - margin-right: 300px; -} - -/* 2 columns main area */ - -#col-container { - overflow: hidden; - padding: 0; - margin: 0; -} - -#col-left { - padding: 0; - margin: 0; - overflow: hidden; - width: 39%; -} - -#col-right { - float: right; - clear: right; - overflow: hidden; - padding: 0; - margin: 0; - width: 59%; -} - -/* utility classes */ -.alignleft { - float: left; -} - -.alignright { - float: right; -} - -.textleft { - text-align: left; -} - -.textright { - text-align: right; -} - -.clear { - clear: both; -} - -/* Hide visually but not from screen readers */ -.screen-reader-text, -.screen-reader-text span { - position: absolute; - left: -1000em; - height: 1px; - width: 1px; - overflow: hidden; -} - -.hidden, -.js .closed .inside, -.js .hide-if-js, -.no-js .hide-if-no-js { - display: none; -} - -/* include margin and padding in the width calculation of input and textarea */ -input[type="text"], -input[type="password"], -textarea { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; /* ie8 only */ - box-sizing: border-box; -} - -input[type="checkbox"], -input[type="radio"] { - vertical-align: middle; -} - -/* styles for use by people extending the WordPress interface */ -html, -body { - height: 100%; -} - -body, -td, -textarea, -input, -select { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - font-size: 13px; -} - -body, -textarea { - line-height: 1.4em; -} - -input, -select { - line-height: 1em; -} - -p { - margin: 1em 0; -} - -blockquote { - margin: 1em; -} - -label { - cursor: pointer; -} - -li, -dd { - margin-bottom: 6px; -} - -p, -li, -dl, -dd, -dt { - line-height: 140%; -} - -textarea, -input, -select { - margin: 1px; - padding: 3px; -} - -h1 { - display: block; - font-size: 2em; - font-weight: bold; - margin: .67em 0; -} - -h2 { - display: block; - font-size: 1.5em; - font-weight: bold; - margin: .83em 0; -} - -h3 { - display: block; - font-size: 1.17em; - font-weight: bold; - margin: 1em 0; -} - -h4 { - display: block; - font-size: 1em; - font-weight: bold; - margin: 1.33em 0; -} - -h5 { - display: block; - font-size: 0.83em; - font-weight: bold; - margin: 1.67em 0; -} - -h6 { - display: block; - font-size: 0.67em; - font-weight: bold; - margin: 2.33em 0; -} - -ul.ul-disc { - list-style: disc outside; -} - -ul.ul-square { - list-style: square outside; -} - -ol.ol-decimal { - list-style: decimal outside; -} - -ul.ul-disc, -ul.ul-square, -ol.ol-decimal { - margin-left: 1.8em; -} - -ul.ul-disc > li, -ul.ul-square > li, -ol.ol-decimal > li { - margin: 0 0 0.5em; -} - -.subsubsub { - list-style: none; - margin: 8px 0 5px; - padding: 0; - white-space: nowrap; - font-size: 11px; - float: left; -} - -.subsubsub a { - line-height: 2; - padding: .2em; - text-decoration: none; -} - -.subsubsub a .count, .subsubsub a.current .count { - color: #999; - font-weight: normal; -} - -.subsubsub a.current { - font-weight: bold; - background: none; - border: none; -} - -.subsubsub li { - display: inline; - margin: 0; - padding: 0; -} - -.widefat { - border-width: 1px; - border-style: solid; - border-spacing: 0; - width: 100%; - clear: both; - margin: 0; - -moz-border-radius: 4px; - -khtml-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; -} - -.widefat * { - word-wrap: break-word; -} - -.widefat a { - text-decoration: none; -} - -.widefat td, -.widefat th { - border-bottom-width: 1px; - border-bottom-style: solid; - font-size: 11px; - vertical-align: text-top; -} - -.widefat td { - padding: 3px 7px; - vertical-align: top; -} - -.widefat td p, -.widefat td ol, -.widefat td ul { - font-size: 11px; -} - -.widefat th { - padding: 7px 7px 8px; - text-align: left; - line-height: 1.3em; -} - -.widefat th input { - margin: 0 0 0 8px; - padding: 0; - vertical-align: text-top; -} - -.widefat .check-column { - width: 2.2em; - padding: 0; - -} - -.widefat tbody th.check-column { - padding: 7px 0 22px; -} - -.widefat .num, -.column-comments, -.column-links, -.column-posts, -.column-parent { - text-align: center; -} - -.widefat th#comments { - vertical-align: middle; -} - -.wrap { - margin: 0 15px 0 5px; -} - -.updated, -.error { - border-width: 1px; - border-style: solid; - padding: 0 0.6em; - margin: 5px 15px 2px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.updated p, -.error p { - margin: 0.5em 0; - line-height: 1; - padding: 2px; -} - -.wrap .updated, -.wrap .error { - margin: 5px 0 15px; -} - -.wrap h2 { - font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - margin: 0; - padding: 14px 15px 3px 0; - line-height: 35px; - text-shadow: rgba(255,255,255,1) 0px 1px 0px; -} - -.wrap h2.long-header { - padding-right: 0; -} +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;background:transparent;}body{line-height:1;}ol,ul{list-style:none;}blockquote,q{quotes:none;}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}ins{text-decoration:none;}del{text-decoration:line-through;}#wpwrap{height:auto;min-height:100%;width:100%;}#wpcontent{height:100%;padding-bottom:50px;}#wpbody{clear:both;margin-left:175px;}.folded #wpbody{margin-left:60px;}#wpbody-content{float:left;width:100%;}#adminmenu{float:left;clear:left;width:145px;margin-top:15px;margin-right:5px;margin-bottom:15px;margin-left:-160px;position:relative;padding:0;list-style:none;}.folded #adminmenu{margin-left:-45px;}.folded #adminmenu,.folded #adminmenu li.menu-top{width:28px;}#footer{clear:both;position:relative;width:100%;}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative;}.inner-sidebar #side-sortables{width:280px;min-height:300px;}.has-right-sidebar .inner-sidebar{display:block;}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-340px;}.has-right-sidebar #post-body-content{margin-right:300px;}#col-container{overflow:hidden;padding:0;margin:0;}#col-left{padding:0;margin:0;overflow:hidden;width:39%;}#col-right{float:right;clear:right;overflow:hidden;padding:0;margin:0;width:59%;}.alignleft{float:left;}.alignright{float:right;}.textleft{text-align:left;}.textright{text-align:right;}.clear{clear:both;}.screen-reader-text,.screen-reader-text span{position:absolute;left:-1000em;height:1px;width:1px;overflow:hidden;}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js{display:none;}input[type="text"],input[type="password"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}input[type="checkbox"],input[type="radio"]{vertical-align:middle;}html,body{height:100%;}body,td,textarea,input,select{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:13px;}body,textarea{line-height:1.4em;}input,select{line-height:1em;}p{margin:1em 0;}blockquote{margin:1em;}label{cursor:pointer;}li,dd{margin-bottom:6px;}p,li,dl,dd,dt{line-height:140%;}textarea,input,select{margin:1px;padding:3px;}h1{display:block;font-size:2em;font-weight:bold;margin:.67em 0;}h2{display:block;font-size:1.5em;font-weight:bold;margin:.83em 0;}h3{display:block;font-size:1.17em;font-weight:bold;margin:1em 0;}h4{display:block;font-size:1em;font-weight:bold;margin:1.33em 0;}h5{display:block;font-size:.83em;font-weight:bold;margin:1.67em 0;}h6{display:block;font-size:.67em;font-weight:bold;margin:2.33em 0;}ul.ul-disc{list-style:disc outside;}ul.ul-square{list-style:square outside;}ol.ol-decimal{list-style:decimal outside;}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em;}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em;}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap;font-size:11px;float:left;}.subsubsub a{line-height:2;padding:.2em;text-decoration:none;}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal;}.subsubsub a.current{font-weight:bold;background:none;border:none;}.subsubsub li{display:inline;margin:0;padding:0;}.widefat{border-width:1px;border-style:solid;border-spacing:0;width:100%;clear:both;margin:0;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.widefat *{word-wrap:break-word;}.widefat a{text-decoration:none;}.widefat td,.widefat th{border-bottom-width:1px;border-bottom-style:solid;font-size:11px;}.widefat td{padding:3px 7px;vertical-align:top;}.widefat td p,.widefat td ol,.widefat td ul{font-size:11px;}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top;}.widefat .check-column{width:2.2em;padding:0;}.widefat tbody th.check-column{padding:7px 0 22px;}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center;}.widefat th#comments{vertical-align:middle;}.wrap{margin:0 15px 0 5px;}.updated,.error{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 15px 2px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.updated p,.error p{margin:.5em 0;line-height:1;padding:2px;}.wrap .updated,.wrap .error{margin:5px 0 15px;}.wrap h2{font:italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;margin:0;padding:14px 15px 3px 0;line-height:35px;text-shadow:rgba(255,255,255,1) 0 1px 0;}.wrap h2.long-header{padding-right:0;} \ No newline at end of file diff --git a/wp-admin/css/global.dev.css b/wp-admin/css/global.dev.css new file mode 100644 index 00000000..8975db5a --- /dev/null +++ b/wp-admin/css/global.dev.css @@ -0,0 +1,485 @@ +/* http://meyerweb.com/eric/tools/css/reset/ */ +/* v1.0 | 20080212 */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; +/* font-size: 100%; + vertical-align: baseline; */ + background: transparent; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} + +/* remember to define focus styles! */ +/* +:focus { + outline: 0; +} +*/ +/* remember to highlight inserts somehow! */ +ins { + text-decoration: none; +} +del { + text-decoration: line-through; +} + +/* tables still need 'cellspacing="0"' in the markup */ +/* +table { + border-collapse: collapse; + border-spacing: 0; +} +*/ +/* end reset css */ + + +/* 2 column liquid layout */ +#wpwrap { + height: auto; + min-height: 100%; + width: 100%; +} + +#wpcontent { + height: 100%; + padding-bottom: 50px; +} + +#wpbody { + clear: both; + margin-left: 175px; +} + +.folded #wpbody { + margin-left: 60px; +} + +#wpbody-content { + float: left; + width: 100%; +} + +#adminmenu { + float: left; + clear: left; + width: 145px; + margin-top: 15px; + margin-right: 5px; + margin-bottom: 15px; + margin-left: -160px; + position: relative; + padding: 0; + list-style: none; +} + +.folded #adminmenu { + margin-left: -45px; +} + +.folded #adminmenu, +.folded #adminmenu li.menu-top { + width: 28px; +} + +#footer { + clear: both; + position: relative; + width: 100%; +} + +/* inner 2 column liquid layout */ +.inner-sidebar { + float: right; + clear: right; + display: none; + width: 281px; + position: relative; +} + +.inner-sidebar #side-sortables { + width: 280px; + min-height: 300px; +} + +.has-right-sidebar .inner-sidebar { + display: block; +} + +.has-right-sidebar #post-body { + float: left; + clear: left; + width: 100%; + margin-right: -340px; +} + +.has-right-sidebar #post-body-content { + margin-right: 300px; +} + +/* 2 columns main area */ + +#col-container { + overflow: hidden; + padding: 0; + margin: 0; +} + +#col-left { + padding: 0; + margin: 0; + overflow: hidden; + width: 39%; +} + +#col-right { + float: right; + clear: right; + overflow: hidden; + padding: 0; + margin: 0; + width: 59%; +} + +/* utility classes */ +.alignleft { + float: left; +} + +.alignright { + float: right; +} + +.textleft { + text-align: left; +} + +.textright { + text-align: right; +} + +.clear { + clear: both; +} + +/* Hide visually but not from screen readers */ +.screen-reader-text, +.screen-reader-text span { + position: absolute; + left: -1000em; + height: 1px; + width: 1px; + overflow: hidden; +} + +.hidden, +.js .closed .inside, +.js .hide-if-js, +.no-js .hide-if-no-js { + display: none; +} + +/* include margin and padding in the width calculation of input and textarea */ +input[type="text"], +input[type="password"], +textarea { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; /* ie8 only */ + box-sizing: border-box; +} + +input[type="checkbox"], +input[type="radio"] { + vertical-align: middle; +} + +/* styles for use by people extending the WordPress interface */ +html, +body { + height: 100%; +} + +body, +td, +textarea, +input, +select { + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + font-size: 13px; +} + +body, +textarea { + line-height: 1.4em; +} + +input, +select { + line-height: 1em; +} + +p { + margin: 1em 0; +} + +blockquote { + margin: 1em; +} + +label { + cursor: pointer; +} + +li, +dd { + margin-bottom: 6px; +} + +p, +li, +dl, +dd, +dt { + line-height: 140%; +} + +textarea, +input, +select { + margin: 1px; + padding: 3px; +} + +h1 { + display: block; + font-size: 2em; + font-weight: bold; + margin: .67em 0; +} + +h2 { + display: block; + font-size: 1.5em; + font-weight: bold; + margin: .83em 0; +} + +h3 { + display: block; + font-size: 1.17em; + font-weight: bold; + margin: 1em 0; +} + +h4 { + display: block; + font-size: 1em; + font-weight: bold; + margin: 1.33em 0; +} + +h5 { + display: block; + font-size: 0.83em; + font-weight: bold; + margin: 1.67em 0; +} + +h6 { + display: block; + font-size: 0.67em; + font-weight: bold; + margin: 2.33em 0; +} + +ul.ul-disc { + list-style: disc outside; +} + +ul.ul-square { + list-style: square outside; +} + +ol.ol-decimal { + list-style: decimal outside; +} + +ul.ul-disc, +ul.ul-square, +ol.ol-decimal { + margin-left: 1.8em; +} + +ul.ul-disc > li, +ul.ul-square > li, +ol.ol-decimal > li { + margin: 0 0 0.5em; +} + +.subsubsub { + list-style: none; + margin: 8px 0 5px; + padding: 0; + white-space: nowrap; + font-size: 11px; + float: left; +} + +.subsubsub a { + line-height: 2; + padding: .2em; + text-decoration: none; +} + +.subsubsub a .count, .subsubsub a.current .count { + color: #999; + font-weight: normal; +} + +.subsubsub a.current { + font-weight: bold; + background: none; + border: none; +} + +.subsubsub li { + display: inline; + margin: 0; + padding: 0; +} + +.widefat { + border-width: 1px; + border-style: solid; + border-spacing: 0; + width: 100%; + clear: both; + margin: 0; + -moz-border-radius: 4px; + -khtml-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} + +.widefat * { + word-wrap: break-word; +} + +.widefat a { + text-decoration: none; +} + +.widefat td, +.widefat th { + border-bottom-width: 1px; + border-bottom-style: solid; + font-size: 11px; +} + +.widefat td { + padding: 3px 7px; + vertical-align: top; +} + +.widefat td p, +.widefat td ol, +.widefat td ul { + font-size: 11px; +} + +.widefat th { + padding: 7px 7px 8px; + text-align: left; + line-height: 1.3em; +} + +.widefat th input { + margin: 0 0 0 8px; + padding: 0; + vertical-align: text-top; +} + +.widefat .check-column { + width: 2.2em; + padding: 0; + +} + +.widefat tbody th.check-column { + padding: 7px 0 22px; +} + +.widefat .num, +.column-comments, +.column-links, +.column-posts { + text-align: center; +} + +.widefat th#comments { + vertical-align: middle; +} + +.wrap { + margin: 0 15px 0 5px; +} + +.updated, +.error { + border-width: 1px; + border-style: solid; + padding: 0 0.6em; + margin: 5px 15px 2px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.updated p, +.error p { + margin: 0.5em 0; + line-height: 1; + padding: 2px; +} + +.wrap .updated, +.wrap .error { + margin: 5px 0 15px; +} + +.wrap h2 { + font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + margin: 0; + padding: 14px 15px 3px 0; + line-height: 35px; + text-shadow: rgba(255,255,255,1) 0px 1px 0px; +} + +.wrap h2.long-header { + padding-right: 0; +} diff --git a/wp-admin/css/ie-rtl.css b/wp-admin/css/ie-rtl.css index 1a6db486..067f59a0 100644 --- a/wp-admin/css/ie-rtl.css +++ b/wp-admin/css/ie-rtl.css @@ -89,3 +89,7 @@ p.submit { /* quick edit and reply in edit-comments.php */ form#widgets-filter { /* fix widget page */ position: static; } + +* html .meta-box-sortables .postbox .handlediv { + background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px; +} diff --git a/wp-admin/css/ie.css b/wp-admin/css/ie.css index 3ced032d..7e84e0c5 100644 --- a/wp-admin/css/ie.css +++ b/wp-admin/css/ie.css @@ -21,6 +21,14 @@ input.button-highlighted { margin-bottom: -1px; } +* html .meta-box-sortables .postbox .handlediv { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; +} + +* html .edit-box { + display: inline; +} + * html .inner-sidebar #side-sortables, * html .postbox-container .meta-box-sortables { height: 300px; @@ -317,6 +325,10 @@ div#dashboard-widgets { margin-top: 2px; } +.tablenav .actions select { + width: 155px; +} + table.ie-fixed { table-layout: fixed; } @@ -399,3 +411,34 @@ table.ie-fixed { position: relative; } +* html .media-item .pinkynail { + height: 32px; + width: 40px; +} + +#wpcontent .button-primary-disabled { + color: #9FD0D5; + background: #298CBA; +} + +#wpcontent #ajax-loading { + vertical-align: baseline; +} + +* html .describe .field input.text, +* html .describe .field textarea { + width: 440px; +} + +#the-comment-list .unapproved tr, +#the-comment-list .unapproved td { + background-color: #ffffe0; +} + +.imgedit-submit { + width: 300px; +} + +* html input { + border: 1px solid #dfdfdf; +} diff --git a/wp-admin/css/install.css b/wp-admin/css/install.css index 6be5ba75..834a3b18 100644 --- a/wp-admin/css/install.css +++ b/wp-admin/css/install.css @@ -1,133 +1 @@ -html { background: #f7f7f7; } - -body { - background: #fff; - color: #333; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - margin: 2em auto 0 auto; - width: 700px; - padding: 1em 2em; - -moz-border-radius: 11px; - -khtml-border-radius: 11px; - -webkit-border-radius: 11px; - border-radius: 11px; - border: 1px solid #dfdfdf; -} - -a { color: #2583ad; text-decoration: none; } - -a:hover { color: #d54e21; } - -h1 { - border-bottom: 1px solid #dadada; - clear: both; - color: #666; - font: 24px Georgia, "Times New Roman", Times, serif; - margin: 5px 0 0 -4px; - padding: 0; - padding-bottom: 7px; -} - -h2 { font-size: 16px; } - -p, li { - padding-bottom: 2px; - font-size: 12px; - line-height: 18px; -} - -code { font-size: 13px; } - -ul, ol { padding: 5px 5px 5px 22px; } - -#logo { margin: 6px 0 14px 0; border-bottom: none;} - -.step { - margin: 20px 0 15px; -} - -.step, th { text-align: left; padding: 0; } - -.submit input, .button, .button-secondary { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - text-decoration: none; - font-size: 14px !important; - line-height: 16px; - padding: 6px 12px; - cursor: pointer; - border: 1px solid #bbb; - color: #464646; - -moz-border-radius: 15px; - -khtml-border-radius: 15px; - -webkit-border-radius: 15px; - border-radius: 15px; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - -khtml-box-sizing: content-box; - box-sizing: content-box; -} - -.button:hover, .button-secondary:hover, .submit input:hover { - color: #000; - border-color: #666; -} - -.button, .submit input, .button-secondary { - background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top; -} - -.button:active, .submit input:active, .button-secondary:active { - background: #eee url(../images/white-grad-active.png) repeat-x scroll left top; -} - -.form-table { - border-collapse: collapse; - margin-top: 1em; - width: 100%; -} - -.form-table td { - margin-bottom: 9px; - padding: 10px; - border-bottom: 8px solid #fff; - font-size: 12px; -} - -.form-table th { - font-size: 13px; - text-align: left; - padding: 16px 10px 10px 10px; - border-bottom: 8px solid #fff; - width: 110px; - vertical-align: top; -} - -.form-table tr { - background: #f3f3f3; -} - -.form-table code { - line-height: 18px; - font-size: 18px; -} - -.form-table p { - margin: 4px 0 0 0; - font-size: 11px; -} - -.form-table input { - line-height: 20px; - font-size: 15px; - padding: 2px; -} - -#error-page { margin-top: 50px; } - -#error-page p { - font-size: 12px; - line-height: 18px; - margin: 25px 0 20px; -} - -#error-page code { font-family: Consolas, Monaco, Courier, monospace; } +html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto 0 auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;} \ No newline at end of file diff --git a/wp-admin/css/install.dev.css b/wp-admin/css/install.dev.css new file mode 100644 index 00000000..6be5ba75 --- /dev/null +++ b/wp-admin/css/install.dev.css @@ -0,0 +1,133 @@ +html { background: #f7f7f7; } + +body { + background: #fff; + color: #333; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + margin: 2em auto 0 auto; + width: 700px; + padding: 1em 2em; + -moz-border-radius: 11px; + -khtml-border-radius: 11px; + -webkit-border-radius: 11px; + border-radius: 11px; + border: 1px solid #dfdfdf; +} + +a { color: #2583ad; text-decoration: none; } + +a:hover { color: #d54e21; } + +h1 { + border-bottom: 1px solid #dadada; + clear: both; + color: #666; + font: 24px Georgia, "Times New Roman", Times, serif; + margin: 5px 0 0 -4px; + padding: 0; + padding-bottom: 7px; +} + +h2 { font-size: 16px; } + +p, li { + padding-bottom: 2px; + font-size: 12px; + line-height: 18px; +} + +code { font-size: 13px; } + +ul, ol { padding: 5px 5px 5px 22px; } + +#logo { margin: 6px 0 14px 0; border-bottom: none;} + +.step { + margin: 20px 0 15px; +} + +.step, th { text-align: left; padding: 0; } + +.submit input, .button, .button-secondary { + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + text-decoration: none; + font-size: 14px !important; + line-height: 16px; + padding: 6px 12px; + cursor: pointer; + border: 1px solid #bbb; + color: #464646; + -moz-border-radius: 15px; + -khtml-border-radius: 15px; + -webkit-border-radius: 15px; + border-radius: 15px; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + -khtml-box-sizing: content-box; + box-sizing: content-box; +} + +.button:hover, .button-secondary:hover, .submit input:hover { + color: #000; + border-color: #666; +} + +.button, .submit input, .button-secondary { + background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top; +} + +.button:active, .submit input:active, .button-secondary:active { + background: #eee url(../images/white-grad-active.png) repeat-x scroll left top; +} + +.form-table { + border-collapse: collapse; + margin-top: 1em; + width: 100%; +} + +.form-table td { + margin-bottom: 9px; + padding: 10px; + border-bottom: 8px solid #fff; + font-size: 12px; +} + +.form-table th { + font-size: 13px; + text-align: left; + padding: 16px 10px 10px 10px; + border-bottom: 8px solid #fff; + width: 110px; + vertical-align: top; +} + +.form-table tr { + background: #f3f3f3; +} + +.form-table code { + line-height: 18px; + font-size: 18px; +} + +.form-table p { + margin: 4px 0 0 0; + font-size: 11px; +} + +.form-table input { + line-height: 20px; + font-size: 15px; + padding: 2px; +} + +#error-page { margin-top: 50px; } + +#error-page p { + font-size: 12px; + line-height: 18px; + margin: 25px 0 20px; +} + +#error-page code { font-family: Consolas, Monaco, Courier, monospace; } diff --git a/wp-admin/css/login.css b/wp-admin/css/login.css index bd89d91a..a880c037 100644 --- a/wp-admin/css/login.css +++ b/wp-admin/css/login.css @@ -1,111 +1 @@ -* { margin: 0; padding: 0; } - -body { - border-top-width: 30px; - border-top-style: solid; - font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; -} - -form { - margin-left: 8px; - padding: 16px 16px 40px 16px; - font-weight: normal; - -moz-border-radius: 11px; - -khtml-border-radius: 11px; - -webkit-border-radius: 11px; - border-radius: 5px; - background: #fff; - border: 1px solid #e5e5e5; - -moz-box-shadow: rgba(200,200,200,1) 0 4px 18px; - -webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px; - -khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px; - box-shadow: rgba(200,200,200,1) 0 4px 18px; -} - -form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0; } - -#login form .submit input { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - padding: 3px 10px; - border: none; - font-size: 12px; - border-width: 1px; - border-style: solid; - -moz-border-radius: 11px; - -khtml-border-radius: 11px; - -webkit-border-radius: 11px; - border-radius: 11px; - cursor: pointer; - text-decoration: none; - margin-top: -3px; - text-shadow: rgba(0,0,0,0.3) 0 -1px 0; -} - -#login form p { - margin-bottom: 0; -} - -label { - color: #777; - font-size: 13px; -} - -form .forgetmenot label { - font-size: 11px; - line-height: 19px; -} - -form .submit { float: right; } - -form p { margin-bottom: 24px; } - -h1 a { - background: url(../images/logo-login.gif) no-repeat top center; - width: 326px; - height: 67px; - text-indent: -9999px; - overflow: hidden; - padding-bottom: 15px; - display: block; -} - -#nav { - text-shadow: rgba(255,255,255,1) 0 1px 0; -} - -#backtoblog a { - position: absolute; - top: 7px; - left: 15px; - text-decoration: none; -} - -#login { width: 320px; margin: 7em auto; } - -#login_error, .message { - margin: 0 0 16px 8px; - border-width: 1px; - border-style: solid; - padding: 12px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -#nav { margin: 0 0 0 8px; padding: 16px; } - -#user_pass, #user_login, #user_email { - font-size: 24px; - width: 97%; - padding: 3px; - margin-top: 2px; - margin-right: 6px; - margin-bottom: 16px; - border: 1px solid #e5e5e5; - background: #fbfbfb; -} - -.clear { - clear: both; -} +*{margin:0;padding:0;}body{border-top-width:30px;border-top-style:solid;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog a{position:absolute;top:7px;left:15px;text-decoration:none;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;} \ No newline at end of file diff --git a/wp-admin/css/login.dev.css b/wp-admin/css/login.dev.css new file mode 100644 index 00000000..842debc1 --- /dev/null +++ b/wp-admin/css/login.dev.css @@ -0,0 +1,129 @@ +* { margin: 0; padding: 0; } + +body { + border-top-width: 30px; + border-top-style: solid; + font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; +} + +form { + margin-left: 8px; + padding: 16px 16px 40px 16px; + font-weight: normal; + -moz-border-radius: 11px; + -khtml-border-radius: 11px; + -webkit-border-radius: 11px; + border-radius: 5px; + background: #fff; + border: 1px solid #e5e5e5; + -moz-box-shadow: rgba(200,200,200,1) 0 4px 18px; + -webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px; + -khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px; + box-shadow: rgba(200,200,200,1) 0 4px 18px; +} + +form .forgetmenot { + font-weight: normal; + float: left; + margin-bottom: 0; +} + +.button-primary { + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + padding: 3px 10px; + border: none; + font-size: 12px; + border-width: 1px; + border-style: solid; + -moz-border-radius: 11px; + -khtml-border-radius: 11px; + -webkit-border-radius: 11px; + border-radius: 11px; + cursor: pointer; + text-decoration: none; + margin-top: -3px; +} + +#login form p { + margin-bottom: 0; +} + +label { + color: #777; + font-size: 13px; +} + +form .forgetmenot label { + font-size: 11px; + line-height: 19px; +} + +form .submit, +.alignright { + float: right; +} + +form p { + margin-bottom: 24px; +} + +h1 a { + background: url(../images/logo-login.gif) no-repeat top center; + width: 326px; + height: 67px; + text-indent: -9999px; + overflow: hidden; + padding-bottom: 15px; + display: block; +} + +#nav { + text-shadow: rgba(255,255,255,1) 0 1px 0; +} + +#backtoblog a { + position: absolute; + top: 7px; + left: 15px; + text-decoration: none; +} + +#login { width: 320px; margin: 7em auto; } + +#login_error, +.message { + margin: 0 0 16px 8px; + border-width: 1px; + border-style: solid; + padding: 12px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +#nav { + margin: 0 0 0 8px; + padding: 16px; +} + +#user_pass, +#user_login, +#user_email { + font-size: 24px; + width: 97%; + padding: 3px; + margin-top: 2px; + margin-right: 6px; + margin-bottom: 16px; + border: 1px solid #e5e5e5; + background: #fbfbfb; +} + +input { + color: #555; +} + +.clear { + clear: both; +} diff --git a/wp-admin/css/media-rtl.css b/wp-admin/css/media-rtl.css index 5aeab26f..fed86444 100644 --- a/wp-admin/css/media-rtl.css +++ b/wp-admin/css/media-rtl.css @@ -47,15 +47,7 @@ button.dismiss { border-right-style: none; border-left-style: solid; } -.media-item .pinkynail { - float: right; -} -.describe-toggle-on, -.describe-toggle-off { - float: left; - margin-right: 0; - margin-left: 20px; -} + /* Specific to Uploader */ #media-upload .media-upload-form p { margin: 0 0 1em 1em; diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css index f3ccaf08..3ab802f9 100644 --- a/wp-admin/css/media.css +++ b/wp-admin/css/media.css @@ -1,400 +1 @@ -div#media-upload-header { - margin: 0; - padding: 0 5px; - font-weight: bold; - position: relative; - border-bottom-width: 1px; - border-bottom-style: solid; - height: 2.5em; -} - -body#media-upload ul#sidemenu { - font-weight: normal; - margin: 0 5px; - position: absolute; - left: 0px; - bottom: -1px; -} - -div#media-upload-error { - margin: 1em; - font-weight: bold; -} - -form { - margin: 1em; -} - -#search-filter { - text-align: right; -} - -.media-upload-form label, -.media-upload-form legend { - display: block; - font-weight: bold; - font-size: 13px; - margin-bottom: 0.5em; - margin: 0 0 0.5em 0; -} - -th { - position: relative; -} - -.media-upload-form label.form-help, td.help { - font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif; - font-style: italic; - font-weight: normal; -} - -.media-upload-form p.help { - margin: 0; - padding: 0; -} - -.media-upload-form fieldset { - width: 100%; - border: none; - text-align: justify; - margin: 0 0 1em 0; - padding: 0; -} - -/* specific to the image upload form */ -.align .field label { - display: inline; - padding: 0 0 0 28px; - margin: 0 1em 0 0; -} - -.image-align-none-label { - background: url(../images/align-none.png) no-repeat center left; -} - -.image-align-left-label { - background: url(../images/align-left.png) no-repeat center left; -} - -.image-align-center-label { - background: url(../images/align-center.png) no-repeat center left; -} - -.image-align-right-label { - background: url(../images/align-right.png) no-repeat center left; -} - -tr.image-size td { - width: 460px; -} - -tr.image-size div.image-size-item { - float: left; - width: 25%; - margin: 0; -} - -tr.image-size label { - display: inline; - margin: 0 0 0 1em; -} - -.pinkynail { - max-width: 40px; - max-height: 40px; -} - -#library-form .progress, -#gallery-form .progress, -#flash-upload-ui, -.insert-gallery, -.describe.startopen, -.describe.startclosed { - display: none; -} - -.media-item .thumbnail { - max-width: 128px; - max-height: 128px; -} - -.media-item .pinkynail { - float: left; - margin: 2px; - height: 32px; - max-width: 40px; -} - -thead.media-item-info tr { - background-color: transparent; -} - -thead.media-item-info th, -thead.media-item-info td { - border: none; - margin: 0; -} - -.form-table thead.media-item-info { - border: 8px solid #fff; -} - -abbr.required { - text-decoration: none; - border: none; -} - -.describe label { - display: inline; -} - -.describe td { - vertical-align: middle; - padding: 0 5px 0 0; -} - -.describe td.A1 { - width: 132px; -} - -.describe input[type="text"], -.describe textarea { - width: 460px; - border-width: 1px; - border-style: solid; -} - -.describe-toggle-on, -.describe-toggle-off { - display: block; - line-height: 36px; - float: right; - margin-right: 20px; -} - -.describe-toggle-off { - display: none; -} - -.hidden { - height: 0; - width: 0; - overflow: hidden; - border: none; -} - -/* Specific to Uploader */ - -#media-upload .media-upload-form p { - margin: 0 1em 1em 0; -} - -#media-upload p.ml-submit { - padding: 1em 0; -} - -#media-upload p.help, -#media-upload label.help { - font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif; - font-style: italic; - font-weight: normal; -} - -#media-upload tr.image-size td.field { - text-align: center; -} - -#media-upload #media-items { - border-width: 1px; - border-style: solid; - border-bottom: none; - width: 623px; -} - -#media-upload .media-item { - border-bottom-width: 1px; - border-bottom-style: solid; - min-height: 36px; - width: 100%; -} - -#media-upload .ui-sortable .media-item { - cursor: move; -} - -.filename { - line-height: 36px; - padding: 0 10px; - overflow: hidden; -} - -#media-upload .describe { - padding: 5px; - width: 100%; - clear: both; - cursor: default; -} - -#media-upload .slidetoggle { - border-top-width: 1px; - border-top-style: solid; -} - -#media-upload .describe th.label { - padding-top: .5em; - text-align: left; - min-width: 120px; -} - -#media-upload tr.align td.field { - text-align: center; -} - -#media-upload tr.image-size { - margin-bottom: 1em; - height: 3em; -} - -#media-upload #filter { - width: 623px; -} - -#media-upload #filter .subsubsub { - margin: 8px 0; -} - -#filter .tablenav select { - border-style: solid; - border-width: 1px; - padding: 2px; - vertical-align: top; - width: auto; -} - -#media-upload .del-attachment { - display: none; - margin: 5px 0; -} - -.menu_order { - float: right; - font-size: 11px; - margin: 10px 10px 0; -} - -.menu_order_input { - border: 1px solid #ddd; - font-size: 10px; - padding: 1px; - width: 23px; -} - -.ui-sortable-helper { - background-color: #fff; - border: 1px solid #aaa; - opacity: 0.6; - filter: alpha(opacity=60); -} - -#media-upload th.order-head { - width: 25%; - text-align: center; -} - -#media-upload .widefat { - width: 626px; - border-style: solid solid none; -} - -.sorthelper { - height: 37px; - width: 623px; - display: block; -} - -#gallery-settings th.label { - width: 160px; -} - -#gallery-settings #basic th.label { - padding: 5px 5px 5px 0; -} - -#gallery-settings .title { - clear: both; - padding: 0 0 3px; - border-bottom-style: solid; - border-bottom-width: 1px; - font-family: Georgia,"Times New Roman",Times,serif; - font-size: 1.6em; - border-bottom-color: #DADADA; - color: #5A5A5A; -} - -h3.media-title { - color: #5A5A5A; - font-family: Georgia,"Times New Roman",Times,serif; - font-size: 1.6em; - font-weight: normal; -} - -#gallery-settings .describe td { - vertical-align: middle; - height: 3.5em; -} - -#gallery-settings .describe th.label { - padding-top: .5em; - text-align: left; -} - -#gallery-settings .describe { - padding: 5px; - width: 615px; - clear: both; - cursor: default; -} - -#gallery-settings .describe select { - width: 15em; - border: 1px solid #dfdfdf; -} - -#gallery-settings label, -#gallery-settings legend { - font-size: 13px; - color: #464646; - margin-right: 15px; -} - -#gallery-settings .align .field label { - margin: 0 1.5em 0 0; -} - -#gallery-settings p.ml-submit { - border-top: 1px solid #dfdfdf; -} - -#gallery-settings select#columns { - width: 6em; -} - -#sort-buttons { - font-size: 0.8em; - margin: 3px 25px -8px 0; - text-align: right; - max-width: 625px; -} - -#sort-buttons a { - text-decoration: none; -} - -#sort-buttons #asc, -#sort-buttons #showall { - padding-left: 5px; -} - -#sort-buttons span { - margin-right: 25px; -} +div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 8px 0;}.describe td.error{padding:2px 8px;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{padding:5px;width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.2em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{margin-bottom:1em;height:3em;}#media-upload #filter{width:623px;}#media-upload #filter .subsubsub{margin:8px 0;}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto;}#media-upload .del-attachment{display:none;margin:5px 0;}.menu_order{float:right;font-size:11px;margin:10px 10px 0;}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:20%;text-align:center;}#media-upload th.actions-head{width:25%;text-align:center;}#media-upload a.wp-post-thumbnail{margin:0 20px;}#media-items a.delete{display:block;float:right;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #DADADA;}h3.media-title{font-size:1.6em;}h4.media-sub-title{border-bottom:1px solid #DADADA;font-size:1.3em;margin:12px;padding:0 0 3px;}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5A5A5A;}#gallery-settings .describe td{vertical-align:middle;height:3em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;} \ No newline at end of file diff --git a/wp-admin/css/media.dev.css b/wp-admin/css/media.dev.css new file mode 100644 index 00000000..1c5e6921 --- /dev/null +++ b/wp-admin/css/media.dev.css @@ -0,0 +1,384 @@ +div#media-upload-header { + margin: 0; + padding: 0 5px; + font-weight: bold; + position: relative; + border-bottom-width: 1px; + border-bottom-style: solid; + height: 2.5em; +} + +body#media-upload ul#sidemenu { + font-weight: normal; + margin: 0 5px; + position: absolute; + left: 0px; + bottom: -1px; +} + +div#media-upload-error { + margin: 1em; + font-weight: bold; +} + +form { + margin: 1em; +} + +#search-filter { + text-align: right; +} + +th { + position: relative; +} + +.media-upload-form label.form-help, td.help { + font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif; + font-style: italic; + font-weight: normal; +} + +.media-upload-form p.help { + margin: 0; + padding: 0; +} + +.media-upload-form fieldset { + width: 100%; + border: none; + text-align: justify; + margin: 0 0 1em 0; + padding: 0; +} + +/* specific to the image upload form */ + + +.image-align-none-label { + background: url(../images/align-none.png) no-repeat center left; +} + +.image-align-left-label { + background: url(../images/align-left.png) no-repeat center left; +} + +.image-align-center-label { + background: url(../images/align-center.png) no-repeat center left; +} + +.image-align-right-label { + background: url(../images/align-right.png) no-repeat center left; +} + +tr.image-size td { + width: 460px; +} + +tr.image-size div.image-size-item { + float: left; + width: 25%; + margin: 0; +} + +#library-form .progress, +#gallery-form .progress, +#flash-upload-ui, +.insert-gallery, +.describe.startopen, +.describe.startclosed { + display: none; +} + +.media-item .thumbnail { + max-width: 128px; + max-height: 128px; +} + +thead.media-item-info tr { + background-color: transparent; +} + +thead.media-item-info th, +thead.media-item-info td { + border: none; + margin: 0; +} + +.form-table thead.media-item-info { + border: 8px solid #fff; +} + +abbr.required { + text-decoration: none; + border: none; +} + +.describe label { + display: inline; +} + +.describe td { + vertical-align: middle; + padding: 0 5px 8px 0; +} + +.describe td.error { + padding: 2px 8px; +} + +.describe td.A1 { + width: 132px; +} + +.describe input[type="text"], +.describe textarea { + width: 460px; + border-width: 1px; + border-style: solid; +} + +.hidden { + height: 0; + width: 0; + overflow: hidden; + border: none; +} + +/* Specific to Uploader */ + +#media-upload p.ml-submit { + padding: 1em 0; +} + +#media-upload p.help, +#media-upload label.help { + font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif; + font-style: italic; + font-weight: normal; +} + +#media-upload tr.image-size td.field { + text-align: center; +} + +#media-upload #media-items { + border-width: 1px; + border-style: solid; + border-bottom: none; + width: 623px; +} + +#media-upload .media-item { + border-bottom-width: 1px; + border-bottom-style: solid; + min-height: 36px; + width: 100%; +} + +#media-upload .ui-sortable .media-item { + cursor: move; +} + +.filename { + line-height: 36px; + padding: 0 10px; + overflow: hidden; +} + +#media-upload .describe { + padding: 5px; + width: 100%; + clear: both; + cursor: default; +} + +#media-upload .slidetoggle { + border-top-width: 1px; + border-top-style: solid; +} + +#media-upload .describe th.label { + padding-top: .2em; + text-align: left; + min-width: 120px; +} + +#media-upload tr.align td.field { + text-align: center; +} + +#media-upload tr.image-size { + margin-bottom: 1em; + height: 3em; +} + +#media-upload #filter { + width: 623px; +} + +#media-upload #filter .subsubsub { + margin: 8px 0; +} + +#filter .tablenav select { + border-style: solid; + border-width: 1px; + padding: 2px; + vertical-align: top; + width: auto; +} + +#media-upload .del-attachment { + display: none; + margin: 5px 0; +} + +.menu_order { + float: right; + font-size: 11px; + margin: 10px 10px 0; +} + +.menu_order_input { + border: 1px solid #ddd; + font-size: 10px; + padding: 1px; + width: 23px; +} + +.ui-sortable-helper { + background-color: #fff; + border: 1px solid #aaa; + opacity: 0.6; + filter: alpha(opacity=60); +} + +#media-upload th.order-head { + width: 20%; + text-align: center; +} + +#media-upload th.actions-head { + width: 25%; + text-align: center; +} + +#media-upload a.wp-post-thumbnail { + margin: 0 20px; +} + +#media-items a.delete { + display: block; + float: right; +} + +#media-upload .widefat { + width: 626px; + border-style: solid solid none; +} + +.sorthelper { + height: 37px; + width: 623px; + display: block; +} + +#gallery-settings th.label { + width: 160px; +} + +#gallery-settings #basic th.label { + padding: 5px 5px 5px 0; +} + +#gallery-settings .title { + clear: both; + padding: 0 0 3px; + font-size: 1.6em; + border-bottom: 1px solid #DADADA; +} + +h3.media-title { + font-size: 1.6em; +} + +h4.media-sub-title { + border-bottom: 1px solid #DADADA; + font-size: 1.3em; + margin: 12px; + padding: 0 0 3px; +} + +#gallery-settings .title, +h3.media-title, +h4.media-sub-title { + font-family: Georgia,"Times New Roman",Times,serif; + font-weight: normal; + color: #5A5A5A; +} + +#gallery-settings .describe td { + vertical-align: middle; + height: 3em; +} + +#gallery-settings .describe th.label { + padding-top: .5em; + text-align: left; +} + +#gallery-settings .describe { + padding: 5px; + width: 615px; + clear: both; + cursor: default; +} + +#gallery-settings .describe select { + width: 15em; +} + +#gallery-settings .describe select option, +#gallery-settings .describe td { + padding: 0; +} + +#gallery-settings label, +#gallery-settings legend { + font-size: 13px; + color: #464646; + margin-right: 15px; +} + +#gallery-settings .align .field label { + margin: 0 1.5em 0 0; +} + +#gallery-settings p.ml-submit { + border-top: 1px solid #dfdfdf; +} + +#gallery-settings select#columns { + width: 6em; +} + +#sort-buttons { + font-size: 0.8em; + margin: 3px 25px -8px 0; + text-align: right; + max-width: 625px; +} + +#sort-buttons a { + text-decoration: none; +} + +#sort-buttons #asc, +#sort-buttons #showall { + padding-left: 5px; +} + +#sort-buttons span { + margin-right: 25px; +} diff --git a/wp-admin/css/plugin-install.css b/wp-admin/css/plugin-install.css index 87fc417c..defbb4f2 100644 --- a/wp-admin/css/plugin-install.css +++ b/wp-admin/css/plugin-install.css @@ -1,148 +1 @@ -/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */ -div.star-holder { - position: relative; - height: 19px; - width: 100px; - font-size: 19px; -} - -div.star { - height: 100%; - position: absolute; - top: 0; - left: 0; - background-color: transparent; - letter-spacing: 1ex; - border: none; -} - -.star1 { width: 20%; } -.star2 { width: 40%; } -.star3 { width: 60%; } -.star4 { width: 80%; } -.star5 { width: 100%; } - -.star img, div.star a, div.star a:hover, div.star a:visited { - display: block; - position: absolute; - right: 0; - border: none; - text-decoration: none; -} - -div.star img { - width: 19px; - height: 19px; - border-left: 1px solid #fff; - border-right: 1px solid #fff; -} - -/* Start custom CSS */ -/* Header on thickbox */ -#plugin-information-header { - margin: 0; - padding: 0 5px; - font-weight: bold; - position: relative; - border-bottom-width: 1px; - border-bottom-style: solid; - height: 2.5em; -} -#plugin-information ul#sidemenu { - font-weight: normal; - margin: 0 5px; - position: absolute; - left: 0; - bottom: -1px; -} - -/* Install sidemenu */ -#plugin-information p.action-button { - width: 100%; - padding-bottom: 0; - margin-bottom: 0; - margin-top: 10px; - -moz-border-radius: 3px 0 0 3px; - -webkit-border-top-left-radius: 3px; - -khtml-border-top-left-radius: 3px; - border-top-left-radius: 3px; - -webkit-border-bottom-left-radius: 3px; - -khtml-border-bottom-left-radius: 3px; - border-bottom-left-radius: 3px; -} - -#plugin-information .action-button a { - text-align: center; - font-weight: bold; - text-decoration: none; - display: block; - line-height: 2em; -} - -#plugin-information h2 { - clear: none !important; - margin-right: 200px; -} - -#plugin-information .fyi { - margin: 0 10px 50px; - width: 210px; -} - -#plugin-information .fyi h2 { - font-size: 0.9em; - margin-bottom: 0; - margin-right: 0; -} - -#plugin-information .fyi h2.mainheader { - padding: 5px; - -moz-border-radius-topleft: 3px; - -webkit-border-top-left-radius: 3px; - -khtml-border-top-left-radius: 3px; - border-top-left-radius: 3px; -} - -#plugin-information .fyi ul { - padding: 10px 5px 10px 7px; - margin: 0; - list-style: none; - -moz-border-radius-bottomleft: 3px; - -webkit-border-bottom-left-radius: 3px; - -khtml-border-bottom-left-radius: 3px; - border-bottom-left-radius: 3px; -} - -#plugin-information .fyi li { - margin-right: 0; -} - -#plugin-information #section-holder { - padding: 10px; -} - -#plugin-information .section ul, -#plugin-information .section ol { - margin-left: 16px; - list-style-type: square; - list-style-image: none; -} - -#plugin-information #section-screenshots li img { - vertical-align: text-top; -} - -#plugin-information #section-screenshots li p { - font-style: italic; - padding-left: 20px; - padding-bottom: 2em; -} - -#plugin-information .updated, -#plugin-information pre { - margin-right: 215px; -} - -#plugin-information pre { - padding: 7px; -} +div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em;}#plugin-information h2{clear:none!important;margin-right:200px;}#plugin-information .fyi{margin:0 10px 50px;width:210px;}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0;}#plugin-information .fyi h2.mainheader{padding:5px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .fyi li{margin-right:0;}#plugin-information #section-holder{padding:10px;}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none;}#plugin-information #section-screenshots li img{vertical-align:text-top;}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em;}#plugin-information .updated,#plugin-information pre{margin-right:215px;}#plugin-information pre{padding:7px;} \ No newline at end of file diff --git a/wp-admin/css/plugin-install.dev.css b/wp-admin/css/plugin-install.dev.css new file mode 100644 index 00000000..87fc417c --- /dev/null +++ b/wp-admin/css/plugin-install.dev.css @@ -0,0 +1,148 @@ +/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */ +div.star-holder { + position: relative; + height: 19px; + width: 100px; + font-size: 19px; +} + +div.star { + height: 100%; + position: absolute; + top: 0; + left: 0; + background-color: transparent; + letter-spacing: 1ex; + border: none; +} + +.star1 { width: 20%; } +.star2 { width: 40%; } +.star3 { width: 60%; } +.star4 { width: 80%; } +.star5 { width: 100%; } + +.star img, div.star a, div.star a:hover, div.star a:visited { + display: block; + position: absolute; + right: 0; + border: none; + text-decoration: none; +} + +div.star img { + width: 19px; + height: 19px; + border-left: 1px solid #fff; + border-right: 1px solid #fff; +} + +/* Start custom CSS */ +/* Header on thickbox */ +#plugin-information-header { + margin: 0; + padding: 0 5px; + font-weight: bold; + position: relative; + border-bottom-width: 1px; + border-bottom-style: solid; + height: 2.5em; +} +#plugin-information ul#sidemenu { + font-weight: normal; + margin: 0 5px; + position: absolute; + left: 0; + bottom: -1px; +} + +/* Install sidemenu */ +#plugin-information p.action-button { + width: 100%; + padding-bottom: 0; + margin-bottom: 0; + margin-top: 10px; + -moz-border-radius: 3px 0 0 3px; + -webkit-border-top-left-radius: 3px; + -khtml-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + -khtml-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; +} + +#plugin-information .action-button a { + text-align: center; + font-weight: bold; + text-decoration: none; + display: block; + line-height: 2em; +} + +#plugin-information h2 { + clear: none !important; + margin-right: 200px; +} + +#plugin-information .fyi { + margin: 0 10px 50px; + width: 210px; +} + +#plugin-information .fyi h2 { + font-size: 0.9em; + margin-bottom: 0; + margin-right: 0; +} + +#plugin-information .fyi h2.mainheader { + padding: 5px; + -moz-border-radius-topleft: 3px; + -webkit-border-top-left-radius: 3px; + -khtml-border-top-left-radius: 3px; + border-top-left-radius: 3px; +} + +#plugin-information .fyi ul { + padding: 10px 5px 10px 7px; + margin: 0; + list-style: none; + -moz-border-radius-bottomleft: 3px; + -webkit-border-bottom-left-radius: 3px; + -khtml-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; +} + +#plugin-information .fyi li { + margin-right: 0; +} + +#plugin-information #section-holder { + padding: 10px; +} + +#plugin-information .section ul, +#plugin-information .section ol { + margin-left: 16px; + list-style-type: square; + list-style-image: none; +} + +#plugin-information #section-screenshots li img { + vertical-align: text-top; +} + +#plugin-information #section-screenshots li p { + font-style: italic; + padding-left: 20px; + padding-bottom: 2em; +} + +#plugin-information .updated, +#plugin-information pre { + margin-right: 215px; +} + +#plugin-information pre { + padding: 7px; +} diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css index 2b453567..46590f3c 100644 --- a/wp-admin/css/press-this.css +++ b/wp-admin/css/press-this.css @@ -1,559 +1 @@ -body { - font: 13px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - color: #333; - margin: 0; - padding: 0; -} - -img { - border: none; -} - -/* Header */ -#wphead { - border-top: none; - padding-top: 4px; - background: #444 !important; -} - -.tagchecklist span a { -background: transparent url(../images/xit.gif) no-repeat 0 0; -} - -#poststuff #edButtonPreview, -#poststuff #edButtonHTML { - -moz-border-radius: 3px 3px 0 0; - -webkit-border-top-right-radius: 3px; - -webkit-border-top-left-radius: 3px; - -khtml-border-top-right-radius: 3px; - -khtml-border-top-left-radius: 3px; - border-top-right-radius: 3px; - border-top-left-radius: 3px; - border-style: solid; - border-width: 1px; - cursor: pointer; - display: block; - height: 18px; - margin: 0 5px 0 0; - padding: 0 5px 0; - font-size: 10px; - line-height: 18px; - float: left; -} - -.howto { - margin-top: 2px; - margin-bottom: 3px; - font-size: 11px; - font-style: italic; - display: block; -} - -input.text { - outline-color: -moz-use-text-color; - outline-style: none; - outline-width: medium; - width: 100%; -} - -#message { - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -/* Editor/Main Column */ -div#poststuff { - padding-left: 10px; - margin-top: 10px; -} - -div.zerosize { - border: 0 none; - height: 0; - margin: 0; - overflow: hidden; - padding: 0; - position: absolute; - width: 0; -} - -#poststuff #edButtonPreview.active, -#poststuff #edButtonHTML.active { - display: none; -} - -.posting { - margin-right: 228px; - position: relative; - left: 0; -} - -#side-info-column { - float: right; - width: 218px; - position: absolute; - right: 0; - margin-right: 10px; -} - -#side-info-column .sleeve { - padding-top: 5px; - padding-left: 10px; -} - -#poststuff .inside { - font-size: 11px; - margin: 0 12px 12px; -} - -#poststuff h2, #poststuff h3 { - font-size: 12px; - font-weight: bold; - line-height: 1; - margin: 0 0 10px; - padding: 7px 9px; -} - -h3.tb { - text-shadow: 0 1px 0 #fff; - font-weight: bold; - font-size: 12px; - margin-left: 5px; -} - -#TB_window { - border: 1px solid #333; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -.postbox, -.stuffbox { - margin-bottom: 10px; - border-width: 1px; - border-style: solid; - line-height: 1; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -#title, -.tbtitle { - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - border-style: solid; - border-width: 1px; - font-size: 1.7em; - outline: none; - padding: 3px 4px; - border-color: #dfdfdf; -} - -.tbtitle { - font-size: 12px; - padding: 3px; -} - -#title { - width: 98%; -} - -.editor-container { - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - border: 1px solid #dfdfdf; - background-color: #fff; -} - -.postdivrich { - position: relative; - padding-top: 25px; -} - -#actions { - clear: both; - float: right; - margin-top: -19px; - position: relative; -} - -#extra_fields #actions { - clear: both; - position: relative; - right: 0px; - margin: -24px 0 0; -} - -#actions li { - float: left; - list-style: none; - margin-right: 10px; -} - -#extra_fields .button { - margin-right: 5px; - padding: 3px 6px; - border-radius: 10px; - -webkit-border-radius: 10px; - -khtml-border-radius: 10px; - -moz-border-radius: 10px; -} - -/* Photo Styles */ -.photolist { - margin-top: -10px; -} - -#photo_saving { - margin: 0 8px 8px; - vertical-align: middle; -} - -#img_container { - background-color: #fff; -} -#img_container_container { - overflow: auto; -} - -#extra_fields { - margin-top: 10px; - position: relative; -} - -#extra_fields .postbox { - margin-bottom: 5px; -} - -#extra_fields .titlewrap { - padding: 0; - overflow: auto; - height: 100px; -} - -#img_container { - position: relative; -} - -#img_container a { - display: block; - float: left; - overflow: hidden; - vertical-align: center; -} - -#img_container img, -#img_container a { - width: 68px; - height: 68px; -} - -#img_container img { - border: none; - background-color: #f4f4f4; - cursor: pointer; -} - -#img_container a, -#img_container a:link, -#img_container a:visited { - border: 1px solid #ccc; - display: block; - position: relative; -} - -#img_container a:hover, -#img_container a:active { - border-color: #000; - z-index: 1000; - border-width: 2px; - margin: -1px; -} - -/* Video */ -#embed-code { - width: 100%; - height: 98px; -} - -/* Submit Column */ -#viewsite { - padding: 0; - margin: 0 0 20px 0; - font-size: 10px; - clear: both; -} - -#viewsite .button { - margin: 0; - display: block; -} - -.wp-hidden-children -.wp-hidden-child { - display: none; -} - -#category-adder { - padding: 4px 0; -} - -#category-adder h4 { - margin: 0 0 8px; -} - -#category-add input { - width: 94%; - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 13px; - margin: 1px; - padding: 3px; -} - -#category-add select { - width: 70%; - -x-system-font: none; - border-style: solid; - border-width: 1px; - font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif; - font-size: 12px; - height: 2em; - line-height: 20px; - padding: 2px; - margin: 1px; - vertical-align: top; -} - -#category-add input, -#category-add-sumbit { - width: auto; -} - -/* Categories */ -#categorydiv ul, -#linkcategorydiv ul { - list-style: none; - padding: 0; - margin: 0; -} - -#categorydiv ul.categorychecklist ul { - margin-left: 18px; -} - -#categorydiv div.tabs-panel { - height: 140px; - overflow: auto; -} - -ul.categorychecklist li { - margin: 0; - padding: 0; - line-height: 19px; -} - -/* Tags */ -.tagsdiv .newtag { - margin-right: 5px; -} - -.jaxtag { - clear: both; - margin: 0; -} - -.tagadd { - margin-left: 3px; -} - -.tagchecklist { - margin-top: 3px; - margin-bottom: 1em; - font-size: 12px; - overflow: auto; -} - -.tagchecklist strong { - position: absolute; - font-size: .75em; -} - -.tagchecklist span { - margin-right: .5em; - margin-left: 10px; - display: block; - float: left; - font-size: 11px; - line-height: 1.8em; - white-space: nowrap; - cursor: default; -} - -.tagchecklist span a { - margin: 6px 0 0 -9px; - cursor: pointer; - width: 10px; - height: 10px; - display: block; - float: left; - text-indent: -9999px; - overflow: hidden; - position: absolute; -} - -#content { - width: 96% !important; - margin-left: 1%; - margin-bottom: 10px; - border: 0 none; - height: 365px; -} - -/* Submit */ - -#saving { - display: inline; - vertical-align: middle; -} - -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - text-decoration: none; - font-size: 11px !important; - line-height: 16px; - padding: 2px 8px; - cursor: pointer; - border-width: 1px; - border-style: solid; - -moz-border-radius: 11px; - -khtml-border-radius: 11px; - -webkit-border-radius: 11px; - border-radius: 11px; -} - -.button-primary { - background: #21759B url(../images/button-grad.png) repeat-x scroll left top; - border-color: #21759B; - color: #fff; -} - -.ac_results { - padding: 0; - margin: 0; - list-style: none; - position: absolute; - z-index: 10000; - display: none; - border-width: 1px; - border-style: solid; -} - -.ac_results li { - padding: 2px 5px; - white-space: nowrap; - text-align: left; -} - -.ac_over { - cursor: pointer; -} - -.ac_match { - text-decoration: underline; -} - -#TB_ajaxContent #options { - position: absolute; - top: 20px; - right: 25px; - padding: 5px; -} - -#TB_ajaxContent h3 { - margin-bottom: .25em; -} - -.updated { - margin: 10px 0; - padding: 0; - border-width: 1px; - border-style: solid; - width: 99%; -} - -.updated p, -.error p { - margin: 0.6em 0; - padding: 0 0.6em; -} - -.error a { - text-decoration: underline; -} - -.updated a { - text-decoration: none; - padding-bottom: 2px; -} - -#post_status { - margin-left: 10px; - margin-bottom: 1em; - display: block; -} - -/* Footer */ -#footer { - height: 65px; - display: block; - width: 640px; - padding: 10px 0 0 60px; - margin: 0; - position: absolute; - bottom: 0; - font-size: 12px; -} - -#footer p { - margin: 0; - padding: 7px 0; -} - -#footer p a { - text-decoration: none; -} -#footer p a:hover { - text-decoration: underline; -} - -/* Utility Classes */ -.centered { - text-align: center; -} - -.hidden { - display: none; -} - -.postbox input[type="text"], -.postbox textarea, -.stuffbox input[type="text"], -.stuffbox textarea { - border-width: 1px; - border-style: solid; -} +body{font:13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;color:#333;margin:0;padding:0;min-width:675px;min-height:400px;}img{border:none;}#wphead{border-top:none;padding-top:4px;background:#444!important;}.tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-style:solid;border-width:1px;cursor:pointer;display:block;height:18px;margin:0 5px 0 0;padding:0 5px 0;font-size:10px;line-height:18px;float:left;}.howto{margin-top:2px;margin-bottom:3px;font-size:11px;font-style:italic;display:block;}input.text{outline-color:-moz-use-text-color;outline-style:none;outline-width:medium;width:100%;}#message{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}div#poststuff{margin:10px;}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0;}#poststuff #edButtonPreview.active,#poststuff #edButtonHTML.active{display:none;}.posting{margin-right:212px;position:relative;}#side-info-column{float:right;width:200px;position:relative;right:0;}#side-info-column .sleeve{padding-top:5px;}#poststuff .inside{font-size:11px;margin:8px;}#poststuff h2,#poststuff h3{font-size:12px;font-weight:bold;line-height:1;margin:0;padding:7px 9px;}#tagsdiv-post_tag h3,#categorydiv h3{cursor:pointer;}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px;}#TB_window{border:1px solid #333;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.postbox,.stuffbox{margin-bottom:10px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.stuffbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}.handlediv{float:right;height:26px;width:23px;}#title,.tbtitle{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border-style:solid;border-width:1px;font-size:1.7em;outline:none;padding:3px 4px;border-color:#dfdfdf;}.tbtitle{font-size:12px;padding:3px;}#title{width:97%;}.editor-container{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #dfdfdf;background-color:#fff;}.postdivrich{padding-top:25px;position:relative;}.actions{float:right;margin:-19px 0 0;}#extra-fields .actions{margin:-15px -5px 0 0;}.actions li{float:left;list-style:none;margin-right:10px;}#extra-fields .button{margin-right:5px;padding:3px 6px;border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;}.photolist{margin-top:-10px;}#photo_saving{margin:0 8px 8px;vertical-align:middle;}#img_container{background-color:#fff;}#img_container_container{overflow:auto;}#extra-fields{margin-top:10px;position:relative;}#waiting{margin-top:10px;}#extra-fields .postbox{margin-bottom:5px;}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px;}#img_container a{display:block;float:left;overflow:hidden;vertical-align:center;}#img_container img,#img_container a{width:68px;height:68px;}#img_container img{border:none;background-color:#f4f4f4;cursor:pointer;}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative;}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px;}#embed-code{width:100%;height:98px;}#viewsite{padding:0;margin:0 0 20px 5px;font-size:10px;clear:both;}.wp-hidden-children .wp-hidden-child{display:none;}#category-adder{padding:4px 0;}#category-adder h4{margin:0 0 8px;}#category-add input{width:94%;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;margin:1px;padding:3px;}#category-add select{width:70%;-x-system-font:none;border-style:solid;border-width:1px;font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-size:12px;height:2em;line-height:20px;padding:2px;margin:1px;vertical-align:top;}#category-add input,#category-add-sumbit{width:auto;}#categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}#categorydiv ul.categorychecklist ul{margin-left:18px;}#categorydiv div.tabs-panel{height:140px;overflow:auto;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}.screen-reader-text{display:none;}.tagsdiv .newtag{margin-right:5px;}.jaxtag{clear:both;margin:0;}.tagadd{margin-left:3px;}.tagchecklist{margin-top:3px;margin-bottom:1em;font-size:12px;overflow:auto;}.tagchecklist strong{position:absolute;font-size:.75em;}.tagchecklist span{margin-right:.5em;margin-left:10px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}#content{margin:5px 0;padding:0 5px;border:0 none;height:365px;width:97%!important;}* html .postdivrich{zoom:1;}#saving{display:inline;vertical-align:middle;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:11px!important;line-height:16px;padding:2px 8px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;}.button-primary{background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#21759B;color:#fff;}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid;}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left;}.ac_over{cursor:pointer;}.ac_match{text-decoration:underline;}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px;}#TB_ajaxContent h3{margin-bottom:.25em;}.updated{margin:10px 0;padding:0;border-width:1px;border-style:solid;width:99%;}.updated p,.error p{margin:.6em 0;padding:0 .6em;}.error a{text-decoration:underline;}.updated a{text-decoration:none;padding-bottom:2px;}#post_status{margin-left:10px;margin-bottom:1em;display:block;}#footer{height:65px;display:block;width:640px;padding:10px 0 0 60px;margin:0;position:absolute;bottom:0;font-size:12px;}#footer p{margin:0;padding:7px 0;}#footer p a{text-decoration:none;}#footer p a:hover{text-decoration:underline;}.centered{text-align:center;}.hidden{display:none;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden;}input.newtag ~ div.taghint{visibility:visible;}input.newtag:focus ~ div.taghint{visibility:hidden;} \ No newline at end of file diff --git a/wp-admin/css/press-this.dev.css b/wp-admin/css/press-this.dev.css new file mode 100644 index 00000000..4bb4d5c1 --- /dev/null +++ b/wp-admin/css/press-this.dev.css @@ -0,0 +1,586 @@ + +body { + font: 13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; + color: #333; + margin: 0; + padding: 0; + min-width: 675px; + min-height: 400px; +} + +img { + border: none; +} + +/* Header */ +#wphead { + border-top: none; + padding-top: 4px; + background: #444 !important; +} + +.tagchecklist span a { + background: transparent url(../images/xit.gif) no-repeat 0 0; +} + +#poststuff #edButtonPreview, +#poststuff #edButtonHTML { + -moz-border-radius: 3px 3px 0 0; + -webkit-border-top-right-radius: 3px; + -webkit-border-top-left-radius: 3px; + -khtml-border-top-right-radius: 3px; + -khtml-border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-top-left-radius: 3px; + border-style: solid; + border-width: 1px; + cursor: pointer; + display: block; + height: 18px; + margin: 0 5px 0 0; + padding: 0 5px 0; + font-size: 10px; + line-height: 18px; + float: left; +} + +.howto { + margin-top: 2px; + margin-bottom: 3px; + font-size: 11px; + font-style: italic; + display: block; +} + +input.text { + outline-color: -moz-use-text-color; + outline-style: none; + outline-width: medium; + width: 100%; +} + +#message { + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} + +/* Editor/Main Column */ +div#poststuff { + margin: 10px; +} + +div.zerosize { + border: 0 none; + height: 0; + margin: 0; + overflow: hidden; + padding: 0; + width: 0; +} + +#poststuff #edButtonPreview.active, +#poststuff #edButtonHTML.active { + display: none; +} + +.posting { + margin-right: 212px; + position: relative; +} + +#side-info-column { + float: right; + width: 200px; + position: relative; + right: 0; +} + +#side-info-column .sleeve { + padding-top: 5px; +} + +#poststuff .inside { + font-size: 11px; + margin: 8px; +} + +#poststuff h2,#poststuff h3 { + font-size: 12px; + font-weight: bold; + line-height: 1; + margin: 0; + padding: 7px 9px; +} + +#tagsdiv-post_tag h3, +#categorydiv h3 { + cursor: pointer; +} + +h3.tb { + text-shadow: 0 1px 0 #fff; + font-weight: bold; + font-size: 12px; + margin-left: 5px; +} + +#TB_window { + border: 1px solid #333; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} + +.postbox, +.stuffbox { + margin-bottom: 10px; + border-width: 1px; + border-style: solid; + line-height: 1; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} + +.stuffbox:hover .handlediv { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; +} + +.handlediv { + float: right; + height: 26px; + width: 23px; +} + +#title, +.tbtitle { + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + border-style: solid; + border-width: 1px; + font-size: 1.7em; + outline: none; + padding: 3px 4px; + border-color: #dfdfdf; +} + +.tbtitle { + font-size: 12px; + padding: 3px; +} + +#title { + width: 97%; +} + +.editor-container { + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + border: 1px solid #dfdfdf; + background-color: #fff; +} + +.postdivrich { + padding-top: 25px; + position: relative; +} + +.actions { + float: right; + margin: -19px 0 0; +} + +#extra-fields .actions { + margin: -15px -5px 0 0; +} + +.actions li { + float: left; + list-style: none; + margin-right: 10px; +} + +#extra-fields .button { + margin-right: 5px; + padding: 3px 6px; + border-radius: 10px; + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + -moz-border-radius: 10px; +} + +/* Photo Styles */ +.photolist { + margin-top: -10px; +} + +#photo_saving { + margin: 0 8px 8px; + vertical-align: middle; +} + +#img_container { + background-color: #fff; +} + +#img_container_container { + overflow: auto; +} + +#extra-fields { + margin-top: 10px; + position: relative; +} + +#waiting { + margin-top: 10px; +} + +#extra-fields .postbox { + margin-bottom: 5px; +} + +#extra-fields .titlewrap { + padding: 0; + overflow: auto; + height: 100px; +} + +#img_container a { + display: block; + float: left; + overflow: hidden; + vertical-align: center; +} + +#img_container img, +#img_container a { + width: 68px; + height: 68px; +} + +#img_container img { + border: none; + background-color: #f4f4f4; + cursor: pointer; +} + +#img_container a, +#img_container a:link, +#img_container a:visited { + border: 1px solid #ccc; + display: block; + position: relative; +} + +#img_container a:hover, +#img_container a:active { + border-color: #000; + z-index: 1000; + border-width: 2px; + margin: -1px; +} + +/* Video */ +#embed-code { + width: 100%; + height: 98px; +} + +/* Submit Column */ +#viewsite { + padding: 0; + margin: 0 0 20px 5px; + font-size: 10px; + clear: both; +} + +.wp-hidden-children +.wp-hidden-child { + display: none; +} + +#category-adder { + padding: 4px 0; +} + +#category-adder h4 { + margin: 0 0 8px; +} + +#category-add input { + width: 94%; + font-family: Verdana,Arial,Helvetica,sans-serif; + font-size: 13px; + margin: 1px; + padding: 3px; +} + +#category-add select { + width: 70%; + -x-system-font: none; + border-style: solid; + border-width: 1px; + font-family: "Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif; + font-size: 12px; + height: 2em; + line-height: 20px; + padding: 2px; + margin: 1px; + vertical-align: top; +} + +#category-add input, +#category-add-sumbit { + width: auto; +} + +/* Categories */ +#categorydiv ul, +#linkcategorydiv ul { + list-style: none; + padding: 0; + margin: 0; +} + +#categorydiv ul.categorychecklist ul { + margin-left: 18px; +} + +#categorydiv div.tabs-panel { + height: 140px; + overflow: auto; +} + +ul.categorychecklist li { + margin: 0; + padding: 0; + line-height: 19px; +} + +/* Tags */ +.screen-reader-text { + display: none; +} + +.tagsdiv .newtag { + margin-right: 5px; +} + +.jaxtag { + clear: both; + margin: 0; +} + +.tagadd { + margin-left: 3px; +} + +.tagchecklist { + margin-top: 3px; + margin-bottom: 1em; + font-size: 12px; + overflow: auto; +} + +.tagchecklist strong { + position: absolute; + font-size: .75em; +} + +.tagchecklist span { + margin-right: .5em; + margin-left: 10px; + display: block; + float: left; + font-size: 11px; + line-height: 1.8em; + white-space: nowrap; + cursor: default; +} + +.tagchecklist span a { + margin: 6px 0 0 -9px; + cursor: pointer; + width: 10px; + height: 10px; + display: block; + float: left; + text-indent: -9999px; + overflow: hidden; + position: absolute; +} + +#content { + margin: 5px 0; + padding: 0 5px; + border: 0 none; + height: 365px; + width: 97% !important; +} + +* html .postdivrich { + zoom: 1; +} + +/* Submit */ +#saving { + display: inline; + vertical-align: middle; +} + +.submit input, +.button, +.button-primary, +.button-secondary, +.button-highlighted, +#postcustomstuff .submit input { + font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; + text-decoration: none; + font-size: 11px !important; + line-height: 16px; + padding: 2px 8px; + cursor: pointer; + border-width: 1px; + border-style: solid; + -moz-border-radius: 11px; + -khtml-border-radius: 11px; + -webkit-border-radius: 11px; + border-radius: 11px; +} + +.button-primary { + background: #21759B url(../images/button-grad.png) repeat-x scroll left top; + border-color: #21759B; + color: #fff; +} + +.ac_results { + padding: 0; + margin: 0; + list-style: none; + position: absolute; + z-index: 10000; + display: none; + border-width: 1px; + border-style: solid; +} + +.ac_results li { + padding: 2px 5px; + white-space: nowrap; + text-align: left; +} + +.ac_over { + cursor: pointer; +} + +.ac_match { + text-decoration: underline; +} + +#TB_ajaxContent #options { + position: absolute; + top: 20px; + right: 25px; + padding: 5px; +} + +#TB_ajaxContent h3 { + margin-bottom: .25em; +} + +.updated { + margin: 10px 0; + padding: 0; + border-width: 1px; + border-style: solid; + width: 99%; +} + +.updated p, +.error p { + margin: 0.6em 0; + padding: 0 0.6em; +} + +.error a { + text-decoration: underline; +} + +.updated a { + text-decoration: none; + padding-bottom: 2px; +} + +#post_status { + margin-left: 10px; + margin-bottom: 1em; + display: block; +} + +/* Footer */ +#footer { + height: 65px; + display: block; + width: 640px; + padding: 10px 0 0 60px; + margin: 0; + position: absolute; + bottom: 0; + font-size: 12px; +} + +#footer p { + margin: 0; + padding: 7px 0; +} + +#footer p a { + text-decoration: none; +} + +#footer p a:hover { + text-decoration: underline; +} + +/* Utility Classes */ +.centered { + text-align: center; +} + +.hidden { + display: none; +} + +.postbox input[type="text"], +.postbox textarea, +.stuffbox input[type="text"], +.stuffbox textarea { + border-width: 1px; + border-style: solid; +} + +/* tag hints */ +.taghint { + color: #aaa; + margin: -17px 0 0 7px; + visibility: hidden; +} + +input.newtag ~ div.taghint { + visibility: visible; +} + +input.newtag:focus ~ div.taghint { + visibility: hidden; +} diff --git a/wp-admin/css/theme-editor.css b/wp-admin/css/theme-editor.css index 0a2a554e..c0bb2dcb 100644 --- a/wp-admin/css/theme-editor.css +++ b/wp-admin/css/theme-editor.css @@ -1,60 +1 @@ -#template textarea { - font-family: Consolas, Monaco, Courier, monospace; - font-size: 12px; - width: 97%; -} - -#template p { - width: 97%; -} - -#templateside { - float: right; - width: 190px; - word-wrap: break-word; -} - -#templateside h3, -#postcustomstuff p.submit { - margin: 0; -} - -#templateside h4 { - margin: 1em 0 0; -} - -#templateside ol, -#templateside ul { - margin: .5em; - padding: 0; -} - -#templateside li { - margin: 4px 0; -} - -.nonessential { - font-size: small; -} - -.highlight { - padding: 1px; -} - -div.tablenav { - margin-right: 210px; -} - -#documentation { - margin-top: 10px; -} -#documentation label { - line-height: 22px; - vertical-align: top; - font-weight: bold; -} - -.fileedit-sub { - padding: 10px 0 8px; - line-height: 180%; -} +#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}.nonessential{font-size:small;}.highlight{padding:1px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;} \ No newline at end of file diff --git a/wp-admin/css/theme-editor.dev.css b/wp-admin/css/theme-editor.dev.css new file mode 100644 index 00000000..0a2a554e --- /dev/null +++ b/wp-admin/css/theme-editor.dev.css @@ -0,0 +1,60 @@ +#template textarea { + font-family: Consolas, Monaco, Courier, monospace; + font-size: 12px; + width: 97%; +} + +#template p { + width: 97%; +} + +#templateside { + float: right; + width: 190px; + word-wrap: break-word; +} + +#templateside h3, +#postcustomstuff p.submit { + margin: 0; +} + +#templateside h4 { + margin: 1em 0 0; +} + +#templateside ol, +#templateside ul { + margin: .5em; + padding: 0; +} + +#templateside li { + margin: 4px 0; +} + +.nonessential { + font-size: small; +} + +.highlight { + padding: 1px; +} + +div.tablenav { + margin-right: 210px; +} + +#documentation { + margin-top: 10px; +} +#documentation label { + line-height: 22px; + vertical-align: top; + font-weight: bold; +} + +.fileedit-sub { + padding: 10px 0 8px; + line-height: 180%; +} diff --git a/wp-admin/css/theme-install.css b/wp-admin/css/theme-install.css index 576dec4b..6ce9918b 100644 --- a/wp-admin/css/theme-install.css +++ b/wp-admin/css/theme-install.css @@ -1,142 +1 @@ -/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */ -div.star-holder { - position: relative; - height: 19px; - width: 100px; - font-size: 19px; -} - -div.star { - height: 100%; - position: absolute; - top: 0; - left: 0; - background-color: transparent; - letter-spacing: 1ex; - border: none; -} - -.star1 { width: 20%; } -.star2 { width: 40%; } -.star3 { width: 60%; } -.star4 { width: 80%; } -.star5 { width: 100%; } - -.star img, div.star a, div.star a:hover, div.star a:visited { - display: block; - position: absolute; - right: 0; - border: none; - text-decoration: none; -} - -div.star img { - width: 19px; - height: 19px; - border-left: 1px solid #fff; - border-right: 1px solid #fff; -} - -.theme-listing .theme-item { - display: inline-block; - width: 200px; - border: thin solid #ccc; - vertical-align: top; -} - -.theme-listing .theme-item h3 { - text-align: center; - font-size: 14px; - font-style: italic; - margin: 0; - padding: 0; -} - -.theme-listing .theme-item img { - max-width: 150px; - max-height: 150px; -} - -.theme-listing .theme-item-info span { - display: none; -} -.theme-listing .theme-item:hover .theme-item-info span { - display: inline; -} -.theme-listing .theme-item:hover .theme-item-info span.dots { - display: none; -} -.theme-listing .theme-item-info span.action-links { - font-weight: bold; - text-align: center; -} - -.theme-listing br.line { - border-bottom-width: 1px; - border-bottom-style: solid; - margin-bottom: 3px; -} - -.available-theme { - padding: 20px 15px; -} - -#theme-information .theme-preview-img { - float: left; - margin: 5px 25px 10px 15px; - width: 300px; -} - -#theme-information .action-button { - border-top-width: 1px; - border-top-style: solid; - margin: 10px 5px 20px; -} - -#theme-information .action-button #cancel { - float: left; - margin: 10px 15px; -} - -#theme-information .action-button #install { - float: right; - margin: 10px 15px; -} - -#theme-information .available-theme h3 { - margin: 1em 0; -} - -body#theme-information { - height: auto; -} - -.feature-filter { - -moz-border-radius: 8px; - -khtml-border-radius: 8px; - -webkit-border-radius: 8px; - border-radius: 8px; - border-width: 1px; - border-style: solid; - padding: 8px 12px 0; -} - -.feature-filter .feature-group { - float: left; - margin-bottom: 20px; - width: 695px; -} - -.feature-filter .feature-name { - float: left; - text-align: right; - width: 95px; -} - -.feature-filter .feature-group li { - display: inline; - float: left; - list-style-type: none; - padding-right: 25px; - min-width: 145px; -} +div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}.theme-listing .theme-item{display:inline-block;width:200px;border:thin solid #ccc;vertical-align:top;}.theme-listing .theme-item h3{text-align:center;font-size:14px;font-style:italic;margin:0;padding:0;}.theme-listing .theme-item img{max-width:150px;max-height:150px;}.theme-listing .theme-item-info span{display:none;}.theme-listing .theme-item:hover .theme-item-info span{display:inline;}.theme-listing .theme-item:hover .theme-item-info span.dots{display:none;}.theme-listing .theme-item-info span.action-links{font-weight:bold;text-align:center;}.theme-listing br.line{border-bottom-width:1px;border-bottom-style:solid;margin-bottom:3px;}.available-theme{padding:20px 15px;}#theme-information .theme-preview-img{float:left;margin:5px 25px 10px 15px;width:300px;}#theme-information .action-button{border-top-width:1px;border-top-style:solid;margin:10px 5px 20px;}#theme-information .action-button #cancel{float:left;margin:10px 15px;}#theme-information .action-button #install{float:right;margin:10px 15px;}#theme-information .available-theme h3{margin:1em 0;}body#theme-information{height:auto;}.feature-filter{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;padding:8px 12px 0;}.feature-filter .feature-group{float:left;margin-bottom:20px;width:695px;}.feature-filter .feature-name{float:left;text-align:right;width:95px;}.feature-filter .feature-group li{display:inline;float:left;list-style-type:none;padding-right:25px;min-width:145px;} \ No newline at end of file diff --git a/wp-admin/css/theme-install.dev.css b/wp-admin/css/theme-install.dev.css new file mode 100644 index 00000000..576dec4b --- /dev/null +++ b/wp-admin/css/theme-install.dev.css @@ -0,0 +1,142 @@ +/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */ +div.star-holder { + position: relative; + height: 19px; + width: 100px; + font-size: 19px; +} + +div.star { + height: 100%; + position: absolute; + top: 0; + left: 0; + background-color: transparent; + letter-spacing: 1ex; + border: none; +} + +.star1 { width: 20%; } +.star2 { width: 40%; } +.star3 { width: 60%; } +.star4 { width: 80%; } +.star5 { width: 100%; } + +.star img, div.star a, div.star a:hover, div.star a:visited { + display: block; + position: absolute; + right: 0; + border: none; + text-decoration: none; +} + +div.star img { + width: 19px; + height: 19px; + border-left: 1px solid #fff; + border-right: 1px solid #fff; +} + +.theme-listing .theme-item { + display: inline-block; + width: 200px; + border: thin solid #ccc; + vertical-align: top; +} + +.theme-listing .theme-item h3 { + text-align: center; + font-size: 14px; + font-style: italic; + margin: 0; + padding: 0; +} + +.theme-listing .theme-item img { + max-width: 150px; + max-height: 150px; +} + +.theme-listing .theme-item-info span { + display: none; +} +.theme-listing .theme-item:hover .theme-item-info span { + display: inline; +} +.theme-listing .theme-item:hover .theme-item-info span.dots { + display: none; +} +.theme-listing .theme-item-info span.action-links { + font-weight: bold; + text-align: center; +} + +.theme-listing br.line { + border-bottom-width: 1px; + border-bottom-style: solid; + margin-bottom: 3px; +} + +.available-theme { + padding: 20px 15px; +} + +#theme-information .theme-preview-img { + float: left; + margin: 5px 25px 10px 15px; + width: 300px; +} + +#theme-information .action-button { + border-top-width: 1px; + border-top-style: solid; + margin: 10px 5px 20px; +} + +#theme-information .action-button #cancel { + float: left; + margin: 10px 15px; +} + +#theme-information .action-button #install { + float: right; + margin: 10px 15px; +} + +#theme-information .available-theme h3 { + margin: 1em 0; +} + +body#theme-information { + height: auto; +} + +.feature-filter { + -moz-border-radius: 8px; + -khtml-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + border-width: 1px; + border-style: solid; + padding: 8px 12px 0; +} + +.feature-filter .feature-group { + float: left; + margin-bottom: 20px; + width: 695px; +} + +.feature-filter .feature-name { + float: left; + text-align: right; + width: 95px; +} + +.feature-filter .feature-group li { + display: inline; + float: left; + list-style-type: none; + padding-right: 25px; + min-width: 145px; +} diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css index c896f5b0..bd15ffa4 100644 --- a/wp-admin/css/widgets.css +++ b/wp-admin/css/widgets.css @@ -1,365 +1 @@ -html, -body { - min-width: 950px; -} - -/* 2 column liquid layout */ -div.widget-liquid-left { - float: left; - clear: left; - width: 100%; - margin-right: -325px; -} - -div#widgets-left { - margin-left: 5px; - margin-right: 325px; -} - -div#widgets-right { - width: 285px; - margin: 0 auto; -} - -div.widget-liquid-right { - float: right; - clear: right; - width: 300px; -} - -.widget-liquid-right .widget, -#wp_inactive_widgets .widget { - width: 250px; - margin: 0 auto 20px; - overflow: hidden; -} - -#wp_inactive_widgets .widget { - margin: 0 10px 20px; - float: left; -} - -div.sidebar-name h3 { - margin: 0; - padding: 5px 12px; - font-size: 13px; - height: 19px; - overflow: hidden; - white-space: nowrap; -} - -div.sidebar-name { - background-repeat: repeat-x; - background-position: 0 0; - cursor: pointer; - font-size: 13px; - border-width: 1px; - border-style: solid; - -moz-border-radius-topleft: 8px; - -moz-border-radius-topright: 8px; - -webkit-border-top-right-radius: 8px; - -webkit-border-top-left-radius: 8px; - -khtml-border-top-right-radius: 8px; - -khtml-border-top-left-radius: 8px; - border-top-right-radius: 8px; - border-top-left-radius: 8px; -} - -.js .closed .sidebar-name { - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; - -webkit-border-bottom-right-radius: 8px; - -webkit-border-bottom-left-radius: 8px; - -khtml-border-bottom-right-radius: 8px; - -khtml-border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; - border-bottom-left-radius: 8px; -} - -.widget-liquid-right .widgets-sortables, -#widgets-left .widget-holder { - border-width: 0 1px 1px; - border-style: none solid solid; - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; - -webkit-border-bottom-right-radius: 8px; - -webkit-border-bottom-left-radius: 8px; - -khtml-border-bottom-right-radius: 8px; - -khtml-border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; - border-bottom-left-radius: 8px; -} - -.js .closed .widgets-sortables, -.js .closed .widget-holder { - display: none; -} - -.widget-liquid-right .widgets-sortables { - padding: 15px 0 0; -} - -#available-widgets .widget-holder { - padding: 7px 5px 0; -} - -#wp_inactive_widgets { - padding: 5px 5px 0; -} - -#widget-list .widget { - width: 250px; - margin: 0 10px 15px; - border: 0 none; - float: left; -} - -#widget-list .widget-description { - padding: 5px 8px; -} - -#widget-list .widget-top { - border-width: 1px; - border-style: solid; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -.widget-placeholder { - border-width: 1px; - border-style: dashed; - margin: 0 auto 20px; - height: 26px; - width: 250px; -} - -#wp_inactive_widgets .widget-placeholder { - margin: 0 10px 20px; - float: left; -} - -div.widgets-holder-wrap { - padding: 0; - margin: 10px 0 20px; -} - -#widgets-left #available-widgets { - background-color: transparent; - border: 0 none; -} - -ul#widget-list { - list-style: none; - margin: 0; - padding: 0; - min-height: 100px; -} - -.widget .widget-top { - font-size: 12px; - font-weight: bold; - height: 26px; - overflow: hidden; -} - -.widget-top .widget-title { - padding: 5px 9px; -} - -.widget-top .widget-title-action { - float: right; -} - -a.widget-action { - display: block; - width: 24px; - height: 26px; -} - -#available-widgets a.widget-action { - display: none; -} - -.widget-top a.widget-action { - background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px; -} - -.widget .widget-inside, -.widget .widget-description { - padding: 12px 12px 10px; - font-size: 11px; - line-height: 16px; -} - -.widget-inside, -.widget-description { - display: none; -} - -#available-widgets .widget-description { - display: block; -} - -.widget .widget-inside p { - margin: 0 0 1em; - padding: 0; -} - -.widget-title h4 { - margin: 0; - line-height: 1.3; - overflow: hidden; - white-space: nowrap; -} - -.widgets-sortables { - min-height: 90px; -} - -.widget-control-actions { - margin-top: 8px; -} - -.widget-control-actions a { - text-decoration: none; -} - -.widget-control-actions a:hover { - text-decoration: underline; -} - -.widget-control-actions .ajax-feedback { - padding-bottom: 3px; -} - -.widget-control-actions div.alignleft { - margin-top: 6px; -} - -div#sidebar-info { - padding: 0 1em; - margin-bottom: 1em; - font-size: 11px; -} - -.widget-title a, -.widget-title a:hover { - text-decoration: none; - border-bottom: none; -} - -.widget-control-edit { - display: block; - font-size: 11px; - font-weight: normal; - line-height: 26px; - padding: 0 8px 0 0; -} - -a.widget-control-edit { - text-decoration: none; -} - -.widget-control-edit .add, -.widget-control-edit .edit { - display: none; -} - -#available-widgets .widget-control-edit .add, -#widgets-right .widget-control-edit .edit, -#wp_inactive_widgets .widget-control-edit .edit { - display: inline; -} - -.editwidget { - margin: 0 auto 15px; -} - -.editwidget .widget-inside { - display: block; - border-width: 1px; - border-style: solid; - padding: 10px; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -.inactive p.description { - margin: 5px 15px 8px; -} - -#available-widgets p.description { - margin: 0 12px 12px; -} - -.widget-position { - margin-top: 8px; -} - -.inactive { - padding-top: 2px; -} - -.sidebar-name-arrow { - float: right; - height: 29px; - width: 26px; -} - -.widget-title .in-widget-title { - font-size: 11px; - white-space: nowrap; -} - -#removing-widget { - display: none; - font-weight: normal; - padding-left: 15px; - font-size: 12px; -} - -.widget-control-noform, -#access-off, -.widgets_access .widget-action, -.widgets_access .sidebar-name-arrow, -.widgets_access #access-on, -.widgets_access .widget-holder .description { - display: none; -} - -.widgets_access .widget-holder, -.widgets_access #widget-list { - padding-top: 10px; -} - -.widgets_access #access-off { - display: inline; -} - -.widgets_access #wpbody-content .widget-title-action, -.widgets_access #wpbody-content .widget-control-edit, -.widgets_access .closed .widgets-sortables, -.widgets_access .closed .widget-holder { - display: block; -} - -.widgets_access .closed .sidebar-name { - -moz-border-radius-bottomleft: 0; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -khtml-border-bottom-right-radius: 0; - -khtml-border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} - -.widgets_access .sidebar-name, -.widgets_access .widget .widget-top { - cursor: default; -} - +html,body{min-width:950px;}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px;}div#widgets-left{margin-left:5px;margin-right:325px;}div#widgets-right{width:285px;margin:0 auto;}div.widget-liquid-right{float:right;clear:right;width:300px;}.widget-liquid-right .widget,#wp_inactive_widgets .widget,.widget-liquid-right .sidebar-description{width:250px;margin:0 auto 20px;overflow:hidden;}.widget-liquid-right .sidebar-description{margin-bottom:10px;}#wp_inactive_widgets .widget{margin:0 10px 20px;float:left;}div.sidebar-name h3{margin:0;padding:5px 12px;font-size:13px;height:19px;overflow:hidden;white-space:nowrap;}div.sidebar-name{background-repeat:repeat-x;background-position:0 0;cursor:pointer;font-size:13px;border-width:1px;border-style:solid;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;-webkit-border-top-right-radius:8px;-webkit-border-top-left-radius:8px;-khtml-border-top-right-radius:8px;-khtml-border-top-left-radius:8px;border-top-right-radius:8px;border-top-left-radius:8px;}.js .closed .sidebar-name{-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none;}.widget-liquid-right .widgets-sortables{padding:15px 0 0;}#available-widgets .widget-holder{padding:7px 5px 0;}#wp_inactive_widgets{padding:5px 5px 0;}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;float:left;}#widget-list .widget-description{padding:5px 8px;}#widget-list .widget-top{border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:26px;width:250px;}#wp_inactive_widgets .widget-placeholder{margin:0 10px 20px;float:left;}div.widgets-holder-wrap{padding:0;margin:10px 0 20px;}#widgets-left #available-widgets{background-color:transparent;border:0 none;}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px;}.widget .widget-top{font-size:12px;font-weight:bold;height:26px;overflow:hidden;}.widget-top .widget-title{padding:5px 9px;}.widget-top .widget-title-action{float:right;}a.widget-action{display:block;width:24px;height:26px;}#available-widgets a.widget-action{display:none;}.widget-top a.widget-action{background:url("../images/menu-bits.gif") no-repeat scroll 0 -110px;}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:11px;line-height:16px;}.widget-inside,.widget-description{display:none;}#available-widgets .widget-description{display:block;}.widget .widget-inside p{margin:0 0 1em;padding:0;}.widget-title h4{margin:0;line-height:1.3;overflow:hidden;white-space:nowrap;}.widgets-sortables{min-height:90px;}.widget-control-actions{margin-top:8px;}.widget-control-actions a{text-decoration:none;}.widget-control-actions a:hover{text-decoration:underline;}.widget-control-actions .ajax-feedback{padding-bottom:3px;}.widget-control-actions div.alignleft{margin-top:6px;}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:11px;}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:none;}.widget-control-edit{display:block;font-size:11px;font-weight:normal;line-height:26px;padding:0 8px 0 0;}a.widget-control-edit{text-decoration:none;}.widget-control-edit .add,.widget-control-edit .edit{display:none;}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,#wp_inactive_widgets .widget-control-edit .edit{display:inline;}.editwidget{margin:0 auto 15px;}.editwidget .widget-inside{display:block;border-width:1px;border-style:solid;padding:10px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.inactive p.description{margin:5px 15px 8px;}#available-widgets p.description{margin:0 12px 12px;}.widget-position{margin-top:8px;}.inactive{padding-top:2px;}.sidebar-name-arrow{float:right;height:29px;width:26px;}.widget-title .in-widget-title{font-size:11px;white-space:nowrap;}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none;}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px;}.widgets_access #access-off{display:inline;}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block;}.widgets_access .closed .sidebar-name{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default;} \ No newline at end of file diff --git a/wp-admin/css/widgets.dev.css b/wp-admin/css/widgets.dev.css new file mode 100644 index 00000000..4fa2f7d9 --- /dev/null +++ b/wp-admin/css/widgets.dev.css @@ -0,0 +1,370 @@ +html, +body { + min-width: 950px; +} + +/* 2 column liquid layout */ +div.widget-liquid-left { + float: left; + clear: left; + width: 100%; + margin-right: -325px; +} + +div#widgets-left { + margin-left: 5px; + margin-right: 325px; +} + +div#widgets-right { + width: 285px; + margin: 0 auto; +} + +div.widget-liquid-right { + float: right; + clear: right; + width: 300px; +} + +.widget-liquid-right .widget, +#wp_inactive_widgets .widget, +.widget-liquid-right .sidebar-description { + width: 250px; + margin: 0 auto 20px; + overflow: hidden; +} + +.widget-liquid-right .sidebar-description { + margin-bottom: 10px; +} + +#wp_inactive_widgets .widget { + margin: 0 10px 20px; + float: left; +} + +div.sidebar-name h3 { + margin: 0; + padding: 5px 12px; + font-size: 13px; + height: 19px; + overflow: hidden; + white-space: nowrap; +} + +div.sidebar-name { + background-repeat: repeat-x; + background-position: 0 0; + cursor: pointer; + font-size: 13px; + border-width: 1px; + border-style: solid; + -moz-border-radius-topleft: 8px; + -moz-border-radius-topright: 8px; + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + -khtml-border-top-right-radius: 8px; + -khtml-border-top-left-radius: 8px; + border-top-right-radius: 8px; + border-top-left-radius: 8px; +} + +.js .closed .sidebar-name { + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-border-bottom-left-radius: 8px; + -khtml-border-bottom-right-radius: 8px; + -khtml-border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + border-bottom-left-radius: 8px; +} + +.widget-liquid-right .widgets-sortables, +#widgets-left .widget-holder { + border-width: 0 1px 1px; + border-style: none solid solid; + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-border-bottom-left-radius: 8px; + -khtml-border-bottom-right-radius: 8px; + -khtml-border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + border-bottom-left-radius: 8px; +} + +.js .closed .widgets-sortables, +.js .closed .widget-holder { + display: none; +} + +.widget-liquid-right .widgets-sortables { + padding: 15px 0 0; +} + +#available-widgets .widget-holder { + padding: 7px 5px 0; +} + +#wp_inactive_widgets { + padding: 5px 5px 0; +} + +#widget-list .widget { + width: 250px; + margin: 0 10px 15px; + border: 0 none; + float: left; +} + +#widget-list .widget-description { + padding: 5px 8px; +} + +#widget-list .widget-top { + border-width: 1px; + border-style: solid; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} + +.widget-placeholder { + border-width: 1px; + border-style: dashed; + margin: 0 auto 20px; + height: 26px; + width: 250px; +} + +#wp_inactive_widgets .widget-placeholder { + margin: 0 10px 20px; + float: left; +} + +div.widgets-holder-wrap { + padding: 0; + margin: 10px 0 20px; +} + +#widgets-left #available-widgets { + background-color: transparent; + border: 0 none; +} + +ul#widget-list { + list-style: none; + margin: 0; + padding: 0; + min-height: 100px; +} + +.widget .widget-top { + font-size: 12px; + font-weight: bold; + height: 26px; + overflow: hidden; +} + +.widget-top .widget-title { + padding: 5px 9px; +} + +.widget-top .widget-title-action { + float: right; +} + +a.widget-action { + display: block; + width: 24px; + height: 26px; +} + +#available-widgets a.widget-action { + display: none; +} + +.widget-top a.widget-action { + background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px; +} + +.widget .widget-inside, +.widget .widget-description { + padding: 12px 12px 10px; + font-size: 11px; + line-height: 16px; +} + +.widget-inside, +.widget-description { + display: none; +} + +#available-widgets .widget-description { + display: block; +} + +.widget .widget-inside p { + margin: 0 0 1em; + padding: 0; +} + +.widget-title h4 { + margin: 0; + line-height: 1.3; + overflow: hidden; + white-space: nowrap; +} + +.widgets-sortables { + min-height: 90px; +} + +.widget-control-actions { + margin-top: 8px; +} + +.widget-control-actions a { + text-decoration: none; +} + +.widget-control-actions a:hover { + text-decoration: underline; +} + +.widget-control-actions .ajax-feedback { + padding-bottom: 3px; +} + +.widget-control-actions div.alignleft { + margin-top: 6px; +} + +div#sidebar-info { + padding: 0 1em; + margin-bottom: 1em; + font-size: 11px; +} + +.widget-title a, +.widget-title a:hover { + text-decoration: none; + border-bottom: none; +} + +.widget-control-edit { + display: block; + font-size: 11px; + font-weight: normal; + line-height: 26px; + padding: 0 8px 0 0; +} + +a.widget-control-edit { + text-decoration: none; +} + +.widget-control-edit .add, +.widget-control-edit .edit { + display: none; +} + +#available-widgets .widget-control-edit .add, +#widgets-right .widget-control-edit .edit, +#wp_inactive_widgets .widget-control-edit .edit { + display: inline; +} + +.editwidget { + margin: 0 auto 15px; +} + +.editwidget .widget-inside { + display: block; + border-width: 1px; + border-style: solid; + padding: 10px; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} + +.inactive p.description { + margin: 5px 15px 8px; +} + +#available-widgets p.description { + margin: 0 12px 12px; +} + +.widget-position { + margin-top: 8px; +} + +.inactive { + padding-top: 2px; +} + +.sidebar-name-arrow { + float: right; + height: 29px; + width: 26px; +} + +.widget-title .in-widget-title { + font-size: 11px; + white-space: nowrap; +} + +#removing-widget { + display: none; + font-weight: normal; + padding-left: 15px; + font-size: 12px; +} + +.widget-control-noform, +#access-off, +.widgets_access .widget-action, +.widgets_access .sidebar-name-arrow, +.widgets_access #access-on, +.widgets_access .widget-holder .description { + display: none; +} + +.widgets_access .widget-holder, +.widgets_access #widget-list { + padding-top: 10px; +} + +.widgets_access #access-off { + display: inline; +} + +.widgets_access #wpbody-content .widget-title-action, +.widgets_access #wpbody-content .widget-control-edit, +.widgets_access .closed .widgets-sortables, +.widgets_access .closed .widget-holder { + display: block; +} + +.widgets_access .closed .sidebar-name { + -moz-border-radius-bottomleft: 0; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -khtml-border-bottom-right-radius: 0; + -khtml-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.widgets_access .sidebar-name, +.widgets_access .widget .widget-top { + cursor: default; +} + diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 4922eed2..eef8f0cf 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -30,12 +30,18 @@ add_filter('the_title','esc_html'); $alt = ''; $posts_columns = get_column_headers('upload'); $hidden = get_hidden_columns('upload'); -while (have_posts()) : the_post(); + +while ( have_posts() ) : the_post(); + +if ( $is_trash && $post->post_status != 'trash' ) + continue; +elseif ( !$is_trash && $post->post_status == 'trash' ) + continue; + $alt = ( 'alternate' == $alt ) ? '' : 'alternate'; global $current_user; $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); $att_title = _draft_or_post_title(); - ?> post_status ); ?>' valign="top"> @@ -53,7 +59,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { case 'cb': ?> - + ID) ) { ?> $column_display_name ) { ?> >ID, array(80, 60), true ) ) { + if ( $is_trash ) echo $thumb; + else { ?> - $column_display_name ) { case 'media': ?> - >
    + >
    ID))); ?>

    ID) ) + if ( current_user_can('edit_post', $post->ID) && !$is_trash ) $actions['edit'] = '' . __('Edit') . ''; - if ( current_user_can('delete_post', $post->ID) ) - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; - $actions['view'] = '' . __('View') . ''; + if ( current_user_can('delete_post', $post->ID) ) { + if ( $is_trash ) + $actions['untrash'] = "ID) . "'>" . __('Restore') . ""; + elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) + $actions['trash'] = "ID) . "'>" . __('Trash') . ""; + if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) + $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + } + if ( !$is_trash ) + $actions['view'] = '' . __('View') . ''; + $actions = apply_filters( 'media_row_actions', $actions, $post ); $action_count = count($actions); $i = 0; echo '

    '; @@ -158,7 +174,8 @@ foreach ($posts_columns as $column_name => $column_display_name ) { - >  + >
    + $column_display_name ) { + diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php index 27417f6b..53c60b57 100644 --- a/wp-admin/edit-category-form.php +++ b/wp-admin/edit-category-form.php @@ -57,7 +57,6 @@ _fill_empty_category($category);
    - @@ -67,14 +66,14 @@ _fill_empty_category($category); - 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
    + 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'exclude' => $category->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>

    - + diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index dd5f867a..ee23b3e3 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -17,40 +17,33 @@ enqueue_comment_hotkeys_js(); $post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0; -if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spam2'] ) ) && !empty( $_REQUEST['pagegen_timestamp'] ) ) { - check_admin_referer('bulk-spam-delete', '_spam_nonce'); +if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) { + check_admin_referer('bulk-comments'); - $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] ); - if ( current_user_can('moderate_comments')) { - $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); + if ( (isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp']) ) { + $comment_status = $wpdb->escape($_REQUEST['comment_status']); + $delete_time = $wpdb->escape($_REQUEST['pagegen_timestamp']); + $comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" ); + $doaction = 'delete'; + } elseif ( ($_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1) && isset($_REQUEST['delete_comments']) ) { + $comment_ids = $_REQUEST['delete_comments']; + $doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2']; + } elseif ( $_REQUEST['doaction'] == 'undo' && isset($_REQUEST['ids']) ) { + $comment_ids = array_map( 'absint', explode(',', $_REQUEST['ids']) ); + $doaction = $_REQUEST['action']; } else { - $deleted_spam = 0; + wp_redirect($_SERVER['HTTP_REFERER']); } - $redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam; - if ( $post_id ) - $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to ); - wp_redirect( $redirect_to ); -} elseif ( isset($_REQUEST['delete_comments']) && isset($_REQUEST['action']) && ( -1 != $_REQUEST['action'] || -1 != $_REQUEST['action2'] ) ) { - check_admin_referer('bulk-comments'); - $doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2']; - $deleted = $approved = $unapproved = $spammed = 0; - foreach ( (array) $_REQUEST['delete_comments'] as $comment_id) : // Check the permissions on each - $comment_id = (int) $comment_id; + $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0; + + foreach ($comment_ids as $comment_id) { // Check the permissions on each $_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) ); if ( !current_user_can('edit_post', $_post_id) ) continue; switch( $doaction ) { - case 'markspam' : - wp_set_comment_status($comment_id, 'spam'); - $spammed++; - break; - case 'delete' : - wp_set_comment_status($comment_id, 'delete'); - $deleted++; - break; case 'approve' : wp_set_comment_status($comment_id, 'approve'); $approved++; @@ -59,10 +52,48 @@ if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spa wp_set_comment_status($comment_id, 'hold'); $unapproved++; break; + case 'spam' : + wp_spam_comment($comment_id); + $spammed++; + break; + case 'unspam' : + wp_unspam_comment($comment_id); + $unspammed++; + break; + case 'trash' : + wp_trash_comment($comment_id); + $trashed++; + break; + case 'untrash' : + wp_untrash_comment($comment_id); + $untrashed++; + break; + case 'delete' : + wp_delete_comment($comment_id); + $deleted++; + break; } - endforeach; + } + + $redirect_to = 'edit-comments.php'; + + if ( $approved ) + $redirect_to = add_query_arg( 'approved', $approved, $redirect_to ); + if ( $unapproved ) + $redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to ); + if ( $spammed ) + $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to ); + if ( $unspammed ) + $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to ); + if ( $trashed ) + $redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to ); + if ( $untrashed ) + $redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to ); + if ( $deleted ) + $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to ); + if ( $trashed || $spammed ) + $redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to ); - $redirect_to = 'edit-comments.php?deleted=' . $deleted . '&approved=' . $approved . '&spam=' . $spammed . '&unapproved=' . $unapproved; if ( $post_id ) $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to ); if ( isset($_REQUEST['apage']) ) @@ -89,7 +120,7 @@ require_once('admin-header.php'); $mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']); $comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all'; -if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam')) ) +if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) ) $comment_status = 'all'; $comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : ''; @@ -105,26 +136,41 @@ if ( isset($_GET['s']) && $_GET['s'] ) 0 || $deleted > 0 || $spam > 0 ) { +if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) ) { + $approved = isset($_GET['approved']) ? (int) $_GET['approved'] : 0; + $deleted = isset($_GET['deleted']) ? (int) $_GET['deleted'] : 0; + $trashed = isset($_GET['trashed']) ? (int) $_GET['trashed'] : 0; + $untrashed = isset($_GET['untrashed']) ? (int) $_GET['untrashed'] : 0; + $spammed = isset($_GET['spammed']) ? (int) $_GET['spammed'] : 0; + $unspammed = isset($_GET['unspammed']) ? (int) $_GET['unspammed'] : 0; + + if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 ) { echo '

    '; if ( $approved > 0 ) { printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved ); echo '
    '; } - - if ( $deleted > 0 ) { - printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted ); + if ( $spammed > 0 ) { + printf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ); + $ids = isset($_GET['ids']) ? $_GET['ids'] : 0; + echo ' ' . __('Undo') . '
    '; + } + if ( $unspammed > 0 ) { + printf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed ); echo '
    '; } - - if ( $spam > 0 ) { - printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); + if ( $trashed > 0 ) { + printf( _n( '%s comment moved to the trash.', '%s comments moved to the trash.', $trashed ), $trashed ); + $ids = isset($_GET['ids']) ? $_GET['ids'] : 0; + echo ' ' . __('Undo') . '
    '; + } + if ( $untrashed > 0 ) { + printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed ); + echo '
    '; + } + if ( $deleted > 0 ) { + printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted ); echo '
    '; } @@ -142,13 +188,19 @@ $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments //, number_format_i18n($num_comments->spam) ), "" . number_format_i18n($num_comments->spam) . "") $stati = array( 'all' => _n_noop('All', 'All'), // singular not used - 'moderated' => _n_noop('Pending (%s)', 'Pending (%s)'), + 'moderated' => _n_noop('Pending (%s)', 'Pending (%s)'), 'approved' => _n_noop('Approved', 'Approved'), // singular not used - 'spam' => _n_noop('Spam (%s)', 'Spam (%s)') + 'spam' => _n_noop('Spam (%s)', 'Spam (%s)'), + 'trash' => _n_noop('Trash (%s)', 'Trash (%s)') ); + +if ( !EMPTY_TRASH_DAYS ) + unset($stati['trash']); + $link = 'edit-comments.php'; if ( !empty($comment_type) && 'all' != $comment_type ) $link = add_query_arg( 'comment_type', $comment_type, $link ); + foreach ( $stati as $status => $label ) { $class = ''; @@ -184,10 +236,10 @@ unset($status_links);

    - - + + + + + + + + + + + + - @@ -281,11 +342,13 @@ $page_links = paginate_links( array( - - + + + +
    @@ -339,15 +402,26 @@ if ( $page_links ) - - + + + + + + + + + + + + - - - + + + +
    @@ -383,4 +457,5 @@ if ( $page_links ) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index dadf6c07..bc435ebf 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -18,22 +18,48 @@ if ( !defined('ABSPATH') ) $post_ID = isset($post_ID) ? (int) $post_ID : 0; $action = isset($action) ? $action : ''; -if ( isset($_GET['message']) ) + +$message = false; +if ( isset($_GET['message']) ) { $_GET['message'] = absint( $_GET['message'] ); -$messages[1] = sprintf(__('Post updated. View post'), get_permalink($post_ID)); -$messages[2] = __('Custom field updated.'); -$messages[3] = __('Custom field deleted.'); -$messages[4] = __('Post updated.'); -$messages[6] = sprintf(__('Post published. View post'), get_permalink($post_ID)); -$messages[7] = __('Post saved.'); -$messages[8] = sprintf(__('Post submitted. Preview post'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); -if ( isset($_GET['revision']) ) - $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); + switch ( $_GET['message'] ) { + case 1: + $message = sprintf( __('Post updated. View post'), get_permalink($post_ID) ); + break; + case 2: + $message = __('Custom field updated.'); + break; + case 3: + $message = __('Custom field deleted.'); + break; + case 4: + $message = __('Post updated.'); + break; + case 5: + if ( isset($_GET['revision']) ) + $message = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); + break; + case 6: + $message = sprintf( __('Post published. View post'), get_permalink($post_ID) ); + break; + case 7: + $message = __('Post saved.'); + break; + case 8: + $message = sprintf( __('Post submitted. Preview post'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); + break; + case 9: + // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php + $message = sprintf( __('Post scheduled for: %1$s. Preview post'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ); + break; + case 10: + $message = sprintf( __('Post draft updated. Preview post'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); + break; + } +} $notice = false; -$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. View the autosave.' ); - if ( 0 == $post_ID ) { $form_action = 'post'; $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() @@ -48,7 +74,7 @@ if ( 0 == $post_ID ) { if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { - $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); + $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. View the autosave.' ), get_edit_post_link( $autosave->ID ) ); break; } } @@ -57,246 +83,10 @@ if ( 0 == $post_ID ) { } // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). +require_once('includes/meta-boxes.php'); -/** - * Display post submit form fields. - * - * @since 2.7.0 - * - * @param object $post - */ -function post_submit_meta_box($post) { - global $action; - - $can_publish = current_user_can('publish_posts'); -?> -
    - -
    - - -
    - -
    - -
    -
    -post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> -post_status ) { ?>style="display:none" type="submit" name="save" id="save-post" value="" tabindex="4" class="button button-highlighted" /> -post_status && $can_publish ) { ?> - - -
    - -
    -post_status ) { - $preview_link = esc_url(get_permalink($post->ID)); - $preview_button = __('Preview Changes'); -} else { - $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); - $preview_button = __('Preview'); -} -?> - - -
    - -
    -
    - -
    - -
    - -post_status ) { - case 'private': - _e('Privately Published'); - break; - case 'publish': - _e('Published'); - break; - case 'future': - _e('Scheduled'); - break; - case 'pending': - _e('Pending Review'); - break; - case 'draft': - _e('Draft'); - break; -} -?> - -post_status || 'private' == $post->post_status || $can_publish ) { ?> -post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js" tabindex='4'> - -
    - - - - -
    - - -
    - -
    - post_status ) { - $post->post_password = ''; - $visibility = 'private'; - $visibility_trans = __('Private'); -} elseif ( !empty( $post->post_password ) ) { - $visibility = 'password'; - $visibility_trans = __('Password protected'); -} elseif ( is_sticky( $post->ID ) ) { - $visibility = 'public'; - $visibility_trans = __('Public, Sticky'); -} else { - $visibility = 'public'; - $visibility_trans = __('Public'); -} - -?> - -
    - -ID)); ?> /> - - - - />
    -ID)); ?> tabindex="4" />
    - />
    -
    - />
    - -

    - - -

    -
    - - -
    - - -ID ) { - if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date - $stamp = __('Scheduled for: %1$s'); - } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published - $stamp = __('Published on: %1$s'); - } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified - $stamp = __('Publish immediately'); - } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified - $stamp = __('Schedule for: %1$s'); - } else { // draft, 1 or more saves, date specified - $stamp = __('Publish on: %1$s'); - } - $date = date_i18n( $datef, strtotime( $post->post_date ) ); -} else { // draft (no saves, and thus no date specified) - $stamp = __('Publish immediately'); - $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); -} - -if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> -
    - - - -
    -
    - - -
    -
    -
    - -
    - - - -
    -post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { - if ( current_user_can('publish_posts') ) : - if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> - - - - - - - - - - - - -
    -
    -
    -
    - -helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.'); -?> -
    -
    -
    -

    -
    - - - - - -
    -

    -
    -
    - - -
      -
    • -
    • -
    - - - -
    -
      -ID, false, false, $popular_ids) ?> -
    -
    - - -
    -

    -

    - - 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> - - -

    -
    - -

    -

    -

    -

    - - -

    Learn more about manual excerpts.'); ?>

    -to_ping) ) .'" />'; - if ('' != $post->pinged) { - $pings = '

    '. __('Already pinged:') . '

      '; - $already_pinged = explode("\n", trim($post->pinged)); - foreach ($already_pinged as $pinged_url) { - $pings .= "\n\t
    • " . esc_html($pinged_url) . "
    • "; - } - $pings .= '
    '; - } - -?> -


    ()

    -

    pingbacks, no other action necessary.'); ?>

    - -
    -
    -ID); -list_meta($metadata); -meta_form(); ?> -
    -

    use in your theme.'); ?>

    - - -

    -
    -

    -get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID)); - - if ( 1 > $total ) { - echo '

    ' . __('No comments yet.') . '

    '; - return; - } - - wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); -?> - - - - - - - - -

    - - -post_status || 'private' == $post->post_status ) add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', 'post', 'normal', 'core'); -/** - * Display post slug form fields. - * - * @since 2.6.0 - * - * @param object $post - */ -function post_slug_meta_box($post) { -?> - -post_status && !current_user_can( 'publish_posts' ) ) ) add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core'); $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; -if ( $authors && count( $authors ) > 1 ) : -/** - * Display form field with list of authors. - * - * @since 2.6.0 - * - * @param object $post - */ -function post_author_meta_box($post) { - global $current_user, $user_ID; - $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM - if ( $post->post_author && !in_array($post->post_author, $authors) ) - $authors[] = $post->post_author; -?> - $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> - 1 ) + add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core'); -if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : -/** - * Display list of post revisions. - * - * @since 2.6.0 - * - * @param object $post - */ -function post_revisions_meta_box($post) { - wp_list_post_revisions(); -} -add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core'); -endif; +if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) + add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core'); do_action('do_meta_boxes', 'post', 'normal', $post); do_action('do_meta_boxes', 'post', 'advanced', $post); @@ -547,18 +129,14 @@ require_once('admin-header.php'); ?> - - - -

    - -

    + +

    comment_date ) );
    -comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . esc_js(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ){return true;}return false;\">" . __('Delete') . "\n"; ?> +comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "\n"; ?>
    diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index 691f3266..90dcce66 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -18,13 +18,14 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) { wp_die(__('Cheatin’ uh?')); if ( 'delete' == $doaction ) { - foreach( (array) $_GET['delete'] as $cat_ID ) { - $cat_name = get_term_field('name', $cat_ID, 'link_category'); - $default_cat_id = get_option('default_link_category'); + $cats = (array) $_GET['delete']; + $default_cat_id = get_option('default_link_category'); + foreach( $cats as $cat_ID ) { + $cat_ID = (int) $cat_ID; // Don't delete the default cats. if ( $cat_ID == $default_cat_id ) - wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); + wp_die( sprintf( __("Can’t delete the %s category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) ); wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); } @@ -209,6 +210,7 @@ if ( $page_links )
    +

    diff --git a/wp-admin/edit-link-category-form.php b/wp-admin/edit-link-category-form.php index df1727d6..17db6ef6 100644 --- a/wp-admin/edit-link-category-form.php +++ b/wp-admin/edit-link-category-form.php @@ -79,7 +79,8 @@ _fill_empty_link_category($category); - +
    + diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 11ec684b..7d0c3edc 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -22,319 +22,12 @@ if ( ! empty($link_id) ) { $nonce_action = 'add-bookmark'; } -/** - * Display checked checkboxes attribute for xfn microformat options. - * - * @since 1.0.1 - * - * @param string $class - * @param string $value - * @param mixed $deprecated Not used. - */ -function xfn_check($class, $value = '', $deprecated = '') { - global $link; - - $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; - $rels = preg_split('/\s+/', $link_rel); - - if ('' != $value && in_array($value, $rels) ) { - 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"'; - } -} - -/** - * Display link create form fields. - * - * @since 2.7.0 - * - * @param object $link - */ -function link_submit_meta_box($link) { -?> - - -
      -
    • -
    • -
    - -
    -
      - link_id) ) - wp_link_category_checklist($link->link_id); - else - wp_link_category_checklist(); - ?> -
    -
    - - - -
    -

    - -
    - -
    -

    -

    -

    -
    -

    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - -
    - -
    - - -
    - - - -
    - - - - - - -
    - - - - -
    -
    -

    XFN.'); ?>

    - - - - - - - - - - - - - - - - - - -
      -
    -View page'), get_permalink($post_ID)); -$messages[2] = __('Custom field updated.'); -$messages[3] = __('Custom field deleted.'); -$messages[5] = sprintf(__('Page published. View page'), get_permalink($post_ID)); -$messages[6] = sprintf(__('Page submitted. Preview page'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); -if ( isset($_GET['revision']) ) - $messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); + switch ( $_GET['message'] ) { + case 1: + $message = sprintf( __('Page updated. View page'), get_permalink($post_ID) ); + break; + case 2: + $message = __('Custom field updated.'); + break; + case 3: + $message = __('Custom field deleted.'); + break; + case 4: + $message = sprintf( __('Page published. View page'), get_permalink($post_ID) ); + break; + case 5: + if ( isset($_GET['revision']) ) + $message = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); + break; + case 6: + $message = sprintf( __('Page submitted. Preview page'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); + break; + case 7: + // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php + $message = sprintf( __('Page scheduled for: %1$s. Preview page'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ); + break; + case 8: + $message = sprintf( __('Page draft updated. Preview page'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); + break; + } +} $notice = false; -$notices[1] = __( 'There is an autosave of this page that is more recent than the version below. View the autosave.' ); - if ( 0 == $post_ID) { $form_action = 'post'; $nonce_action = 'add-page'; @@ -46,351 +67,30 @@ if ( 0 == $post_ID) { $form_extra = ""; $autosave = wp_get_post_autosave( $post_ID ); if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) - $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); + $notice = sprintf( __( 'There is an autosave of this page that is more recent than the version below. View the autosave.' ), get_edit_post_link( $autosave->ID ) ); } $temp_ID = (int) $temp_ID; $user_ID = (int) $user_ID; -/** - * Display submit form fields. - * - * @since 2.7.0 - * - * @param object $post - */ -function page_submit_meta_box($post) { - global $action; - - $can_publish = current_user_can('publish_pages'); -?> -
    - -
    - - -
    - -
    - -
    -
    -post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> -post_status ) { ?>style="display:none" type="submit" name="save" id="save-post" value="" tabindex="4" class="button button-highlighted" /> -post_status && $can_publish ) { ?> - - -
    - -
    -post_status ) { - $preview_link = esc_url(get_permalink($post->ID)); - $preview_button = __('Preview Changes'); -} else { - $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); - $preview_button = __('Preview'); -} -?> - - -
    - -
    -
    - -
    - -
    - -post_status ) { - case 'private': - _e('Privately Published'); - break; - case 'publish': - _e('Published'); - break; - case 'future': - _e('Scheduled'); - break; - case 'pending': - _e('Pending Review'); - break; - case 'draft': - _e('Draft'); - break; -} -?> - -post_status || 'private' == $post->post_status || $can_publish ) { ?> -post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js" tabindex='4'> - -
    - - - - - -
    +require_once('includes/meta-boxes.php'); - -
    - -
    - post_status ) { - $post->post_password = ''; - $visibility = 'private'; - $visibility_trans = __('Private'); -} elseif ( !empty( $post->post_password ) ) { - $visibility = 'password'; - $visibility_trans = __('Password protected'); -} else { - $visibility = 'public'; - $visibility_trans = __('Public'); -} - -echo esc_html( $visibility_trans ); ?> - - - -
    - - - - />
    - />
    -
    - />
    - -

    -

    -
    - - -
    - -ID ) { - if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date - $stamp = __('Scheduled for: %1$s'); - } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published - $stamp = __('Published on: %1$s'); - } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified - $stamp = __('Publish immediately'); - } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified - $stamp = __('Schedule for: %1$s'); - } else { // draft, 1 or more saves, date specified - $stamp = __('Publish on: %1$s'); - } - $date = date_i18n( $datef, strtotime( $post->post_date ) ); -} else { // draft (no saves, and thus no date specified) - $stamp = __('Publish immediately'); - $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); -} - -if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> -
    - - -
    -
    - -
    -
    -
    - -
    - - - -
    -post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?> -post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> - - - - - - - - - - - - -
    -
    -
    -
    - -

    -

    -

    -

    - -
    - - $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?> -

    - -
    - -

    - -
    -

    -

    - -
    -ID); - list_meta($metadata); - meta_form(); ?> -
    -
    -

    use in your theme.'); ?>

    - - -

    -

    -

    trackbacks and pingbacks.'); ?>

    - - -id, true, 'page' ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; -if ( $authors && count( $authors ) > 1 ) { - /** - * Display page author form fields, when more than one author exists. - * - * @since 2.6.0 - * - * @param object $post - */ - function page_author_meta_box($post){ - global $current_user, $user_ID; - $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM - if ( $post->post_author && !in_array($post->post_author, $authors) ) - $authors[] = $post->post_author; -?> - $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> - 1 ) + add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', 'page', 'normal', 'core'); -if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : -/** - * Display list of page revisions. - * - * @since 2.6.0 - * - * @param object $post - */ -function page_revisions_meta_box($post) { - wp_list_post_revisions(); -} -add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core'); -endif; +if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) + add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', 'page', 'normal', 'core'); do_action('do_meta_boxes', 'page', 'normal', $post); do_action('do_meta_boxes', 'page', 'advanced', $post); @@ -407,16 +107,12 @@ require_once('admin-header.php');

    - -

    + +

    - -if (isset($mode) && 'bookmarklet' == $mode) - echo ''; -?> diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php index b2fa38b8..afab9553 100644 --- a/wp-admin/edit-pages.php +++ b/wp-admin/edit-pages.php @@ -13,58 +13,86 @@ if ( !current_user_can('edit_pages') ) wp_die(__('Cheatin’ uh?')); // Handle bulk actions -if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { - $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; +if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) { + check_admin_referer('bulk-pages'); + $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); + + if ( strpos($sendback, 'page.php') !== false ) + $sendback = admin_url('page-new.php'); + + if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { + $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']); + $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = %s", $post_status ) ); + $doaction = 'delete'; + } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) { + $post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']); + $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; + } else { + wp_redirect( admin_url('edit-pages.php') ); + } switch ( $doaction ) { - case 'delete': - if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) { - check_admin_referer('bulk-pages'); - $deleted = 0; - foreach( (array) $_GET['post'] as $post_id_del ) { - $post_del = & get_post($post_id_del); - - if ( !current_user_can('delete_page', $post_id_del) ) - wp_die( __('You are not allowed to delete this page.') ); - - if ( $post_del->post_type == 'attachment' ) { - if ( ! wp_delete_attachment($post_id_del) ) - wp_die( __('Error in deleting...') ); - } else { - if ( !wp_delete_post($post_id_del) ) - wp_die( __('Error in deleting...') ); - } - $deleted++; - } + case 'trash': + $trashed = 0; + foreach( (array) $post_ids as $post_id ) { + if ( !current_user_can('delete_page', $post_id) ) + wp_die( __('You are not allowed to move this page to the trash.') ); + + if ( !wp_trash_post($post_id) ) + wp_die( __('Error in moving to trash...') ); + + $trashed++; } + $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback ); break; - case 'edit': - if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) { - check_admin_referer('bulk-pages'); + case 'untrash': + $untrashed = 0; + foreach( (array) $post_ids as $post_id ) { + if ( !current_user_can('delete_page', $post_id) ) + wp_die( __('You are not allowed to restore this page from the trash.') ); + + if ( !wp_untrash_post($post_id) ) + wp_die( __('Error in restoring from trash...') ); - if ( -1 == $_GET['_status'] ) { - $_GET['post_status'] = null; - unset($_GET['_status'], $_GET['post_status']); + $untrashed++; + } + $sendback = add_query_arg('untrashed', $untrashed, $sendback); + break; + case 'delete': + $deleted = 0; + foreach( (array) $post_ids as $post_id ) { + $post_del = & get_post($post_id); + + if ( !current_user_can('delete_page', $post_id) ) + wp_die( __('You are not allowed to delete this page.') ); + + if ( $post_del->post_type == 'attachment' ) { + if ( ! wp_delete_attachment($post_id) ) + wp_die( __('Error in deleting...') ); } else { - $_GET['post_status'] = $_GET['_status']; + if ( !wp_delete_post($post_id) ) + wp_die( __('Error in deleting...') ); } - - $done = bulk_edit_posts($_GET); + $deleted++; + } + $sendback = add_query_arg('deleted', $deleted, $sendback); + break; + case 'edit': + $_GET['post_type'] = 'page'; + $done = bulk_edit_posts($_GET); + + if ( is_array($done) ) { + $done['updated'] = count( $done['updated'] ); + $done['skipped'] = count( $done['skipped'] ); + $done['locked'] = count( $done['locked'] ); + $sendback = add_query_arg( $done, $sendback ); } break; } - $sendback = wp_get_referer(); - if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php'); - elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); - if ( isset($done) ) { - $done['updated'] = count( $done['updated'] ); - $done['skipped'] = count( $done['skipped'] ); - $done['locked'] = count( $done['locked'] ); - $sendback = add_query_arg( $done, $sendback ); - } - if ( isset($deleted) ) - $sendback = add_query_arg('deleted', $deleted, $sendback); + if ( isset($_GET['action']) ) + $sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback ); + wp_redirect($sendback); exit(); } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { @@ -82,9 +110,13 @@ $post_stati = array( // array( adj, noun ) 'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled (%s)', 'Scheduled (%s)', 'page')), 'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review (%s)', 'Pending Review (%s)', 'page')), 'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft (%s)', 'Drafts (%s)', 'page')), - 'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private (%s)', 'Private (%s)', 'page')) + 'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private (%s)', 'Private (%s)', 'page')), + 'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash (%s)', 'Trash (%s)', 'page')) ); +if ( !EMPTY_TRASH_DAYS ) + unset($post_stati['trash']); + $post_stati = apply_filters('page_stati', $post_stati); $query = array('post_type' => 'page', 'orderby' => 'menu_order title', @@ -109,33 +141,40 @@ require_once('admin-header.php'); ?>
    -

    ' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?>

    - +

    ' . __('Undo') . '
    '; + unset($_GET['trashed']); +} +if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { + printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); + unset($_GET['untrashed']); +} +$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] ); ?>

    @@ -145,7 +184,7 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated' - +
      trash; $class = empty($_GET['post_status']) ? ' class="current"' : ''; $status_links[] = "
    • " . sprintf( _nx( 'All (%s)', 'All (%s)', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . ''; foreach ( $post_stati as $status => $label ) { $class = ''; - if ( !in_array($status, $avail_post_stati) ) + if ( !in_array($status, $avail_post_stati) || $num_posts->$status <= 0 ) continue; if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] ) @@ -179,9 +218,7 @@ endif;

      - - - + @@ -191,9 +228,10 @@ endif; $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0; if ( empty($pagenum) ) $pagenum = 1; -$per_page = get_user_option('edit_pages_per_page'); -if ( empty( $per_page ) || $per_page < 0 ) +$per_page = (int) get_user_option( 'edit_pages_per_page', 0, false ); +if ( empty( $per_page ) || $per_page < 1 ) $per_page = 20; +$per_page = apply_filters( 'edit_pages_per_page', $per_page ); $num_pages = ceil($wp_query->post_count / $per_page); $page_links = paginate_links( array( @@ -205,6 +243,8 @@ $page_links = paginate_links( array( 'current' => $pagenum )); +$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash'; + if ( $page_links ) : ?>
      ' . __( 'Displaying %s–%s of %s' ) . '%s', number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), @@ -217,11 +257,21 @@ if ( $page_links ) : ?>
      + + +

      @@ -256,10 +306,20 @@ if ( $page_links )
      + + +

      diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php index 250ba7a3..31f60942 100644 --- a/wp-admin/edit-tag-form.php +++ b/wp-admin/edit-tag-form.php @@ -33,8 +33,7 @@ do_action('edit_tag_form_pre', $tag); ?> - + diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 9f083b98..44b7a8b8 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -27,14 +27,14 @@ if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_ switch($action) { -case 'addtag': +case 'add-tag': check_admin_referer('add-tag'); if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); - $ret = wp_insert_term($_POST['name'], $taxonomy, $_POST); + $ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST); if ( $ret && !is_wp_error( $ret ) ) { wp_redirect('edit-tags.php?message=1#addtag'); } else { @@ -44,6 +44,11 @@ case 'addtag': break; case 'delete': + if ( !isset( $_GET['tag_ID'] ) ) { + wp_redirect("edit-tags.php?taxonomy=$taxonomy"); + exit; + } + $tag_ID = (int) $_GET['tag_ID']; check_admin_referer('delete-tag_' . $tag_ID); @@ -70,8 +75,8 @@ case 'bulk-delete': if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); - $tags = $_GET['delete_tags']; - foreach( (array) $tags as $tag_ID ) { + $tags = (array) $_GET['delete_tags']; + foreach( $tags as $tag_ID ) { wp_delete_term( $tag_ID, $taxonomy); } @@ -155,6 +160,7 @@ if ( isset($_GET['s']) && $_GET['s'] )

      +
      @@ -178,11 +184,11 @@ $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0; if ( empty($pagenum) ) $pagenum = 1; -$tags_per_page = get_user_option('edit_tags_per_page'); -if ( empty($tags_per_page) ) +$tags_per_page = (int) get_user_option( 'edit_tags_per_page', 0, false ); +if ( empty($tags_per_page) || $tags_per_page < 1 ) $tags_per_page = 20; -$tags_per_page = apply_filters('edit_tags_per_page', $tags_per_page); -$tags_per_page = apply_filters('tagsperpage', $tags_per_page); // Old filter +$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page ); +$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter $page_links = paginate_links( array( 'base' => add_query_arg( 'pagenum', '%#%' ), @@ -274,15 +280,14 @@ else

      -
      - - + + - +
      - - + +

      @@ -295,10 +300,10 @@ else
      -

      +

      -

      +

      diff --git a/wp-admin/edit.php b/wp-admin/edit.php index ae5bee9c..dc0d3f2d 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -21,58 +21,85 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag } // Handle bulk actions -if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { - $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; +if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) { + check_admin_referer('bulk-posts'); + $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); + + if ( strpos($sendback, 'post.php') !== false ) + $sendback = admin_url('post-new.php'); + + if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { + $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']); + $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = %s", $post_status ) ); + $doaction = 'delete'; + } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) { + $post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']); + $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; + } else { + wp_redirect( admin_url('edit.php') ); + } switch ( $doaction ) { - case 'delete': - if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) { - check_admin_referer('bulk-posts'); - $deleted = 0; - foreach( (array) $_GET['post'] as $post_id_del ) { - $post_del = & get_post($post_id_del); - - if ( !current_user_can('delete_post', $post_id_del) ) - wp_die( __('You are not allowed to delete this post.') ); - - if ( $post_del->post_type == 'attachment' ) { - if ( ! wp_delete_attachment($post_id_del) ) - wp_die( __('Error in deleting...') ); - } else { - if ( !wp_delete_post($post_id_del) ) - wp_die( __('Error in deleting...') ); - } - $deleted++; - } + case 'trash': + $trashed = 0; + foreach( (array) $post_ids as $post_id ) { + if ( !current_user_can('delete_post', $post_id) ) + wp_die( __('You are not allowed to move this post to the trash.') ); + + if ( !wp_trash_post($post_id) ) + wp_die( __('Error in moving to trash...') ); + + $trashed++; } + $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback ); break; - case 'edit': - if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) { - check_admin_referer('bulk-posts'); + case 'untrash': + $untrashed = 0; + foreach( (array) $post_ids as $post_id ) { + if ( !current_user_can('delete_post', $post_id) ) + wp_die( __('You are not allowed to restore this post from the trash.') ); + + if ( !wp_untrash_post($post_id) ) + wp_die( __('Error in restoring from trash...') ); - if ( -1 == $_GET['_status'] ) { - $_GET['post_status'] = null; - unset($_GET['_status'], $_GET['post_status']); + $untrashed++; + } + $sendback = add_query_arg('untrashed', $untrashed, $sendback); + break; + case 'delete': + $deleted = 0; + foreach( (array) $post_ids as $post_id ) { + $post_del = & get_post($post_id); + + if ( !current_user_can('delete_post', $post_id) ) + wp_die( __('You are not allowed to delete this post.') ); + + if ( $post_del->post_type == 'attachment' ) { + if ( ! wp_delete_attachment($post_id) ) + wp_die( __('Error in deleting...') ); } else { - $_GET['post_status'] = $_GET['_status']; + if ( !wp_delete_post($post_id) ) + wp_die( __('Error in deleting...') ); } + $deleted++; + } + $sendback = add_query_arg('deleted', $deleted, $sendback); + break; + case 'edit': + $done = bulk_edit_posts($_GET); - $done = bulk_edit_posts($_GET); + if ( is_array($done) ) { + $done['updated'] = count( $done['updated'] ); + $done['skipped'] = count( $done['skipped'] ); + $done['locked'] = count( $done['locked'] ); + $sendback = add_query_arg( $done, $sendback ); } break; } - $sendback = wp_get_referer(); - if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php'); - elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php'); - if ( isset($done) ) { - $done['updated'] = count( $done['updated'] ); - $done['skipped'] = count( $done['skipped'] ); - $done['locked'] = count( $done['locked'] ); - $sendback = add_query_arg( $done, $sendback ); - } - if ( isset($deleted) ) - $sendback = add_query_arg('deleted', $deleted, $sendback); + if ( isset($_GET['action']) ) + $sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback ); + wp_redirect($sendback); exit(); } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { @@ -85,6 +112,14 @@ if ( empty($title) ) $parent_file = 'edit.php'; wp_enqueue_script('inline-edit-post'); +$user_posts = false; +if ( !current_user_can('edit_others_posts') ) { + $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = 'post' AND post_status != 'trash' AND post_author = %d", $current_user->ID) ); + $user_posts = true; + if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) ) + $_GET['author'] = $current_user->ID; +} + list($post_stati, $avail_post_stati) = wp_edit_posts_query(); require_once('admin-header.php'); @@ -99,7 +134,7 @@ else
      -

      ' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?>

      @@ -110,7 +145,7 @@ if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET - +

      ' . __('Undo') . '
      '; + unset($_GET['trashed']); +} + +if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { + printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); + unset($_GET['undeleted']); +} + +$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] ); ?>

      -
      +
      ^FHr$Zj8FBJRu$x9smG@3U6dI0RRmXJeGi9gTJ@maQnd>rl*vG zHU#_xL9C*|b6mGK2A%+bPx{{%ZE7{-796DalGXRpa<%dDHTSRvRLm_sT%E10?9E|v z_8!*0t{#q_Fn&(%z30r{;Kfh=yI9)8+T6?D)di+)?`#e5@N#hrgPWu%+BE>c00kLI zZNKaTV}Cz#SyV_x;%>{EH&UEL3{WCTx5t>~8j{B9#KinaXZ18V9$MmE3%g5n^=JSG z8yXW!)I2A80j%j+0W2;W^2`Ai=Ju(~+QYm&fmt~f9$8oFUSj8AMX z)m+3}6IK02Dg(ete$!FlhTPnJ+r@(4T8f>;2bc6^<7# zUfia8tgi%=qDlldt^lJD76~(SVd=WcvGAH36fO%d}32okV4bhkl1@uq(#z zwT>NAU*JvnePsw{H#VRMbH<8Ytr71B&=a=l)1R5e>_$Wj!!G^h^V5)z-G?yZ z$*t_X`ve@{`o~J|ld(pn>|^Le(Dkulq}}d2hi<}5qVHEc8H}hNG1R=&Kl%IbHGVVC zkvH|b?N(jj;7i-zCbV>HGhTQ&oZ9&r6!MwYO)R=v!G8$sT)&w`NXu06i0Cp+;YS7OG(VclUni z9s1%=zw1}DE5osIapnnk_!uTmxO@D-0zp0*{0Oa`2nmC;;oZNe;-LF3T+D4q;I_C5 zZXciGt#D#tJYR+E;kOGuB^Ui#AGE*jgNa=T8RqD<sLLn z|BlK#_qQXLljS;Z&3rgtPzeu;ytYm_D0~ug5OI~%gZsnrxqZ7@;IP?5u9#cOHwY!r zO};bHhm*e^S<%kSfBF};<2e{uJ4)qX%!bIpOL&o~UZbp~(WF{B^N84<^yfHB_p_6Q zCacX1YXlIqTjxv-XBQLTf;4ZGEMOA>Xk5`de1{}fM?wi(m&pOY6P9J2l5SwmD|SI0 zJMKWgmY_ayd^R@(7H|V#KxL)*vKW{NPAhzEa$Y!I^7kd6t_tU>CR&rl*biI0H?14) zQ}BR%s)J(tOf+XWF~165nR+04cPeu#^0V4{?r~nCUdV%d`EpL%Rr|*_=O51_UOg8Z zXl4EfSU%e%Bh>G5#F{(e?>6I?NWr5l#8zhu^J=Tiy{_c!_hqD-!xbrTV$JO9Z zIW;+igb^-iaS(b5KStMX!jGLMnms@-L_PhLi`4)CM=w?i^frYc*bFkCu)=#FCFM}x zc^I)IdJqALXvqx0W~bnjP8P-9EmzTdHk6n0WzOidVt3rHH{!NIFDLL#siTi?X?es; zg%7a8B^5OvQRvvPYhQ1U&!*GeM{2E#-` z&<1yF#47_He=ML+U&cUrmB+(MWwb`Ck)hlaA>McSj@Y)UnYb874}scTOE?BemX6l) zPJdb>hhKHwtOuu!#w;)6{=xA*Z5a%=Z(xNYjHenE>t1j@cBttvN51s)+4uVTY3!rS zu-R?iVE;K&`ug0DxwIiXd5zgOWw=F$Zed<_JG7j({;-= zJwPxKfY|?pqh1|9I@Ckc$3sdUQM2)6pFLAyB~#A99^pVchHozbca8xR-N9(olaTWT zEDWv3WmFhK@U1<*@cS&DGHovWTC+{oHPI+P&lOpC3;vR?fZ26*P|-aPE)tsFWIEF_ zuZ2yg;XnM}=*pxpCHG(-O&aD-3mMa-F$(^Mo{1^)=DX&79`jMC*YOT})I0+QKrBR? z-2>4ePV%02a`Pn<{k9jmk$1R~>svf090;$N?)%ctu2xRjA8aX_5geZSn*UE`QhMI0 zUJgIytTX+^@IrT7x|q8NiuqsLpLJI*KS3s@-?R}h+oHt?q}Qy)VyiqFwA)<{AcZgz zTb#FNN|<5N%QYK`4iHfn>WRw7f5~`*F-a%kI`I&NRy6-&asaZS0qFIuuSH?F+!`Hd z2CIA0Oyi=#C*e^N8LHTbfo}J)8W%FjW5+42^)k+m|4{p+4ocIIwwc>Qu^S0No4`=M z`Ai~&ek^*j@MZaQaYK`)t{>JAh4#}p04)G^iG!IW`uXEWGZt;N^aS$XTX8F{^lqqa zQXyJwlL(CzGo)-fp&S$oL#Vf>iZxv%t~(a+xup10eGS5lGCB=*YJd z53G|~9>I2&JQ1Et)OakphokN^D^!sK5GdrH&l(;o{Gqps*DfXO?AA=t%s4M9mnaw) z9>$zaYO+v?vf)$++V4Jci6rFr|pITL_6zQ)M#szfsQ9? z&Wm5mmzhnSch8XhHM>HEqO)DXC3a5H$W;V%)FbaA%QA|~M z7{!U_u6ujeUKg>$ZV#>D{`8kjTF5R3hNY^^Hzf%v8j0pSv|B~&x8I!57A`t%b*JiS z(UGBPVnKft?l`Li0>Y4D5&6~2WgR`6WBXk{x^4-&2}FepWAwN!zgM7KTUy2&>l+%V z;~tKICA6J$kmq0r-G0I{WKiIvDkh}Oi&13$c-Mf1HE@geDeC!ei3#@d?v~DD5f(N! zk0#gk&gNGi0+G=j=jDlMq1>JG$M@-e7eCx8Q1Y$xfp`N=bkSD{G0n}>ve7Z|;gZDW zmh4s89`%0uH%u`2B#G-#p;<})zDvSc9h2>%C|C-=%gV~qQ>uSq!W^=r%ZQE; z0)FMwQ9@I`%RC>=n3qNh38$#sxE;lmQtkN@mWUm!7IjrWEE7U=>l)Xtk?&$JZnjZf zs{p_rSs35oyxer~mohN)wtBEKg*940c2h)Na3~@3TAU)q#OG=mqvOiYaqurT zL6{ZqUgG2M2!+By%ZvAk6ysCXUAvEI?0D(@d6e2ruCi%OZo6OjBJCCxav=Ozs-R-n7F@`lJEt%&J0Z>tdN=eD8l54-MogomGh6ngCydhzT#{~v8Yz1^6}pj(B_tM) zdaxQ;@eUX+^39ETCzYC!AIuwP7~bL0&a0>rmW?M^kDizH;t?>-ywt&K3VcBsSt4BB&4K>wV9nz_sM^t#R_v1XZpF*^iriT;$vC% z=9K-iK#0g!rLJH7MVtY*g`QTTjPJbq=mSusfH1^~Dut$?luHBC$Jxt@UsZ6#M6pBcE!I89El22<+J=nTfD;Qcjy@X8`V;@WNH`DQvDEZ~FD(U< zb1Cv}If1`?JikqAqXb>#Uv!mkwJ=WvyUWhuzmP+cx9UET9>s;rpPYwIFk?qxrvc;- zJ=W{jpWg;OJT@ax*Tx++O?Kl@!-9+DI_fbD4WTxp#k>-{+Y5_|ir|_KYPuG*;$euH4~}ym z-1(UF3YTzobe<+NW&}<(6J%(${h<{SY5MxDz|>=2NqwVCPV-;&&>ib`#>~vjO&XW! znw5p3ipuYhe5QR8M$My>?v&^6<1w`_zNg{p zuF^<{;^p2NGU40%dmFP!-mOpsr!GoL%N%wBSIC{b;Sxn&axwqKP zjTPnCHJ${(d)X-BpFJuZ>R~zMhR{^+QAOT}{AQ5btQF&;z^Lvxft}kA+Ps*^wY-V$ zA+S#H4w99W47;&-Ari-P$w^;?N3*X~_)oZWhQLE1*{YDYsy(G&?Rr<=-KV(m?sriR znp_2Lwp=wSCVhUToFp+prW}r8mF~=t56eqVmO-}AW@V*YK1&YMlzujY)K&0SKg+-M zR0@*PS*A2H$7^d$CPzeIF4HW_^PihZ_;du6>Lb7N(OMWGYrmW{cXk@=oOMhmc8qz1{=&kdyyl=1MsmK05O~|U*vs0 z+-2tFr!nQWqJ>G(G0K+W;Q{jeGb4rse}#ca9nJ-7LQb7`h+VC0la!fOdN)jTH8XO5 zeFD+<|6(HpEGURqiAwSDfE>GURb>$}Pba#cDI>IvPer^w`sZ>bTN_kVSEriKis1s) zDFw9F8X6i7woCWJy>tm&Z99nE95#MxWo|}NDfDNUQqhuDK}Me~< z(M={iH!Xjg{Th+i(QfD7q=#@D#_Pl}TwYV6IytjfPHK3XF^ow1H8X}bm|^`zWAZT;18ySE{!a}Q^* zI@xgnrXu9NZJWGPSl6ItrSh@3nb|x`{9YPhGV|{ZZZa_d7hYw{Z*jZ+j4L$1SrRsX zQGK>f8JERRk?r!BP}d2oy*IR4)%smUAi|yNPim?$McQP!BbI||8G>putq{Rxj{fQ~ z``5Oz`d>3KCj9qU*t&Ok5B}W^kH5%OxP0tQ?~0lvbivn?C`>d5hKoM4Vd3SOyM#N{NKj>@zZ)4nXnC`1l6MlOTDqjpvfRNotZBimc8V{#U?H#Q&)CHS=`c zEg8nIC#WmV65qr3HiY9krA$Ac>`y@fxu5@HRpC}xW4dDrBqvukvw}=eYjm4+7`@yk z{8BgHl3Bv@CDhT5&E#!uEvr*6I!oYMt&qi|;C|tmIpf{qQ!fAO7%}^mQPo9Cb=OpD zgTvwPo#$F> zjyF8C5`jIjY}VLHOkE0NWyQ5j7HWTpyPu9%uox1iXAl>sD`sM@hWB-6+C>BMNt;7YnBwGuZdHQobu64p55r3!O!dcr>o>%9%kKLLsn+ z*ZB3UT`#UyeH1H>n?9n)|9(%gMI&Mu87`Af+zVkKpz9q`F^?d5|A->iLknsvuYV^D zjzzecGgRKwyr&D%i{N&4KrZ(Lo(vSo(tquz`%#B)$FtnKH(@>_E%e^aydW2KHdpob zXr_wT>H zExX_svwHu`NAXz_2(I}tjM?zX)NKUgyuQEM%BO0-n0redWU4_fL_-vevv>C8ehfPB zftneJ#&%(J|9Hr@i1$SQlwm3C4wWg%1%87Z51F?y1 zJ~Gh>(+T$#aeRFIF2fcN>yAgnYz4S=s0I=~n=uJ(ZE{{dzND0t89V>9(ch1QteaMS z-c}&QsR`aUJ!4>SzdAP8uhLy`68LXB@Da*Uji-8vFd%eYX(oC83HM1HmTtxDyxh@R zhdDPCewKe<$)y>7e1CJ4#>mJB6A_^@4LZRxsy4k4GvZ9U==ismCE~Qet*xz{UseY3 zT@P;hsU^t5VcdG2-BgW3>j(Q-Pk+D;I@HL*VsmKK>xsi#YS&rrzf?5lMwsz@_`S~T9KNUw{FBY{vMoD6VKOJRD-R$)=R0OyfoE!NBt>46`MJ_0n(wkNoL`_sBKQP*?y9r)a={ELq#a9t*t zG&XzJ11Kb$aYOU%scgp5N&dFzHq7QtPfZCG{`AY6buhl%DNKAuPv3LYK5Vs=k((Pr z+HIq_8`@A`ub4G$0!x1#9KbQ??u*_$Y{lzc9_X@AYrZpEG2e`Z|0G^XO)YQVqh)P) zeB9;La;;MGuNxi=NgJEza*4FTYcqMvFhe8I;2q_$1rpQzID_uk1>!*{5_C&ta}nz1 z$FfO4ndEC;H-K@1VX9a`K>;e_wL>GTfp8LdoAkq`!b6BgHS5Qp@XkgN>_@bsLk^8p zKWrL?9U8wi8CKyIuzXu@@!X~XI>hE3Qc-8WhClgN%%a98zepcta+{-zGH&&;*R-SS z=x}|qzOGlv5?E~yeYl^Wnx5V!k-ER$tEidtEtiS_9W=l_aBtISNY}O*%kFmeLr^-I z5z<@JmqHxg-!CJ2v)`cKVDqD%tLyeu?Gv+F=Of7-E&d2l$0{Z-Rn0k-op`C@c)V~k z2$g=gzmql(v=k~uc~VRNEfWtE#Tr`#{ul2iUqrtD^JzNya-%j&0TXNv__(NV_ zY=eP<(S3Y%<>$2Yb@!0Ra$x_lY~6s9K-zG*`Uiu69~V0L2l{5{vYwZCVd`rKzb|>vOO) z=ySMotsfA8(oP$_uwgkGp>_Q|QNY4UCE~>b;u8+2Ct7wI)bjP5i9T0OhbwWm{Hg{6 z{ZDaGkyXA*nfR-mbg@7I2>t7=zpC5*iNXo*Mt@5g8X9_LIpK|$->(czvh7Xewux>D z5yckFa1Ur}kXPBJTE-6}5KG!R-hTZi25{Q&Jd~%D6#B@>2Vx>p3CT6wQ;Go{@3w#DX3OVoWxpLTF-i z^pM}54BLDJn}eexI9btt!bEu-9i3o70}1A<%}opLfoDtcsIwx4PeJF6?ptyKAbxr6 zFOZl9Uwn2Y3f)#U-Z}xze0~SKh}YH7BBD3^ZlW{0<(|8J<)Bzj4FsZgOYdx6lFKHo zy7)FC5UNK{XWll&9BYMES624_SKLmZwEiB$*VWbC ztZG_o^+k4vN$}0)>FE4et2OWY-R5)9dU(0)Dj!Akv>W=a#J;m<`>7xHyB>L>c%J`i z0GR(1EL>b%3Q9_Et@x?lJ&*kQm0vZvs5~htiSj?-x3^~neMjonw)(nY(|^s^5=0BI zpy+o5yhI=nK4pl^)sLlQ1X8a@iJv|_pvXT-?n!;|7N(%-NP<2o8vu-t@b(nbC26QP%2NP#6) za{4QWj?TJee51yN?Er`dIE(?jXM4##o8RMx84^W%4Ks;JNy)M*@Ap+iGhg{~+Wg3z zO|~&VTxkK|+1WIJZR39`kZfdRm;HsU%Jlg4JI72Lr=2S&v-n7vJA>)3f~>`XO)jgb zp^d&M9F=r#G_b^ge2V48i(piL44Ifv0`(+lrPp^i|DuMiPD%R8Gzx1$9@lj$`T#|T zF>?9kQa~+3pT2ZRNhIJ`c{jb=-x++PuC9K}P<;M&KtBNnnee2+iRue`={Sd+Dc1^Q zDaNO?Tql!Ssz&h@lY>PK?6UxPs};~q!Dz3buE=BF8v);|G-$vEtI09b^GLkEb5&qr~bzFj>_Dlf0JzW&_{P~c4EY5cd-rn(;ocj z&&wxM$qBV(_)O&BH{AXljWMOst>4?%R-?@3X ztejl0lYpA95Y0pQArofNeI>#nd(kPEmXb0CWM@EkxmM}%s_*(;k^PdKj*g(;Y#ybh z;O{?wOd8Dlu$zsl|LN!$V~mY`!8!1Tu}osKzNZQJS&!}wQPQql=6L-E0H z+I)`^K*%DNa@$|v`St6UlZK8rt>r%Bp!;hu^cQ+&EA-?6{VyydPZG9*_9iGPDV_E1 z7Tf%A0F$5-+4URn=4EAN-DeZxN89u>3Uas^glpRppN1pA=oK*ZS#9<16zQpcYX>1T zX4h|%!kutct~CW0BVdmIw-!L!FE7`@k;-O(6Ht5-BK5todX`0^k63$UwbZKfso$q1*Lcyr7eHL}Z3K~%a<>QhKCpTecHCU z2Tqw35Xshy9pFtwoR|2qkvcj$X=G9eAO&Qz3n66Xqb6YgkA$1b%g z!p^>hsHk|UL2li!I9934ez4r+8rHWFjd?69iC-peYh^VVL&iL(7yABC0dNC5fI1E~ zHbotB>%)KRq3hPi$ev)){zYc!g{{;ZIvt%JXdgKKP*}j?*|9glu2+5TuS{4jZfk4% zATX0>%t>Jqu**a&b$d#>M?231?|Qg9LJASpvwO9=n9R>PH1=BYzBHWcI}U5@>oRC- zkINF>?M?z`IKD}L4DJZ9rHdF902ro%DmlCYfxrWZ^mKK@x0=^7OTu{mWKC7Xfduw1 znixYO4|dupmaIlQ>v$A9JA2p@;>43mSc+IEVU8YM;C>xj+URF#R^wo>Eqi@(asm)P zjt8Ti#UNF~$cR93*Fow{!gq`Ek@4}%o1dV7^43{J_6_dFVcU_*IcFOP3|$8A=S@S! zewB}U#I7eDe&MKdFHNE z0}EkhGkN~G;@$2>552v;M>;xpfW$?+|JnEr>6z{-EK+l6vw>jkRmKk+M>}ux!vBdl z)ve{DnI#u(mrITsT3YXtlS#Wg+}+)q!E=UvpFr`6oEG7@ED&Z&)biHsY$rxW&;jMV z*BvTHnZI;G!3@whHogO&E#Ffn&NuKHQC)pF0lgt^R-etwQ58KK;{)lC3;nh25e(02 zF8?L&M$po4%9*{F^G0MiVk!X(Aj2W0;4%qH^i@<(X1oDU*WwZr|G9khfWnt(q=rUD z9O_Y?WTUx)R<^d&@^ry7B`hO|?Cfk+Fac9B_Q&cuMrj7C#)pS@EA5xqB#E6|+fU@O z7TW3;BZ!Aodraft ) ? 'draft' : 'publish'; // Clean up content - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); + $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = str_replace('
      ', '
      ', $post_content); @@ -604,7 +609,7 @@ class Blogger_Import { $comment_content = addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) ); // Clean up content - $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content); + $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); @@ -617,6 +622,7 @@ class Blogger_Import { } else { $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content'); + $comment = wp_filter_comment($comment); $comment_id = wp_insert_comment($comment); $this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id; @@ -905,10 +911,19 @@ class AtomParser { var $entry; function AtomParser() { - $this->entry = new AtomEntry(); - $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";'); - $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";'); + } + + function _map_attrs_func( $k, $v ) { + return "$k=\"$v\""; + } + + function _map_xmlns_func( $p, $n ) { + $xd = "xmlns"; + if ( strlen( $n[0] ) > 0 ) + $xd .= ":{$n[0]}"; + + return "{$xd}=\"{$n[1]}\""; } function parse($xml) { @@ -950,12 +965,12 @@ class AtomParser { foreach($attrs as $key => $value) { $attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value); } - $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix))); + $attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix))); if(strlen($attrs_str) > 0) { $attrs_str = " " . $attrs_str; } - $xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0]))); + $xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0]))); if(strlen($xmlns_str) > 0) { $xmlns_str = " " . $xmlns_str; } diff --git a/wp-admin/import/blogware.php b/wp-admin/import/blogware.php index 500a08ba..531ceddc 100644 --- a/wp-admin/import/blogware.php +++ b/wp-admin/import/blogware.php @@ -42,6 +42,10 @@ class BW_Import { echo ''; } + function _normalize_tag( $matches ) { + return '<' . strtolower( $matches[1] ); + } + function import_posts() { global $wpdb, $current_user; @@ -89,7 +93,7 @@ class BW_Import { } // Clean up content - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); + $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = $wpdb->escape($post_content); @@ -129,7 +133,7 @@ class BW_Import { $comment_content = $this->unhtmlentities($comment_content); // Clean up content - $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content); + $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = $wpdb->escape($comment_content); diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php index d6552f76..fcde9b17 100644 --- a/wp-admin/import/dotclear.php +++ b/wp-admin/import/dotclear.php @@ -413,11 +413,7 @@ class Dotclear_Import { $web = "http://".$wpdb->escape($comment_site); $message = $wpdb->escape(textconv ($comment_content)); - if($cinfo = comment_exists($name, $comment_dt)) - { - // Update comments - $ret_id = wp_update_comment(array( - 'comment_ID' => $cinfo, + $comment = array( 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, @@ -426,23 +422,16 @@ class Dotclear_Import { 'comment_date' => $comment_dt, 'comment_date_gmt' => $comment_dt, 'comment_content' => $message, - 'comment_approved' => $comment_approved) - ); - } - else - { + 'comment_approved' => $comment_approved); + $comment = wp_filter_comment($comment); + + if ( $cinfo = comment_exists($name, $comment_dt) ) { + // Update comments + $comment['comment_ID'] = $cinfo; + $ret_id = wp_update_comment($comment); + } else { // Insert comments - $ret_id = wp_insert_comment(array( - 'comment_post_ID' => $comment_post_ID, - 'comment_author' => $name, - 'comment_author_email' => $email, - 'comment_author_url' => $web, - 'comment_author_IP' => $comment_ip, - 'comment_date' => $comment_dt, - 'comment_date_gmt' => $comment_dt, - 'comment_content' => $message, - 'comment_approved' => $comment_approved) - ); + $ret_id = wp_insert_comment($comment); } $dccm2wpcm[$comment_ID] = $ret_id; } @@ -604,7 +593,7 @@ class Dotclear_Import { { echo '

      '.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'

      '; echo '

      '.__('Users').'

      '; - echo '

      '.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, 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 DotClear 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. Every user has the same username, but their passwords are reset to password123. So Login and change it.'), '/wp-login.php').'

      '; + echo '

      '.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, 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 DotClear 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. Every user has the same username, but their passwords are reset to password123. So Log in and change it.'), '/wp-login.php').'

      '; echo '

      '.__('Preserving Authors').'

      '; echo '

      '.__('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.').'

      '; echo '

      '.__('Textile').'

      '; @@ -616,7 +605,7 @@ class Dotclear_Import { echo '
    • '.__('The WordPress support forums').'
    • '; echo '
    • '.__('The Codex (In other words, the WordPress Bible)').'
    • '; echo ''; - echo '

      '.sprintf(__('That’s it! What are you waiting for? Go login!'), '../wp-login.php').'

      '; + echo '

      '.sprintf(__('That’s it! What are you waiting for? Go log in!'), '../wp-login.php').'

      '; } function db_form() diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php index 7e06f67c..47c15d4b 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -63,7 +63,7 @@ class GM_Import {
      + so you need to enter the number of the last GM post here.
      (if you don’t know that number, just log in to your FTP and look it out
      in the entries’ folder)') ?>
      -


      - so you need to enter the number of the last GM post here.
      (if you don’t know that number, just log into your FTP and look it out
      in the entries’ folder)') ?>

      diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php index bfebe718..7acfaa5f 100644 --- a/wp-admin/import/livejournal.php +++ b/wp-admin/import/livejournal.php @@ -324,6 +324,10 @@ class LJ_API_Import { echo '
'; } + function _normalize_tag( $matches ) { + return '<' . strtolower( $matches[1] ); + } + function import_post( $post ) { global $wpdb; @@ -350,7 +354,7 @@ class LJ_API_Import { // Clean up content $post_content = $post['event']; - $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $post_content ); + $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content ); // XHTMLize some tags $post_content = str_replace( '
', '
', $post_content ); $post_content = str_replace( '
', '
', $post_content ); @@ -531,6 +535,7 @@ class LJ_API_Import { // Parse this comment into an array and insert $comment = $this->parse_comment( $comment ); + $comment = wp_filter_comment( $comment ); $id = wp_insert_comment( $comment ); // Clear cache @@ -581,7 +586,7 @@ class LJ_API_Import { $comment_content = wpautop( $comment_content ); $comment_content = str_replace( '
', '
', $comment_content ); $comment_content = str_replace( '
', '
', $comment_content ); - $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $comment_content ); + $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content ); $comment_content = $wpdb->escape( trim( $comment_content ) ); // Get and convert the date @@ -720,7 +725,7 @@ class LJ_API_Import { $this->protected_password = get_option( 'ljapi_protected_password' ); } - // Login to confirm the details are correct + // Log in to confirm the details are correct if ( empty( $this->username ) || empty( $this->password ) ) { ?>

and password so we can download your posts and comments.' ) ?>

diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index 7b750204..548e9ede 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -1,15 +1,15 @@ header(); ?>
-

mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>

+

mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>

@@ -510,5 +510,5 @@ class MT_Import { $mt_import = new MT_Import(); -register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog.'), array ($mt_import, 'dispatch')); +register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or TypePad blog.'), array ($mt_import, 'dispatch')); ?> diff --git a/wp-admin/import/rss.php b/wp-admin/import/rss.php index 9a85df36..0e0928cc 100644 --- a/wp-admin/import/rss.php +++ b/wp-admin/import/rss.php @@ -43,6 +43,10 @@ class RSS_Import { echo '
'; } + function _normalize_tag( $matches ) { + return '<' . strtolower( $matches[1] ); + } + function get_posts() { global $wpdb; @@ -103,7 +107,7 @@ class RSS_Import { } // Clean up content - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); + $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); $post_content = str_replace('
', '
', $post_content); $post_content = str_replace('
', '
', $post_content); diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php index 2cbf36e0..fb472139 100644 --- a/wp-admin/import/textpattern.php +++ b/wp-admin/import/textpattern.php @@ -397,33 +397,24 @@ class Textpattern_Import { $web = $wpdb->escape($web); $message = $wpdb->escape($message); - if($cinfo = comment_exists($name, $posted)) - { + $comment = array( + 'comment_post_ID' => $comment_post_ID, + 'comment_author' => $name, + 'comment_author_IP' => $ip, + 'comment_author_email' => $email, + 'comment_author_url' => $web, + 'comment_date' => $posted, + 'comment_content' => $message, + 'comment_approved' => $comment_approved); + $comment = wp_filter_comment($comment); + + if ( $cinfo = comment_exists($name, $posted) ) { // Update comments - $ret_id = wp_update_comment(array( - 'comment_ID' => $cinfo, - 'comment_post_ID' => $comment_post_ID, - 'comment_author' => $name, - 'comment_author_email' => $email, - 'comment_author_url' => $web, - 'comment_date' => $posted, - 'comment_content' => $message, - 'comment_approved' => $comment_approved) - ); - } - else - { + $comment['comment_ID'] = $cinfo; + $ret_id = wp_update_comment($comment); + } else { // Insert comments - $ret_id = wp_insert_comment(array( - 'comment_post_ID' => $comment_post_ID, - 'comment_author' => $name, - 'comment_author_email' => $email, - 'comment_author_url' => $web, - 'comment_author_IP' => $ip, - 'comment_date' => $posted, - 'comment_content' => $message, - 'comment_approved' => $comment_approved) - ); + $ret_id = wp_insert_comment($comment); } $txpcm2wpcm[$comment_ID] = $ret_id; } @@ -582,7 +573,7 @@ class Textpattern_Import { { echo '

'.__('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.').'

'; echo '

'.__('Users').'

'; - echo '

'.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. Every user has the same username, but their passwords are reset to password123. So Login and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

'; + echo '

'.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. Every user has the same username, but their passwords are reset to password123. So log in and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

'; echo '

'.__('Preserving Authors').'

'; echo '

'.__('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.').'

'; echo '

'.__('Textile').'

'; @@ -594,7 +585,7 @@ class Textpattern_Import { echo '
  • '.__('The WordPress support forums').'
  • '; echo '
  • '.__('The Codex (In other words, the WordPress Bible)').'
  • '; echo ''; - echo '

    '.sprintf(__('That’s it! What are you waiting for? Go login!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; + echo '

    '.sprintf(__('That’s it! What are you waiting for? Go log in!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; } function db_form() diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php index 388b1b6d..83c90acf 100644 --- a/wp-admin/import/wordpress.php +++ b/wp-admin/import/wordpress.php @@ -27,6 +27,7 @@ class WP_Import { var $author_ids = array (); var $tags = array (); var $categories = array (); + var $terms = array (); var $j = -1; var $fetch_attachments = false; @@ -122,6 +123,11 @@ class WP_Import { $this->tags[] = $tag[1]; continue; } + if ( false !== strpos($importline, '') ) { + preg_match('|(.*?)|is', $importline, $term); + $this->terms[] = $term[1]; + continue; + } if ( false !== strpos($importline, '') ) { $this->post = ''; $doing_entry = true; @@ -198,7 +204,6 @@ class WP_Import { function wp_authors_form() { ?> -

    admins entries.'); ?>

    get_wp_authors(); echo ''; wp_nonce_field('import-wordpress'); - echo '
      '; +?> +
        +allow_fetch_attachments() ) { ?>
      -

      @@ -337,6 +343,43 @@ class WP_Import { $tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr); } } + + function process_terms() { + global $wpdb, $wp_taxonomies; + + $custom_taxonomies = $wp_taxonomies; + // get rid of the standard taxonomies + unset( $custom_taxonomies['category'] ); + unset( $custom_taxonomies['post_tag'] ); + unset( $custom_taxonomies['link_category'] ); + + $custom_taxonomies = array_keys( $custom_taxonomies ); + $current_terms = (array) get_terms( $custom_taxonomies, 'get=all' ); + $taxonomies = array(); + foreach ( $current_terms as $term ) { + if ( isset( $_terms[$term->taxonomy] ) ) { + $taxonomies[$term->taxonomy] = array_merge( $taxonomies[$term->taxonomy], array($term->name) ); + } else { + $taxonomies[$term->taxonomy] = array($term->name); + } + } + + while ( $c = array_shift($this->terms) ) { + $term_name = trim($this->get_tag( $c, 'wp:term_name' )); + $term_taxonomy = trim($this->get_tag( $c, 'wp:term_taxonomy' )); + + // If the term exists in the taxonomy we leave it alone + if ( isset($taxonomies[$term_taxonomy] ) && in_array( $term_name, $taxonomies[$term_taxonomy] ) ) + continue; + + $slug = $this->get_tag( $c, 'wp:term_slug' ); + $description = $this->get_tag( $c, 'wp:term_description' ); + + $termarr = compact('slug', 'description'); + + $term_ID = wp_insert_term($term_name, $this->get_tag( $c, 'wp:term_taxonomy' ), $termarr); + } + } function process_author($post) { $author = $this->get_tag( $post, 'dc:creator' ); @@ -357,6 +400,10 @@ class WP_Import { echo '

      '.sprintf(__('All done.').' '.__('Have fun!').'', get_option('home')).'

      '; } + function _normalize_tag( $matches ) { + return '<' . strtolower( $matches[1] ); + } + function process_post($post) { global $wpdb; @@ -378,16 +425,17 @@ class WP_Import { $menu_order = $this->get_tag( $post, 'wp:menu_order' ); $post_type = $this->get_tag( $post, 'wp:post_type' ); $post_password = $this->get_tag( $post, 'wp:post_password' ); + $is_sticky = $this->get_tag( $post, 'wp:is_sticky' ); $guid = $this->get_tag( $post, 'guid' ); $post_author = $this->get_tag( $post, 'dc:creator' ); $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' ); - $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt); + $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt); $post_excerpt = str_replace('
      ', '
      ', $post_excerpt); $post_excerpt = str_replace('
      ', '
      ', $post_excerpt); $post_content = $this->get_tag( $post, 'content:encoded' ); - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); + $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = str_replace('
      ', '
      ', $post_content); @@ -448,6 +496,9 @@ class WP_Import { else { printf(__('Importing post %s...'), stripslashes($post_title)); $comment_post_ID = $post_id = wp_insert_post($postdata); + if ( $post_id && $is_sticky == 1 ) + stick_post( $post_id ); + } if ( is_wp_error( $post_id ) ) @@ -508,25 +559,35 @@ class WP_Import { preg_match_all('|(.*?)|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 this is a new post we can skip the comment_exists() check - if ( !$post_exists || !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++; + $inserted_comments = array(); + if ( $comments) { + foreach ($comments as $comment) { + $comment_id = $this->get_tag( $comment, 'wp:comment_id'); + $newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID; + $newcomments[$comment_id]['comment_author'] = $this->get_tag( $comment, 'wp:comment_author'); + $newcomments[$comment_id]['comment_author_email'] = $this->get_tag( $comment, 'wp:comment_author_email'); + $newcomments[$comment_id]['comment_author_IP'] = $this->get_tag( $comment, 'wp:comment_author_IP'); + $newcomments[$comment_id]['comment_author_url'] = $this->get_tag( $comment, 'wp:comment_author_url'); + $newcomments[$comment_id]['comment_date'] = $this->get_tag( $comment, 'wp:comment_date'); + $newcomments[$comment_id]['comment_date_gmt'] = $this->get_tag( $comment, 'wp:comment_date_gmt'); + $newcomments[$comment_id]['comment_content'] = $this->get_tag( $comment, 'wp:comment_content'); + $newcomments[$comment_id]['comment_approved'] = $this->get_tag( $comment, 'wp:comment_approved'); + $newcomments[$comment_id]['comment_type'] = $this->get_tag( $comment, 'wp:comment_type'); + $newcomments[$comment_id]['comment_parent'] = $this->get_tag( $comment, 'wp:comment_parent'); } - } } + // Sort by comment ID, to make sure comment parents exist (if there at all) + ksort($newcomments); + foreach ($newcomments as $key => $comment) { + // if this is a new post we can skip the comment_exists() check + if ( !$post_exists || !comment_exists($comment['comment_author'], $comment['comment_date']) ) { + if (isset($inserted_comments[$comment['comment_parent']])) + $comment['comment_parent'] = $inserted_comments[$comment['comment_parent']]; + $comment = wp_filter_comment($comment); + $inserted_comments[$key] = wp_insert_comment($comment); + $num_comments++; + } + } + } if ( $num_comments ) printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments); @@ -740,6 +801,7 @@ class WP_Import { $this->get_entries(); $this->process_categories(); $this->process_tags(); + $this->process_terms(); $result = $this->process_posts(); wp_suspend_cache_invalidation(false); $this->backfill_parents(); diff --git a/wp-admin/includes/class-ftp.php b/wp-admin/includes/class-ftp.php index 0bf25e9c..80703a95 100644 --- a/wp-admin/includes/class-ftp.php +++ b/wp-admin/includes/class-ftp.php @@ -278,7 +278,10 @@ class ftp_base { $dns=@gethostbyaddr($host); if(!$ip) $ip=$host; if(!$dns) $dns=$host; - if(ip2long($ip) === -1) { + // Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false + // -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid + $ipaslong = ip2long($ip); + if ( ($ipaslong == false) || ($ipaslong === -1) ) { $this->SendMSG("Wrong host name/address \"".$host."\""); return FALSE; } diff --git a/wp-admin/includes/class-pclzip.php b/wp-admin/includes/class-pclzip.php index 082442dd..5e6a619b 100644 --- a/wp-admin/includes/class-pclzip.php +++ b/wp-admin/includes/class-pclzip.php @@ -1,8 +1,8 @@ magic_quotes_status = -1; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1); return; } // -------------------------------------------------------------------------------- @@ -273,7 +270,6 @@ // -------------------------------------------------------------------------------- function create($p_filelist) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ..."); $v_result=1; // ----- Reset the error handler @@ -285,7 +281,6 @@ // ----- Look for variable options arguments $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Look for arguments if ($v_size > 1) { @@ -298,7 +293,6 @@ // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -315,7 +309,6 @@ //, PCLZIP_OPT_CRYPT => 'optional' )); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } @@ -324,7 +317,6 @@ // Here we need to support the first historic synopsis of the // method. else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; @@ -336,12 +328,11 @@ else if ($v_size > 2) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return 0; } } } - + // ----- Look for default option values $this->privOptionDefaultThreshold($v_options); @@ -350,16 +341,16 @@ $v_att_list = array(); $v_filedescr_list = array(); $p_result_list = array(); - + // ----- Look if the $p_filelist is really an array if (is_array($p_filelist)) { - + // ----- Look if the first element is also an array // This will mean that this is a file description entry if (isset($p_filelist[0]) && is_array($p_filelist[0])) { $v_att_list = $p_filelist; } - + // ----- The list is a list of string names else { $v_string_list = $p_filelist; @@ -375,10 +366,9 @@ // ----- Invalid variable type for $p_filelist else { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } - + // ----- Reformat the string list if (sizeof($v_string_list) != 0) { foreach ($v_string_list as $v_string) { @@ -386,11 +376,10 @@ $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Ignore an empty filename"); } } } - + // ----- For each file in the list check the attributes $v_supported_attributes = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' @@ -406,7 +395,6 @@ $v_options, $v_supported_attributes); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } @@ -414,19 +402,16 @@ // ----- Expand the filelist (expand directories) $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Call the create fct $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); return $p_result_list; } // -------------------------------------------------------------------------------- @@ -468,7 +453,6 @@ // -------------------------------------------------------------------------------- function add($p_filelist) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ..."); $v_result=1; // ----- Reset the error handler @@ -480,7 +464,6 @@ // ----- Look for variable options arguments $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Look for arguments if ($v_size > 1) { @@ -493,7 +476,6 @@ // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -512,7 +494,6 @@ //, PCLZIP_OPT_CRYPT => 'optional' )); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } @@ -521,7 +502,6 @@ // Here we need to support the first historic synopsis of the // method. else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; @@ -535,7 +515,6 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return 0; } } @@ -549,16 +528,16 @@ $v_att_list = array(); $v_filedescr_list = array(); $p_result_list = array(); - + // ----- Look if the $p_filelist is really an array if (is_array($p_filelist)) { - + // ----- Look if the first element is also an array // This will mean that this is a file description entry if (isset($p_filelist[0]) && is_array($p_filelist[0])) { $v_att_list = $p_filelist; } - + // ----- The list is a list of string names else { $v_string_list = $p_filelist; @@ -574,17 +553,16 @@ // ----- Invalid variable type for $p_filelist else { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } - + // ----- Reformat the string list if (sizeof($v_string_list) != 0) { foreach ($v_string_list as $v_string) { $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; } } - + // ----- For each file in the list check the attributes $v_supported_attributes = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' @@ -600,7 +578,6 @@ $v_options, $v_supported_attributes); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } @@ -608,19 +585,16 @@ // ----- Expand the filelist (expand directories) $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Call the create fct $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); return $p_result_list; } // -------------------------------------------------------------------------------- @@ -668,7 +642,6 @@ // -------------------------------------------------------------------------------- function listContent() { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', ""); $v_result=1; // ----- Reset the error handler @@ -676,7 +649,6 @@ // ----- Check archive if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } @@ -685,12 +657,10 @@ if (($v_result = $this->privList($p_list)) != 1) { unset($p_list); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- @@ -729,7 +699,6 @@ // -------------------------------------------------------------------------------- function extract() { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", ""); $v_result=1; // ----- Reset the error handler @@ -737,7 +706,6 @@ // ----- Check archive if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } @@ -750,7 +718,6 @@ // ----- Look for variable options arguments $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Default values for option $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; @@ -762,7 +729,6 @@ // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -787,7 +753,6 @@ PCLZIP_OPT_TEMP_FILE_OFF => 'optional' )); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } @@ -814,7 +779,6 @@ // Here we need to support the first historic synopsis of the // method. else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_path = $v_arg_list[0]; @@ -828,7 +792,6 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return 0; } } @@ -838,7 +801,6 @@ $this->privOptionDefaultThreshold($v_options); // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); // ----- Call the extracting fct $p_list = array(); @@ -846,12 +808,10 @@ $v_remove_all_path, $v_options); if ($v_result < 1) { unset($p_list); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- @@ -896,7 +856,6 @@ //function extractByIndex($p_index, options...) function extractByIndex($p_index) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ..."); $v_result=1; // ----- Reset the error handler @@ -904,7 +863,6 @@ // ----- Check archive if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } @@ -917,7 +875,6 @@ // ----- Look for variable options arguments $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Default values for option $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; @@ -933,7 +890,6 @@ // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, @@ -953,7 +909,6 @@ PCLZIP_OPT_TEMP_FILE_OFF => 'optional' )); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } @@ -976,10 +931,8 @@ } if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set."); } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set."); } } @@ -987,7 +940,6 @@ // Here we need to support the first historic synopsis of the // method. else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); // ----- Get the first argument $v_path = $v_arg_list[0]; @@ -1001,14 +953,12 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return 0; } } } // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); // ----- Trick // Here I want to reuse extractByRule(), so I need to parse the $p_index @@ -1018,7 +968,6 @@ $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, array (PCLZIP_OPT_BY_INDEX => 'optional' )); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; @@ -1028,12 +977,10 @@ // ----- Call the extracting fct if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- @@ -1049,7 +996,7 @@ // Options : // PCLZIP_OPT_BY_INDEX : // PCLZIP_OPT_BY_NAME : - // PCLZIP_OPT_BY_EREG : + // PCLZIP_OPT_BY_EREG : // PCLZIP_OPT_BY_PREG : // Return Values : // 0 on failure, @@ -1058,7 +1005,6 @@ // -------------------------------------------------------------------------------- function delete() { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", ""); $v_result=1; // ----- Reset the error handler @@ -1066,7 +1012,6 @@ // ----- Check archive if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } @@ -1075,7 +1020,6 @@ // ----- Look for variable options arguments $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); // ----- Look for arguments if ($v_size > 0) { @@ -1089,7 +1033,6 @@ PCLZIP_OPT_BY_PREG => 'optional', PCLZIP_OPT_BY_INDEX => 'optional' )); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } } @@ -1102,7 +1045,6 @@ if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { $this->privSwapBackMagicQuotes(); unset($v_list); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); return(0); } @@ -1110,7 +1052,6 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list); return $v_list; } // -------------------------------------------------------------------------------- @@ -1123,12 +1064,10 @@ // -------------------------------------------------------------------------------- function deleteByIndex($p_index) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'"); - + $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); return $p_list; } // -------------------------------------------------------------------------------- @@ -1149,7 +1088,6 @@ // -------------------------------------------------------------------------------- function properties() { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", ""); // ----- Reset the error handler $this->privErrorReset(); @@ -1160,7 +1098,6 @@ // ----- Check archive if (!$this->privCheckFormat()) { $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } @@ -1174,16 +1111,14 @@ if (@is_file($this->zipname)) { // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { $this->privSwapBackMagicQuotes(); - + // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0); return 0; } @@ -1192,7 +1127,6 @@ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return 0; } @@ -1209,7 +1143,6 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop); return $v_prop; } // -------------------------------------------------------------------------------- @@ -1228,7 +1161,6 @@ // -------------------------------------------------------------------------------- function duplicate($p_archive) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", ""); $v_result = 1; // ----- Reset the error handler @@ -1237,7 +1169,6 @@ // ----- Look if the $p_archive is a PclZip object if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'"); // ----- Duplicate the archive $v_result = $this->privDuplicate($p_archive->zipname); @@ -1246,7 +1177,6 @@ // ----- Look if the $p_archive is a string (so a filename) else if (is_string($p_archive)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'"); // ----- Check that $p_archive is a valid zip file // TBC : Should also check the archive format @@ -1270,7 +1200,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -1291,7 +1220,6 @@ // -------------------------------------------------------------------------------- function merge($p_archive_to_add) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", ""); $v_result = 1; // ----- Reset the error handler @@ -1299,14 +1227,12 @@ // ----- Check archive if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); return(0); } // ----- Look if the $p_archive_to_add is a PclZip object if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object"); // ----- Merge the archive $v_result = $this->privMerge($p_archive_to_add); @@ -1315,7 +1241,6 @@ // ----- Look if the $p_archive_to_add is a string (so a filename) else if (is_string($p_archive_to_add)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename"); // ----- Create a temporary archive $v_object_archive = new PclZip($p_archive_to_add); @@ -1333,7 +1258,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -1448,7 +1372,6 @@ // -------------------------------------------------------------------------------- function privCheckFormat($p_level=0) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", ""); $v_result = true; // ----- Reset the file system cache @@ -1461,7 +1384,6 @@ if (!is_file($this->zipname)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); return(false); } @@ -1469,7 +1391,6 @@ if (!is_readable($this->zipname)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); return(false); } @@ -1483,7 +1404,6 @@ // TBC // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -1505,13 +1425,11 @@ // -------------------------------------------------------------------------------- function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", ""); $v_result=1; - + // ----- Read the options $i=0; while ($i<$p_size) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Looking for table index $i, option = '".PclZipUtilOptionText($p_options_list[$i])."(".$p_options_list[$i].")'"); // ----- Check if the option is supported if (!isset($v_requested_options[$p_options_list[$i]])) { @@ -1519,7 +1437,6 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -1535,13 +1452,11 @@ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; @@ -1549,28 +1464,24 @@ // ----- Check the number of parameters if (($i+1) >= $p_size) { PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - + // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - + // ----- Check the value $v_value = $p_options_list[$i+1]; if ((!is_integer($v_value)) || ($v_value<0)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value (and convert it in bytes) $v_result_list[$p_options_list[$i]] = $v_value*1048576; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; @@ -1578,30 +1489,25 @@ // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - + $v_result_list[$p_options_list[$i]] = true; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); break; case PCLZIP_OPT_TEMP_FILE_OFF : // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - + $v_result_list[$p_options_list[$i]] = true; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); break; case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : @@ -1611,7 +1517,6 @@ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -1619,11 +1524,9 @@ if ( is_string($p_options_list[$i+1]) && ($p_options_list[$i+1] != '')) { $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." set with an empty value is ignored."); } break; @@ -1635,7 +1538,6 @@ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -1651,15 +1553,16 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; // ----- Look for options that request an EREG or PREG expression case PCLZIP_OPT_BY_EREG : + // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG + // to PCLZIP_OPT_BY_PREG + $p_options_list[$i] = PCLZIP_OPT_BY_PREG; case PCLZIP_OPT_BY_PREG : //case PCLZIP_OPT_CRYPT : // ----- Check the number of parameters @@ -1668,7 +1571,6 @@ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -1681,10 +1583,8 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; @@ -1701,7 +1601,6 @@ ."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -1717,10 +1616,8 @@ ."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; @@ -1732,14 +1629,12 @@ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_work_list = array(); if (is_string($p_options_list[$i+1])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is a string '".$p_options_list[$i+1]."'"); // ----- Remove spaces $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); @@ -1748,11 +1643,9 @@ $v_work_list = explode(",", $p_options_list[$i+1]); } else if (is_integer($p_options_list[$i+1])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an integer '".$p_options_list[$i+1]."'"); $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; } else if (is_array($p_options_list[$i+1])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an array"); $v_work_list = $p_options_list[$i+1]; } else { @@ -1760,10 +1653,9 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - + // ----- Reduce the index list // each index item in the list must be a couple with a start and // an end value : [0,3], [5-5], [8-10], ... @@ -1774,10 +1666,10 @@ // ----- Explode the item $v_item_list = explode("-", $v_work_list[$j]); $v_size_item_list = sizeof($v_item_list); - + // ----- TBC : Here we might check that each item is a // real integer ... - + // ----- Look for single value if ($v_size_item_list == 1) { // ----- Set the option value @@ -1794,15 +1686,12 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extracted index item = [".$v_result_list[$p_options_list[$i]][$j]['start'].",".$v_result_list[$p_options_list[$i]][$j]['end']."]"); // ----- Look for list sort if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The list should be sorted ..."); $v_sort_flag=true; // ----- TBC : An automatic sort should be writen ... @@ -1810,16 +1699,14 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start']; } - + // ----- Sort the items if ($v_sort_flag) { // TBC : To Be Completed - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "List sorting is not yet write ..."); } // ----- Next option @@ -1834,7 +1721,6 @@ case PCLZIP_OPT_REPLACE_NEWER : case PCLZIP_OPT_STOP_ON_ERROR : $v_result_list[$p_options_list[$i]] = true; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); break; // ----- Look for options that request an octal value @@ -1845,13 +1731,11 @@ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); $i++; break; @@ -1872,13 +1756,11 @@ PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Get the value $v_function_name = $p_options_list[$i+1]; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "call-back ".PclZipUtilOptionText($p_options_list[$i])." = '".$v_function_name."'"); // ----- Check that the value is a valid existing function if (!function_exists($v_function_name)) { @@ -1886,7 +1768,6 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -1902,7 +1783,6 @@ .$p_options_list[$i]."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -1915,28 +1795,24 @@ for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { // ----- Look for mandatory option if ($v_requested_options[$key] == 'mandatory') { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")"); // ----- Look if present if (!isset($v_result_list[$key])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } } } - + // ----- Look for default values if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Calculate auto threshold"); - + } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -1949,21 +1825,18 @@ // -------------------------------------------------------------------------------- function privOptionDefaultThreshold(&$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOptionDefaultThreshold", ""); $v_result=1; - + if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Create an auto-threshold for use of temporay files"); + // ----- Get 'memory_limit' configuration value $v_memory_limit = ini_get('memory_limit'); $v_memory_limit = trim($v_memory_limit); $last = strtolower(substr($v_memory_limit, -1)); - + if($last == 'g') //$v_memory_limit = $v_memory_limit*1024*1024*1024; $v_memory_limit = $v_memory_limit*1073741824; @@ -1972,20 +1845,16 @@ $v_memory_limit = $v_memory_limit*1048576; if($last == 'k') $v_memory_limit = $v_memory_limit*1024; - + $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Current memory usage : ".memory_get_usage(TRUE)." bytes"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Threshold value is : ".$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]." bytes"); + // ----- Sanity check : No threshold if value lower than 1M if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Unset the threshold (value ".$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD].") because under 1Mo sanity check)"); unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); } - + // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2000,19 +1869,17 @@ // -------------------------------------------------------------------------------- function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", ""); $v_result=1; - + // ----- For each file in the list check the attributes foreach ($p_file_list as $v_key => $v_value) { - + // ----- Check if the option is supported if (!isset($v_requested_options[$v_key])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -2021,16 +1888,13 @@ case PCLZIP_ATT_FILE_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); - + if ($p_filedescr['filename'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -2039,16 +1903,13 @@ case PCLZIP_ATT_FILE_NEW_SHORT_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); if ($p_filedescr['new_short_name'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } break; @@ -2056,16 +1917,13 @@ case PCLZIP_ATT_FILE_NEW_FULL_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); if ($p_filedescr['new_full_name'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } break; @@ -2074,28 +1932,23 @@ case PCLZIP_ATT_FILE_COMMENT : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['comment'] = $v_value; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); break; case PCLZIP_ATT_FILE_MTIME : if (!is_integer($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } $p_filedescr['mtime'] = $v_value; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); break; case PCLZIP_ATT_FILE_CONTENT : $p_filedescr['content'] = $v_value; - ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); break; default : @@ -2104,7 +1957,6 @@ "Unknown parameter '".$v_key."'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -2113,22 +1965,19 @@ for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { // ----- Look for mandatory option if ($v_requested_options[$key] == 'mandatory') { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")"); // ----- Look if present if (!isset($p_file_list[$key])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } } } - + // end foreach } - + // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2140,7 +1989,7 @@ // or a string to be added as file. For any other type of files (link, other) // just ignore the item. // Then prepare the information that will be stored for that file. - // When its a folder, expand the folder with all the files that are in that + // When its a folder, expand the folder with all the files that are in that // folder (recursively). // Parameters : // Return Values : @@ -2149,70 +1998,59 @@ // -------------------------------------------------------------------------------- function privFileDescrExpand(&$p_filedescr_list, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", ""); $v_result=1; - + // ----- Create a result list $v_result_list = array(); - + // ----- Look each entry for ($i=0; $iprivCalculateStoredFilename($v_descr, $p_options); - + // ----- Add the descriptor in result list $v_result_list[sizeof($v_result_list)] = $v_descr; - + // ----- Look for folder if ($v_descr['type'] == 'folder') { // ----- List of items in folder @@ -2220,20 +2058,20 @@ $v_dirlist_nb = 0; if ($v_folder_handler = @opendir($v_descr['filename'])) { while (($v_item_handler = @readdir($v_folder_handler)) !== false) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for '".$v_item_handler."' in the directory"); // ----- Skip '.' and '..' if (($v_item_handler == '.') || ($v_item_handler == '..')) { continue; } - + // ----- Compose the full filename $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; - + // ----- Look for different stored filename // Because the name of the folder was changed, the name of the // files/sub-folders also change - if ($v_descr['stored_filename'] != $v_descr['filename']) { + if (($v_descr['stored_filename'] != $v_descr['filename']) + && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { if ($v_descr['stored_filename'] != '') { $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; } @@ -2241,44 +2079,38 @@ $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler; } } - + $v_dirlist_nb++; } - + @closedir($v_folder_handler); } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to open dir '".$v_descr['filename']."' in read mode. Skipped."); // TBC : unable to open folder in read mode } - + // ----- Expand each element of the list if ($v_dirlist_nb != 0) { // ----- Expand if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - + // ----- Concat the resulting list - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Merging result list (size '".sizeof($v_result_list)."') with dirlist (size '".sizeof($v_dirlist_descr)."')"); $v_result_list = array_merge($v_result_list, $v_dirlist_descr); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "merged result list is size '".sizeof($v_result_list)."'"); } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand."); } - + // ----- Free local array unset($v_dirlist_descr); } } - + // ----- Get the result list $p_filedescr_list = $v_result_list; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2291,10 +2123,9 @@ // -------------------------------------------------------------------------------- function privCreate($p_filedescr_list, &$p_result_list, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list"); $v_result=1; $v_list_detail = array(); - + // ----- Magic quotes trick $this->privDisableMagicQuotes(); @@ -2302,7 +2133,6 @@ if (($v_result = $this->privOpenFd('wb')) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -2316,7 +2146,6 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2329,34 +2158,29 @@ // -------------------------------------------------------------------------------- function privAdd($p_filedescr_list, &$p_result_list, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAdd", "list"); $v_result=1; $v_list_detail = array(); // ----- Look if the archive exists or is empty if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, or is empty, create it."); // ----- Do a create $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -2366,20 +2190,16 @@ { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); // ----- Creates a temporay file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Open the temporary file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { $this->privCloseFd(); @@ -2388,7 +2208,6 @@ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -2398,7 +2217,6 @@ while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; @@ -2421,20 +2239,17 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Store the offset of the central dir $v_offset = @ftell($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); // ----- Copy the block of file headers from the old archive $v_size = $v_central_dir['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($v_zip_temp_fd, $v_read_size); @fwrite($this->zip_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; @@ -2452,7 +2267,6 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_count++; @@ -2485,7 +2299,6 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -2513,7 +2326,6 @@ PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2525,7 +2337,6 @@ // -------------------------------------------------------------------------------- function privOpenFd($p_mode) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode); $v_result=1; // ----- Look if already open @@ -2535,24 +2346,20 @@ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode'); if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2564,7 +2371,6 @@ // -------------------------------------------------------------------------------- function privCloseFd() { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCloseFd", ""); $v_result=1; if ($this->zip_fd != 0) @@ -2572,7 +2378,6 @@ $this->zip_fd = 0; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2593,7 +2398,6 @@ // function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) function privAddList($p_filedescr_list, &$p_result_list, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddList", "list"); $v_result=1; // ----- Add the files @@ -2601,7 +2405,6 @@ if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -2615,7 +2418,6 @@ if ($v_header_list[$i]['status'] == 'ok') { if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_count++; @@ -2641,12 +2443,10 @@ unset($v_header_list); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2655,42 +2455,36 @@ // Function : privAddFileList() // Description : // Parameters : - // $p_filedescr_list : An array containing the file description + // $p_filedescr_list : An array containing the file description // or directory names to add in the zip // $p_result_list : list of added files with their properties (specially the status field) // Return Values : // -------------------------------------------------------------------------------- function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileList", "filedescr_list"); $v_result=1; $v_header = array(); // ----- Recuperate the current number of elt in list $v_nb = sizeof($p_result_list); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Before add, list have ".$v_nb." elements"); // ----- Loop on the files for ($j=0; ($jprivAddFile($p_filedescr_list[$j], $v_header, $p_options); if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -2717,10 +2510,8 @@ $p_result_list[$v_nb++] = $v_header; } } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "After add, list have ".$v_nb." elements"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -2733,9 +2524,8 @@ // -------------------------------------------------------------------------------- function privAddFile($p_filedescr, &$p_header, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'"); $v_result=1; - + // ----- Working variable $p_filename = $p_filedescr['filename']; @@ -2745,19 +2535,16 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - - // ----- Look for a stored different filename + + // ----- Look for a stored different filename /* TBC : Removed if (isset($p_filedescr['stored_filename'])) { $v_stored_filename = $p_filedescr['stored_filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is NOT the same "'.$v_stored_filename.'"'); } else { $v_stored_filename = $p_filedescr['stored_filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is the same'); } */ @@ -2786,30 +2573,27 @@ $p_header['external'] = 0x00000000; $p_header['size'] = filesize($p_filename); } - + // ----- Look for regular folder else if ($p_filedescr['type']=='folder') { $p_header['external'] = 0x00000010; $p_header['mtime'] = filemtime($p_filename); $p_header['size'] = filesize($p_filename); } - + // ----- Look for virtual file else if ($p_filedescr['type'] == 'virtual_file') { $p_header['external'] = 0x00000000; $p_header['size'] = strlen($p_filedescr['content']); } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'"); + // ----- Look for filetime if (isset($p_filedescr['mtime'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Overload mtime value with :'".$p_filedescr['mtime']."'"); $p_header['mtime'] = $p_filedescr['mtime']; } else if ($p_filedescr['type'] == 'virtual_file') { $p_header['mtime'] = time(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Virtual file : use current time '".$p_header['mtime']."' for mtime value."); } else { $p_header['mtime'] = filemtime($p_filename); @@ -2827,7 +2611,6 @@ // ----- Look for pre-add callback if (isset($p_options[PCLZIP_CB_PRE_ADD])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_ADD]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); @@ -2836,7 +2619,7 @@ // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. - eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header); if ($v_result == 0) { // ----- Change the file status $p_header['status'] = "skipped"; @@ -2847,7 +2630,6 @@ // Only some fields can be modified if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New stored filename is '".$p_header['stored_filename']."'"); } } @@ -2855,7 +2637,7 @@ if ($p_header['stored_filename'] == "") { $p_header['status'] = "filtered"; } - + // ----- Check the path length if (strlen($p_header['stored_filename']) > 0xFF) { $p_header['status'] = 'filename_too_long'; @@ -2867,7 +2649,7 @@ // ----- Look for a file if ($p_filedescr['type'] == 'file') { // ----- Look for using temporary file to zip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) + if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) { @@ -2876,57 +2658,45 @@ return $v_result; } } - + // ----- Use "in memory" zip algo else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"In memory compression."); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory usage : ".memory_get_usage(TRUE)." bytes"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory peak : ".memory_get_peak_usage(TRUE)." bytes"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file"); // ----- Open the source file if (($v_file = @fopen($p_filename, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Read the file content $v_content = @fread($v_file, $p_header['size']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after reading file : ".memory_get_usage(TRUE)." bytes"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after reading file : ".memory_get_peak_usage(TRUE)." bytes"); // ----- Close the file @fclose($v_file); // ----- Calculate the CRC $p_header['crc'] = @crc32($v_content); - + // ----- Look for no compression if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed"); // ----- Set header parameters $p_header['compressed_size'] = $p_header['size']; $p_header['compression'] = 0; } - + // ----- Look for normal compression else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed"); // ----- Compress the content $v_content = @gzdeflate($v_content); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after gzdeflate : ".memory_get_usage(TRUE)." bytes"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after gzdeflate : ".memory_get_peak_usage(TRUE)." bytes"); // ----- Set header parameters $p_header['compressed_size'] = strlen($v_content); $p_header['compression'] = 8; } - + // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { @fclose($v_file); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -2939,24 +2709,21 @@ // ----- Look for a virtual file (a file from string) else if ($p_filedescr['type'] == 'virtual_file') { - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Add by string"); + $v_content = $p_filedescr['content']; // ----- Calculate the CRC $p_header['crc'] = @crc32($v_content); - + // ----- Look for no compression if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed"); // ----- Set header parameters $p_header['compressed_size'] = $p_header['size']; $p_header['compression'] = 0; } - + // ----- Look for normal compression else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed"); // ----- Compress the content $v_content = @gzdeflate($v_content); @@ -2964,11 +2731,10 @@ $p_header['compressed_size'] = strlen($v_content); $p_header['compression'] = 8; } - + // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { @fclose($v_file); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -2978,7 +2744,6 @@ // ----- Look for a directory else if ($p_filedescr['type'] == 'folder') { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a folder"); // ----- Look for directory last '/' if (@substr($p_header['stored_filename'], -1) != '/') { $p_header['stored_filename'] .= '/'; @@ -2992,7 +2757,6 @@ // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } } @@ -3000,7 +2764,6 @@ // ----- Look for post-add callback if (isset($p_options[PCLZIP_CB_POST_ADD])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_ADD]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); @@ -3009,7 +2772,7 @@ // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. - eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header); if ($v_result == 0) { // ----- Ignored $v_result = 1; @@ -3020,7 +2783,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3033,18 +2795,15 @@ // -------------------------------------------------------------------------------- function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileUsingTempFile", "filename='".$p_filedescr['filename']."'"); $v_result=PCLZIP_ERR_NO_ERROR; - + // ----- Working variable $p_filename = $p_filedescr['filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file"); // ----- Open the source file if (($v_file = @fopen($p_filename, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -3053,7 +2812,6 @@ if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) { fclose($v_file); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -3061,7 +2819,6 @@ $v_size = filesize($p_filename); while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read ".$v_read_size." bytes"); $v_buffer = @fread($v_file, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @gzputs($v_file_compressed, $v_buffer, $v_read_size); @@ -3073,17 +2830,14 @@ @gzclose($v_file_compressed); // ----- Check the minimum file size - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "gzip file size ".filesize($v_gzip_temp_name)); if (filesize($v_gzip_temp_name) < 18) { PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes'); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Extract the compressed attributes if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -3092,28 +2846,17 @@ $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data); // ----- Check some parameters - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[id1]='.bin2hex($v_data_header['id1'])); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[id2]='.bin2hex($v_data_header['id2'])); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[cm]='.bin2hex($v_data_header['cm'])); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[flag]='.bin2hex($v_data_header['flag'])); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[mtime]='.$v_data_header['mtime']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[xfl]='.bin2hex($v_data_header['xfl'])); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[os]='.bin2hex($v_data_header['os'])); $v_data_header['os'] = bin2hex($v_data_header['os']); // ----- Read the gzip file footer - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position after header ".ftell($v_file_compressed)); @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position at beginning of footer ".ftell($v_file_compressed)); $v_binary_data = @fread($v_file_compressed, 8); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position after footer ".ftell($v_file_compressed)); $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data); // ----- Set the attributes $p_header['compression'] = ord($v_data_header['cm']); //$p_header['mtime'] = $v_data_header['mtime']; $p_header['crc'] = $v_data_footer['crc']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Compressed size ".(filesize($v_gzip_temp_name)-18)); $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18; // ----- Close the file @@ -3121,7 +2864,6 @@ // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -3129,19 +2871,15 @@ if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks fseek($v_file_compressed, 10); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position before reading compressed data ".ftell($v_file_compressed)); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, ' '.$p_header['compressed_size'].' bytes to read'); $v_size = $p_header['compressed_size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read ".$v_read_size." bytes"); $v_buffer = @fread($v_file_compressed, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($this->zip_fd, $v_buffer, $v_read_size); @@ -3153,9 +2891,8 @@ // ----- Unlink the temporary file @unlink($v_gzip_temp_name); - + // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3170,9 +2907,8 @@ // -------------------------------------------------------------------------------- function privCalculateStoredFilename(&$p_filedescr, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'"); $v_result=1; - + // ----- Working variables $p_filename = $p_filedescr['filename']; if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { @@ -3187,7 +2923,6 @@ else { $p_remove_dir = ''; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Remove path ='".$p_remove_dir."'"); if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; } @@ -3195,13 +2930,13 @@ $p_remove_all_dir = 0; } + // ----- Look for full name change if (isset($p_filedescr['new_full_name'])) { // ----- Remove drive letter if any $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'"); } - + // ----- Look for path and/or short name change else { @@ -3214,7 +2949,6 @@ $v_dir = $v_path_info['dirname'].'/'; } $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing short name of '".$p_filename."' for '".$v_stored_filename."'"); } else { // ----- Calculate the stored filename @@ -3224,17 +2958,15 @@ // ----- Look for all path to remove if ($p_remove_all_dir) { $v_stored_filename = basename($p_filename); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove all path selected change '".$p_filename."' for '".$v_stored_filename."'"); } // ----- Look for partial path remove else if ($p_remove_dir != "") { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Partial path to remove"); if (substr($p_remove_dir, -1) != '/') $p_remove_dir .= "/"; if ( (substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./")) { - + if ( (substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./")) { $p_remove_dir = "./".$p_remove_dir; @@ -3250,37 +2982,31 @@ if ($v_compare > 0) { if ($v_compare == 2) { $v_stored_filename = ""; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Path to remove is the current folder"); } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove path '$p_remove_dir' in file '$v_stored_filename'"); $v_stored_filename = substr($v_stored_filename, strlen($p_remove_dir)); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Result is '$v_stored_filename'"); } } } - + // ----- Remove drive letter if any $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); - + // ----- Look for path to add if ($p_add_dir != "") { if (substr($p_add_dir, -1) == "/") $v_stored_filename = $p_add_dir.$v_stored_filename; else $v_stored_filename = $p_add_dir."/".$v_stored_filename; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'"); } } // ----- Filename (reduce the path of stored name) $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); $p_filedescr['stored_filename'] = $v_stored_filename; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename'])); - + // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3293,15 +3019,12 @@ // -------------------------------------------------------------------------------- function privWriteFileHeader(&$p_header) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); $v_result=1; // ----- Store the offset position of the file $p_header['offset'] = ftell($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File offset of the header :'.$p_header['offset']); // ----- Transform UNIX mtime to DOS format mdate/mtime - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); $v_date = getdate($p_header['mtime']); $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; @@ -3329,7 +3052,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3342,21 +3064,17 @@ // -------------------------------------------------------------------------------- function privWriteCentralFileHeader(&$p_header) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); $v_result=1; // TBC //for(reset($p_header); $key = key($p_header); next($p_header)) { - // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]); //} // ----- Transform UNIX mtime to DOS format mdate/mtime - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); $v_date = getdate($p_header['mtime']); $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment size : \''.$p_header['comment_len'].'\''); // ----- Packed data $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, @@ -3387,7 +3105,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3400,7 +3117,6 @@ // -------------------------------------------------------------------------------- function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralHeader", 'nb_entries='.$p_nb_entries.', size='.$p_size.', offset='.$p_offset.', comment="'.$p_comment.'"'); $v_result=1; // ----- Packed data @@ -3418,7 +3134,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3431,24 +3146,21 @@ // -------------------------------------------------------------------------------- function privList(&$p_list) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privList", "list"); $v_result=1; // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); - + // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -3457,15 +3169,11 @@ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of Central Dir - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Offset : ".$v_central_dir['offset']."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_central_dir['offset'])) { $this->privSwapBackMagicQuotes(); @@ -3474,10 +3182,8 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); // ----- Read each entry for ($i=0; $i<$v_central_dir['entries']; $i++) @@ -3486,7 +3192,6 @@ if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) { $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_header['index'] = $i; @@ -3503,7 +3208,6 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3529,7 +3233,6 @@ // -------------------------------------------------------------------------------- function privConvertHeader2FileInfo($p_header, &$p_info) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privConvertHeader2FileInfo", "Filename='".$p_header['filename']."'"); $v_result=1; // ----- Get the interesting attributes @@ -3547,7 +3250,6 @@ $p_info['crc'] = $p_header['crc']; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3570,7 +3272,6 @@ // -------------------------------------------------------------------------------- function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privExtractByRule", "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); $v_result=1; // ----- Magic quotes trick @@ -3589,9 +3290,7 @@ // ----- Look for the path end '/' while (substr($p_path, -1) == "/") { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'"); $p_path = substr($p_path, 0, strlen($p_path)-1); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]"); } } @@ -3603,11 +3302,9 @@ $p_remove_path_size = strlen($p_remove_path); // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result = $this->privOpenFd('rb')) != 1) { $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -3619,7 +3316,6 @@ $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -3630,12 +3326,9 @@ $j_start = 0; for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry : '$i'"); // ----- Read next Central dir entry - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position before rewind : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_pos_entry)) { // ----- Close the zip file @@ -3646,10 +3339,8 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Read the file header $v_header = array(); @@ -3659,7 +3350,6 @@ $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -3675,49 +3365,43 @@ // ----- Look for extract by name rule if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); // ----- Look if the filename is in the list for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); $v_extract = true; } } // ----- Look for a filename elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); $v_extract = true; } } } // ----- Look for extract by ereg rule + // ereg() is deprecated with PHP 5.3 + /* else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_extract = true; } } + */ // ----- Look for extract by preg rule else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_extract = true; } } @@ -3725,23 +3409,18 @@ // ----- Look for extract by index rule else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); - + // ----- Look if the index is in the list for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); $v_extract = true; } if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); $j_start = $j+1; } if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); break; } } @@ -3749,7 +3428,6 @@ // ----- Look for no rule, which means extract all the archive else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with no rule (extract all)"); $v_extract = true; } @@ -3757,35 +3435,30 @@ if ( ($v_extract) && ( ($v_header['compression'] != 8) && ($v_header['compression'] != 0))) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported compression method (".$v_header['compression'].")"); $v_header['status'] = 'unsupported_compression'; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); $this->privSwapBackMagicQuotes(); - + PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, "Filename '".$v_header['stored_filename']."' is " ."compressed by an unsupported compression " ."method (".$v_header['compression'].") "); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } - + // ----- Check encrypted files if (($v_extract) && (($v_header['flag'] & 1) == 1)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption"); $v_header['status'] = 'unsupported_encryption'; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); $this->privSwapBackMagicQuotes(); @@ -3794,35 +3467,29 @@ ." filename '".$v_header['stored_filename'] ."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Look for real extraction if (($v_extract) && ($v_header['status'] != 'ok')) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "No need for extract"); $v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++]); if ($v_result != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $v_extract = false; } - + // ----- Look for real extraction if ($v_extract) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file '".$v_header['filename']."', index '$i'"); // ----- Go to the file position - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_header['offset'])) { // ----- Close the zip file @@ -3834,20 +3501,19 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Look for extraction as string if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { + $v_string = ''; + // ----- Extracting the file - $v_result1 = $this->privExtractFileAsString($v_header, $v_string); + $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options); if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); return $v_result1; } @@ -3858,7 +3524,6 @@ $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -3867,7 +3532,7 @@ // ----- Next extracted file $v_nb_extracted++; - + // ----- Look for user callback abort if ($v_result1 == 2) { break; @@ -3881,7 +3546,6 @@ if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); return $v_result1; } @@ -3889,7 +3553,6 @@ if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -3908,7 +3571,6 @@ if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); return $v_result1; } @@ -3919,7 +3581,6 @@ $this->privCloseFd(); $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -3936,7 +3597,6 @@ $this->privSwapBackMagicQuotes(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -3952,18 +3612,15 @@ // -------------------------------------------------------------------------------- function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFile', "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); $v_result=1; // ----- Read the file header if (($v_result = $this->privReadFileHeader($v_header)) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { @@ -3974,15 +3631,12 @@ if ($p_remove_all_path == true) { // ----- Look for folder entry that not need to be extracted if (($p_entry['external']&0x00000010)==0x00000010) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The entry is a folder : need to be filtered"); $p_entry['status'] = "filtered"; - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "All path is removed"); // ----- Get the basename of the path $p_entry['filename'] = basename($p_entry['filename']); } @@ -3990,28 +3644,23 @@ // ----- Look for path to remove else if ($p_remove_path != "") { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look for some path to remove"); if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'"); // ----- Change the file status $p_entry['status'] = "filtered"; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } $p_remove_path_size = strlen($p_remove_path); if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'"); // ----- Remove the path $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'"); } } @@ -4019,28 +3668,24 @@ if ($p_path != '') { $p_entry['filename'] = $p_path."/".$p_entry['filename']; } - + // ----- Check a base_dir_restriction if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction"); $v_inclusion = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], - $p_entry['filename']); + $p_entry['filename']); if ($v_inclusion == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction"); PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, "Filename '".$p_entry['filename']."' is " ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Look for pre-extract callback if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); @@ -4049,16 +3694,15 @@ // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. - eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); if ($v_result == 0) { // ----- Change the file status $p_entry['status'] = "skipped"; $v_result = 1; } - + // ----- Look for abort result if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); // ----- This status is internal and will be changed in 'skipped' $p_entry['status'] = "aborted"; $v_result = PCLZIP_ERR_USER_ABORTED; @@ -4067,10 +3711,8 @@ // ----- Update the informations // Only some fields can be modified $p_entry['filename'] = $v_local_header['filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { @@ -4078,35 +3720,30 @@ // ----- Look for specific actions while the file exist if (file_exists($p_entry['filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists"); // ----- Look if file is a directory if (is_dir($p_entry['filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory"); // ----- Change the file status $p_entry['status'] = "already_a_directory"; - + // ----- Look for PCLZIP_OPT_STOP_ON_ERROR // For historical reason first PclZip implementation does not stop // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, "Filename '".$p_entry['filename']."' is " ."already used by an existing directory"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Look if file is write protected else if (!is_writeable($p_entry['filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected"); // ----- Change the file status $p_entry['status'] = "write_protected"; @@ -4116,13 +3753,11 @@ // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Filename '".$p_entry['filename']."' exists " ."and is write protected"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } @@ -4130,14 +3765,11 @@ // ----- Look if the extracted file is older else if (filemtime($p_entry['filename']) > $p_entry['mtime']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); // ----- Change the file status if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_REPLACE_NEWER is selected, file will be replaced"); } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be replaced"); $p_entry['status'] = "newer_exist"; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR @@ -4145,19 +3777,16 @@ // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Newer version of '".$p_entry['filename']."' exists " ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); } } @@ -4171,13 +3800,11 @@ $v_dir_to_check = dirname($p_entry['filename']); if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'"); - + // ----- Change the file status $p_entry['status'] = "path_creation_fail"; - + // ----- Return - ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); //return $v_result; $v_result = 1; } @@ -4192,35 +3819,30 @@ { // ----- Look for not compressed file if ($p_entry['compression'] == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); // ----- Change the file status $p_entry['status'] = "write_error"; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes"); // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = $p_entry['compressed_size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read $v_read_size bytes"); $v_buffer = @fread($this->zip_fd, $v_read_size); /* Try to speed up the code $v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($v_dest_file, $v_binary_data, $v_read_size); */ - @fwrite($v_dest_file, $v_buffer, $v_read_size); + @fwrite($v_dest_file, $v_buffer, $v_read_size); $v_size -= $v_read_size; } @@ -4229,23 +3851,20 @@ // ----- Change the file mtime touch($p_entry['filename'], $p_entry['mtime']); - + } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")"); // ----- TBC // Need to be finished if (($p_entry['flag'] & 1) == 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File is encrypted"); PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.'); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Look for using temporary file to unzip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) + if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) { @@ -4254,47 +3873,42 @@ return $v_result; } } - + // ----- Look for extract in memory else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes"); - + // ----- Read the compressed file in a buffer (one shot) $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - + // ----- Decompress the file $v_file_content = @gzinflate($v_buffer); unset($v_buffer); if ($v_file_content === FALSE) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file"); - + // ----- Change the file status // TBC $p_entry['status'] = "error"; - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; } - + // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); - + // ----- Change the file status $p_entry['status'] = "write_error"; - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); + return $v_result; } - + // ----- Write the uncompressed data @fwrite($v_dest_file, $v_file_content, $p_entry['size']); unset($v_file_content); - + // ----- Closing the destination file @fclose($v_dest_file); - + } // ----- Change the file mtime @@ -4303,24 +3917,21 @@ // ----- Look for chmod option if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "chmod option activated '".$p_options[PCLZIP_OPT_SET_CHMOD]."'"); // ----- Change the mode of the file @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); } } - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - + // ----- Change abort status + if ($p_entry['status'] == "aborted") { + $p_entry['status'] = "skipped"; + } + // ----- Look for post-extract callback elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); @@ -4329,17 +3940,15 @@ // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. - eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); // ----- Look for abort result if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); $v_result = PCLZIP_ERR_USER_ABORTED; } } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -4352,19 +3961,16 @@ // -------------------------------------------------------------------------------- function privExtractFileUsingTempFile(&$p_entry, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileUsingTempFile', "filename='".$p_entry['filename']."'"); $v_result=1; - + // ----- Creates a temporary file $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) { fclose($v_file); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Start extraction of '".$p_entry['filename']."'"); // ----- Write gz file format header $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); @@ -4372,11 +3978,9 @@ // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = $p_entry['compressed_size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Compressed Size :".$v_size.""); while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read ".$v_read_size." bytes"); $v_buffer = @fread($this->zip_fd, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($v_dest_file, $v_buffer, $v_read_size); @@ -4392,9 +3996,7 @@ // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); $p_entry['status'] = "write_error"; - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -4403,19 +4005,14 @@ @fclose($v_dest_file); $p_entry['status'] = "read_error"; PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File size is '.filesize($v_gzip_temp_name)); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = $p_entry['size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size :".$v_size.""); while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read ".$v_read_size." bytes"); $v_buffer = @gzread($v_src_file, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($v_dest_file, $v_buffer, $v_read_size); @@ -4426,9 +4023,8 @@ // ----- Delete the temporary file @unlink($v_gzip_temp_name); - + // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -4441,16 +4037,13 @@ // -------------------------------------------------------------------------------- function privExtractFileInOutput(&$p_entry, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileInOutput', ""); $v_result=1; // ----- Read the file header if (($v_result = $this->privReadFileHeader($v_header)) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { @@ -4459,7 +4052,6 @@ // ----- Look for pre-extract callback if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); @@ -4468,7 +4060,8 @@ // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. - eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); +// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); if ($v_result == 0) { // ----- Change the file status $p_entry['status'] = "skipped"; @@ -4477,7 +4070,6 @@ // ----- Look for abort result if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); // ----- This status is internal and will be changed in 'skipped' $p_entry['status'] = "aborted"; $v_result = PCLZIP_ERR_USER_ABORTED; @@ -4486,11 +4078,9 @@ // ----- Update the informations // Only some fields can be modified $p_entry['filename'] = $v_local_header['filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); } // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { @@ -4499,8 +4089,6 @@ if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file if ($p_entry['compressed_size'] == $p_entry['size']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); // ----- Read the file in a buffer (one shot) $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); @@ -4510,12 +4098,10 @@ unset($v_buffer); } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes"); // ----- Read the compressed file in a buffer (one shot) $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - + // ----- Decompress the file $v_file_content = gzinflate($v_buffer); unset($v_buffer); @@ -4524,7 +4110,6 @@ echo $v_file_content; unset($v_file_content); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); } } @@ -4535,7 +4120,6 @@ // ----- Look for post-extract callback elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); // ----- Generate a local information $v_local_header = array(); @@ -4544,16 +4128,14 @@ // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. - eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); + $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); // ----- Look for abort result if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); $v_result = PCLZIP_ERR_USER_ABORTED; } } - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -4564,9 +4146,8 @@ // Parameters : // Return Values : // -------------------------------------------------------------------------------- - function privExtractFileAsString(&$p_entry, &$p_string) + function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'"); $v_result=1; // ----- Read the file header @@ -4574,52 +4155,108 @@ if (($v_result = $this->privReadFileHeader($v_header)) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { // TBC } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'"); + // ----- Look for pre-extract callback + if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) - { - // ----- Look for not compressed file -// if ($p_entry['compressed_size'] == $p_entry['size']) - if ($p_entry['compression'] == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); - - // ----- Reading the file - $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); + if ($v_result == 0) { + // ----- Change the file status + $p_entry['status'] = "skipped"; + $v_result = 1; } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (compression method '".$p_entry['compression']."')"); - - // ----- Reading the file - $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - if (($p_string = @gzinflate($v_data)) === FALSE) { - // TBC + + // ----- Look for abort result + if ($v_result == 2) { + // ----- This status is internal and will be changed in 'skipped' + $p_entry['status'] = "aborted"; + $v_result = PCLZIP_ERR_USER_ABORTED; + } + + // ----- Update the informations + // Only some fields can be modified + $p_entry['filename'] = $v_local_header['filename']; + } + + + // ----- Look if extraction should be done + if ($p_entry['status'] == 'ok') { + + // ----- Do the extraction (if not a folder) + if (!(($p_entry['external']&0x00000010)==0x00000010)) { + // ----- Look for not compressed file + // if ($p_entry['compressed_size'] == $p_entry['size']) + if ($p_entry['compression'] == 0) { + + // ----- Reading the file + $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); + } + else { + + // ----- Reading the file + $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); + + // ----- Decompress the file + if (($p_string = @gzinflate($v_data)) === FALSE) { + // TBC + } } + + // ----- Trace + } + else { + // TBC : error : can not extract a folder in a string } - // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); } - else { - // TBC : error : can not extract a folder in a string + + // ----- Change abort status + if ($p_entry['status'] == "aborted") { + $p_entry['status'] = "skipped"; + } + + // ----- Look for post-extract callback + elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { + + // ----- Generate a local information + $v_local_header = array(); + $this->privConvertHeader2FileInfo($p_entry, $v_local_header); + + // ----- Swap the content to header + $v_local_header['content'] = $p_string; + $p_string = ''; + + // ----- Call the callback + // Here I do not use call_user_func() because I need to send a reference to the + // header. + $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); + + // ----- Swap back the content to header + $p_string = $v_local_header['content']; + unset($v_local_header['content']); + + // ----- Look for abort result + if ($v_result == 2) { + $v_result = PCLZIP_ERR_USER_ABORTED; + } } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -4632,25 +4269,20 @@ // -------------------------------------------------------------------------------- function privReadFileHeader(&$p_header) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadFileHeader", ""); $v_result=1; // ----- Read the 4 bytes signature $v_binary_data = @fread($this->zip_fd, 4); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); $v_data = unpack('Vid', $v_binary_data); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); // ----- Check signature if ($v_data['id'] != 0x04034b50) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid File header"); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -4662,53 +4294,36 @@ { $p_header['filename'] = ""; $p_header['status'] = "invalid_header"; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Extract the values - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header : '".$v_binary_data."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header (Hex) : '".bin2hex($v_binary_data)."'"); $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); // ----- Get filename - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "File name length : ".$v_data['filename_len']); $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename : \''.$p_header['filename'].'\''); // ----- Get extra_fields - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extra field length : ".$v_data['extra_len']); if ($v_data['extra_len'] != 0) { $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); } else { $p_header['extra'] = ''; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Extra field : \''.bin2hex($p_header['extra']).'\''); // ----- Extract properties $p_header['version_extracted'] = $v_data['version']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : ('.$p_header['version_extracted'].') \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); $p_header['compression'] = $v_data['compression']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compression method : \''.$p_header['compression'].'\''); $p_header['size'] = $v_data['size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_header['size'].'\''); $p_header['compressed_size'] = $v_data['compressed_size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_header['compressed_size'].'\''); $p_header['crc'] = $v_data['crc']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); $p_header['flag'] = $v_data['flag']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag : \''.$p_header['flag'].'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag bit 11 (from right) : \''.($p_header['flag']&0x0400).'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag bit 11 (from left) : \''.($p_header['flag']&0x0020).'\''); $p_header['filename_len'] = $v_data['filename_len']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename_len : \''.$p_header['filename_len'].'\''); // ----- Recuperate date in UNIX format $p_header['mdate'] = $v_data['mdate']; @@ -4728,17 +4343,14 @@ // ----- Get UNIX date format $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } else { $p_header['mtime'] = time(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } // TBC //for(reset($v_data); $key = key($v_data); next($v_data)) { - // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Attribut[$key] = ".$v_data[$key]); //} // ----- Set the stored filename @@ -4748,7 +4360,6 @@ $p_header['status'] = "ok"; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -4761,25 +4372,20 @@ // -------------------------------------------------------------------------------- function privReadCentralFileHeader(&$p_header) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadCentralFileHeader", ""); $v_result=1; // ----- Read the 4 bytes signature $v_binary_data = @fread($this->zip_fd, 4); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); $v_data = unpack('Vid', $v_binary_data); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); // ----- Check signature if ($v_data['id'] != 0x02014b50) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid Central Dir File signature"); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -4791,53 +4397,36 @@ { $p_header['filename'] = ""; $p_header['status'] = "invalid_header"; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Extract the values - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header : '".$v_binary_data."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header (Hex) : '".bin2hex($v_binary_data)."'"); $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); // ----- Get filename - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File name length : ".$p_header['filename_len']); if ($p_header['filename_len'] != 0) $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); else $p_header['filename'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Filename : \''.$p_header['filename'].'\''); // ----- Get extra - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Extra length : ".$p_header['extra_len']); if ($p_header['extra_len'] != 0) $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); else $p_header['extra'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Extra : \''.$p_header['extra'].'\''); // ----- Get comment - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Comment length : ".$p_header['comment_len']); if ($p_header['comment_len'] != 0) $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); else $p_header['comment'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Comment : \''.$p_header['comment'].'\''); // ----- Extract properties - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version : \''.($p_header['version']/10).'.'.($p_header['version']%10).'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Size : \''.$p_header['size'].'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Compressed Size : \''.$p_header['compressed_size'].'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Flag : \''.$p_header['flag'].'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Offset : \''.$p_header['offset'].'\''); // ----- Recuperate date in UNIX format //if ($p_header['mdate'] && $p_header['mtime']) @@ -4857,12 +4446,10 @@ // ----- Get UNIX date format $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } else { $p_header['mtime'] = time(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); } // ----- Set the stored filename @@ -4872,18 +4459,13 @@ $p_header['status'] = 'ok'; // ----- Look if it is a directory - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Internal (Hex) : '".sprintf("Ox%04X", $p_header['internal'])."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "External (Hex) : '".sprintf("Ox%04X", $p_header['external'])."' (".(($p_header['external']&0x00000010)==0x00000010?'is a folder':'is a file').')'); if (substr($p_header['filename'], -1) == '/') { //$p_header['external'] = 0x41FF0010; $p_header['external'] = 0x00000010; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Force folder external : \''.sprintf("Ox%04X", $p_header['external']).'\''); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Header of filename : \''.$p_header['filename'].'\''); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -4898,44 +4480,31 @@ // -------------------------------------------------------------------------------- function privCheckFileHeaders(&$p_local_header, &$p_central_header) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFileHeaders", ""); $v_result=1; // ----- Check the static values // TBC if ($p_local_header['filename'] != $p_central_header['filename']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename" : TBC To Be Completed'); } if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "version_extracted" : TBC To Be Completed'); } if ($p_local_header['flag'] != $p_central_header['flag']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "flag" : TBC To Be Completed'); } if ($p_local_header['compression'] != $p_central_header['compression']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "compression" : TBC To Be Completed'); } if ($p_local_header['mtime'] != $p_central_header['mtime']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "mtime" : TBC To Be Completed'); } if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed'); } - + // ----- Look for flag bit 3 if (($p_local_header['flag'] & 8) == 8) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !'); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'File size, compression size and crc found in central header'); $p_local_header['size'] = $p_central_header['size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_local_header['size'].'\''); $p_local_header['compressed_size'] = $p_central_header['compressed_size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_local_header['compressed_size'].'\''); $p_local_header['crc'] = $p_central_header['crc']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_local_header['crc']).'\''); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -4948,21 +4517,17 @@ // -------------------------------------------------------------------------------- function privReadEndCentralDir(&$p_central_dir) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadEndCentralDir", ""); $v_result=1; // ----- Go to the end of the zip file $v_size = filesize($this->zipname); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size of the file :$v_size"); @fseek($this->zip_fd, $v_size); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position at end of zip file : \''.ftell($this->zip_fd).'\''); if (@ftell($this->zip_fd) != $v_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -4970,28 +4535,22 @@ // in this case the end of central dir is at 22 bytes of the file end $v_found = 0; if ($v_size > 26) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Look for central dir with no comment'); @fseek($this->zip_fd, $v_size-22); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after min central position : \''.ftell($this->zip_fd).'\''); if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Read for bytes $v_binary_data = @fread($this->zip_fd, 4); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); $v_data = @unpack('Vid', $v_binary_data); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); // ----- Check signature if ($v_data['id'] == 0x06054b50) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found central dir at the default position."); $v_found = 1; } @@ -5000,7 +4559,6 @@ // ----- Go back to the maximum possible size of the Central Dir End Record if (!$v_found) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Start extended search of end central dir'); $v_maximum_size = 65557; // 0xFFFF + 22; if ($v_maximum_size > $v_size) $v_maximum_size = $v_size; @@ -5011,10 +4569,8 @@ PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after max central position : \''.ftell($this->zip_fd).'\''); // ----- Read byte per byte in order to find the signature $v_pos = ftell($this->zip_fd); @@ -5025,15 +4581,14 @@ $v_byte = @fread($this->zip_fd, 1); // ----- Add the byte - // $v_bytes = ($v_bytes << 8) | Ord($v_byte); - // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number - // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. - $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); + //$v_bytes = ($v_bytes << 8) | Ord($v_byte); + // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number + // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. + $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); // ----- Compare the bytes if ($v_bytes == 0x504b0506) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Found End Central Dir signature at position : \''.ftell($this->zip_fd).'\''); $v_pos++; break; } @@ -5044,13 +4599,11 @@ // ----- Look if not found end of central dir if ($v_pos == $v_size) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to find End of Central Dir Record signature"); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } @@ -5061,25 +4614,19 @@ // ----- Look for invalid block size if (strlen($v_binary_data) != 18) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Extract the values - ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record : '".$v_binary_data."'"); - ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record (Hex) : '".bin2hex($v_binary_data)."'"); $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); // ----- Check the global size - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Comment length : ".$v_data['comment_size']); if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The central dir is not at the end of the archive. Some trailing bytes exists after the archive."); // ----- Removed in release 2.2 see readme file // The check of the file size is a little too strict. @@ -5092,40 +4639,29 @@ .' Some trailing bytes exists after the archive.'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } } // ----- Get comment - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment size : \''.$v_data['comment_size'].'\''); if ($v_data['comment_size'] != 0) { $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); } else $p_central_dir['comment'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment : \''.$p_central_dir['comment'].'\''); $p_central_dir['entries'] = $v_data['entries']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries : \''.$p_central_dir['entries'].'\''); $p_central_dir['disk_entries'] = $v_data['disk_entries']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries for this disk : \''.$p_central_dir['disk_entries'].'\''); $p_central_dir['offset'] = $v_data['offset']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Offset of Central Dir : \''.$p_central_dir['offset'].'\''); $p_central_dir['size'] = $v_data['size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size of Central Dir : \''.$p_central_dir['size'].'\''); $p_central_dir['disk'] = $v_data['disk']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Disk number : \''.$p_central_dir['disk'].'\''); $p_central_dir['disk_start'] = $v_data['disk_start']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Start disk number : \''.$p_central_dir['disk_start'].'\''); // TBC //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { - // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "central_dir[$key] = ".$p_central_dir[$key]); //} // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -5138,16 +4674,13 @@ // -------------------------------------------------------------------------------- function privDeleteByRule(&$p_result_list, &$p_options) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDeleteByRule", ""); $v_result=1; $v_list_detail = array(); // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -5156,21 +4689,16 @@ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); // ----- Scan all the files // ----- Start at beginning of Central Dir $v_pos_entry = $v_central_dir['offset']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_pos_entry)) { // ----- Close the zip file @@ -5180,17 +4708,14 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Read each entry $v_header_list = array(); $j_start = 0; for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry (index '$i')"); // ----- Read the file header $v_header_list[$v_nb_extracted] = array(); @@ -5199,11 +4724,9 @@ // ----- Close the zip file $this->privCloseFd(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename (index '$i') : '".$v_header_list[$v_nb_extracted]['stored_filename']."'"); // ----- Store the index $v_header_list[$v_nb_extracted]['index'] = $i; @@ -5214,54 +4737,47 @@ // ----- Look for extract by name rule if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); // ----- Look if the filename is in the list for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); $v_found = true; } elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The entry is the searched directory"); $v_found = true; } } // ----- Look for a filename elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); $v_found = true; } } } // ----- Look for extract by ereg rule + // ereg() is deprecated with PHP 5.3 + /* else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_found = true; } } + */ // ----- Look for extract by preg rule else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); $v_found = true; } } @@ -5269,41 +4785,33 @@ // ----- Look for extract by index rule else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); // ----- Look if the index is in the list for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); $v_found = true; } if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); $j_start = $j+1; } if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); break; } } } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "No argument mean remove all file"); $v_found = true; } // ----- Look for deletion if ($v_found) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' need to be deleted"); unset($v_header_list[$v_nb_extracted]); } else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' will not be deleted"); $v_nb_extracted++; } } @@ -5318,24 +4826,18 @@ $v_temp_zip = new PclZip($v_zip_temp_name); // ----- Open the temporary zip file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary write mode"); if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { $this->privCloseFd(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look which file need to be kept for ($i=0; $izip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { // ----- Close the zip file $this->privCloseFd(); @@ -5346,10 +4848,8 @@ PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); // ----- Read the file header $v_local_header = array(); @@ -5360,10 +4860,9 @@ @unlink($v_zip_temp_name); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - + // ----- Check that local file header is same as central file header if ($this->privCheckFileHeaders($v_local_header, $v_header_list[$i]) != 1) { @@ -5379,10 +4878,8 @@ @unlink($v_zip_temp_name); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset for this file is '".$v_header_list[$i]['offset']."'"); // ----- Read/write the data block if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { @@ -5392,27 +4889,22 @@ @unlink($v_zip_temp_name); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } } // ----- Store the offset of the central dir $v_offset = @ftell($v_temp_zip->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "New offset of central dir : $v_offset"); // ----- Re-Create the Central Dir files header - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the new central directory"); for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { $v_temp_zip->privCloseFd(); $this->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -5420,7 +4912,6 @@ $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the central directory footer"); // ----- Zip file comment $v_comment = ''; @@ -5440,7 +4931,6 @@ @unlink($v_zip_temp_name); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -5456,22 +4946,20 @@ // TBC : I should test the result ... //@rename($v_zip_temp_name, $this->zipname); PclZipUtilRename($v_zip_temp_name, $this->zipname); - + // ----- Destroy the temporary archive unset($v_temp_zip); } - + // ----- Remove every files : reset the file else if ($v_central_dir['entries'] != 0) { $this->privCloseFd(); if (($v_result = $this->privOpenFd('wb')) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -5479,7 +4967,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -5499,25 +4986,21 @@ { $v_result = 1; - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDirCheck", "entry='$p_dir', is_dir='".($p_is_dir?"true":"false")."'"); // ----- Remove the final '/' if (($p_is_dir) && (substr($p_dir, -1)=='/')) { $p_dir = substr($p_dir, 0, strlen($p_dir)-1); } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for entry '$p_dir'"); // ----- Check the directory availability if ((is_dir($p_dir)) || ($p_dir == "")) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory"); return 1; } // ----- Extract parent directory $p_parent_dir = dirname($p_dir); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'"); // ----- Just a check if ($p_parent_dir != $p_dir) @@ -5527,26 +5010,22 @@ { if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } } } // ----- Create the directory - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'"); if (!@mkdir($p_dir, 0777)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created"); return $v_result; } // -------------------------------------------------------------------------------- @@ -5560,41 +5039,34 @@ // -------------------------------------------------------------------------------- function privMerge(&$p_archive_to_add) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privMerge", "archive='".$p_archive_to_add->zipname."'"); $v_result=1; // ----- Look if the archive_to_add exists if (!is_file($p_archive_to_add->zipname)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to add does not exist. End of merge."); // ----- Nothing to merge, so merge is a success $v_result = 1; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look if the archive exists if (!is_file($this->zipname)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, duplicate the archive_to_add."); // ----- Do a duplicate $v_result = $this->privDuplicate($p_archive_to_add->zipname); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -5603,23 +5075,18 @@ if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); // ----- Open the archive_to_add file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open archive_to_add in binary read mode"); if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) { $this->privCloseFd(); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -5630,20 +5097,16 @@ $this->privCloseFd(); $p_archive_to_add->privCloseFd(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); @rewind($p_archive_to_add->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); // ----- Creates a temporay file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Open the temporary file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { $this->privCloseFd(); @@ -5652,7 +5115,6 @@ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -5662,7 +5124,6 @@ while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; @@ -5673,7 +5134,6 @@ while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; @@ -5681,14 +5141,12 @@ // ----- Store the offset of the central dir $v_offset = @ftell($v_zip_temp_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); // ----- Copy the block of file headers from the old archive $v_size = $v_central_dir['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; @@ -5699,7 +5157,6 @@ while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; @@ -5730,7 +5187,6 @@ unset($v_header_list); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } @@ -5756,7 +5212,6 @@ PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -5769,33 +5224,27 @@ // -------------------------------------------------------------------------------- function privDuplicate($p_archive_filename) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDuplicate", "archive_filename='$p_archive_filename'"); $v_result=1; // ----- Look if the $p_archive_filename exists if (!is_file($p_archive_filename)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to duplicate does not exist. End of duplicate."); // ----- Nothing to duplicate, so duplicate is a success. $v_result = 1; // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_result=$this->privOpenFd('wb')) != 1) { // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Open the temporary file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) { $this->privCloseFd(); @@ -5803,7 +5252,6 @@ PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); return PclZip::errorCode(); } @@ -5813,7 +5261,6 @@ while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read $v_read_size bytes"); $v_buffer = fread($v_zip_temp_fd, $v_read_size); @fwrite($this->zip_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; @@ -5826,7 +5273,6 @@ @fclose($v_zip_temp_fd); // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -5873,36 +5319,28 @@ // -------------------------------------------------------------------------------- function privDisableMagicQuotes() { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDisableMagicQuotes', ""); $v_result=1; // ----- Look if function exists if ( (!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look if already done if ($this->magic_quotes_status != -1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote already disabled"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Get and memorize the magic_quote value $this->magic_quotes_status = @get_magic_quotes_runtime(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'"); // ----- Disable magic_quotes if ($this->magic_quotes_status == 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Disable magic_quotes"); @set_magic_quotes_runtime(0); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -5915,32 +5353,25 @@ // -------------------------------------------------------------------------------- function privSwapBackMagicQuotes() { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privSwapBackMagicQuotes', ""); $v_result=1; // ----- Look if function exists if ( (!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Look if something to do if ($this->magic_quotes_status != -1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote not modified"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // ----- Swap back magic_quotes if ($this->magic_quotes_status == 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Enable back magic_quotes"); @set_magic_quotes_runtime($this->magic_quotes_status); } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -5957,7 +5388,6 @@ // -------------------------------------------------------------------------------- function PclZipUtilPathReduction($p_dir) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathReduction", "dir='$p_dir'"); $v_result = ""; // ----- Look for not empty path @@ -5984,7 +5414,6 @@ // ----- It is an invalid path, so the path is not modified // TBC $v_result = $p_dir; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid path is unchanged"); $v_skip = 0; } } @@ -6008,7 +5437,7 @@ } } } - + // ----- Look for skip if ($v_skip > 0) { while ($v_skip > 0) { @@ -6019,7 +5448,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -6041,19 +5469,16 @@ // -------------------------------------------------------------------------------- function PclZipUtilPathInclusion($p_dir, $p_path) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'"); $v_result = 1; - + // ----- Look for path beginning by ./ if ( ($p_dir == '.') || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_dir '".$p_dir."'"); } if ( ($p_path == '.') || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_path '".$p_path."'"); } // ----- Explode dir and path by directory separator @@ -6066,7 +5491,6 @@ $i = 0; $j = 0; while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Working on dir($i)='".$v_list_dir[$i]."' and path($j)='".$v_list_path[$j]."'"); // ----- Look for empty dir (path reduction) if ($v_list_dir[$i] == '') { @@ -6080,7 +5504,6 @@ // ----- Compare the items if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Items ($i,$j) are different"); $v_result = 0; } @@ -6091,11 +5514,9 @@ // ----- Look if everything seems to be the same if ($v_result) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Look for tie break"); // ----- Skip all the empty items while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Looking on dir($i)='".($i < $v_list_dir_size?$v_list_dir[$i]:'')."' and path($j)='".($j < $v_list_path_size?$v_list_path[$j]:'')."'"); if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { // ----- There are exactly the same @@ -6108,7 +5529,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -6126,30 +5546,23 @@ // -------------------------------------------------------------------------------- function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilCopyBlock", "size=$p_size, mode=$p_mode"); $v_result = 1; if ($p_mode==0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset before read :".(@ftell($p_src))); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset before write :".(@ftell($p_dest))); while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($p_src, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset after read :".(@ftell($p_src))); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset after write :".(@ftell($p_dest))); } else if ($p_mode==1) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @gzread($p_src, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; @@ -6160,7 +5573,6 @@ while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @fread($p_src, $v_read_size); @gzwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; @@ -6171,7 +5583,6 @@ while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); $v_buffer = @gzread($p_src, $v_read_size); @gzwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; @@ -6179,7 +5590,6 @@ } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -6198,26 +5608,21 @@ // -------------------------------------------------------------------------------- function PclZipUtilRename($p_src, $p_dest) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilRename", "source=$p_src, destination=$p_dest"); $v_result = 1; // ----- Try to rename the files if (!@rename($p_src, $p_dest)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to rename file, try copy+unlink"); // ----- Try to copy & unlink the src if (!@copy($p_src, $p_dest)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to copy file"); $v_result = 0; } else if (!@unlink($p_src)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to unlink old filename"); $v_result = 0; } } // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- @@ -6233,8 +5638,7 @@ // -------------------------------------------------------------------------------- function PclZipUtilOptionText($p_option) { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'"); - + $v_list = get_defined_constants(); for (reset($v_list); $v_key = key($v_list); next($v_list)) { $v_prefix = substr($v_key, 0, 10); @@ -6242,14 +5646,12 @@ || ($v_prefix == 'PCLZIP_CB_') || ($v_prefix == 'PCLZIP_ATT')) && ($v_list[$v_key] == $p_option)) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_key); return $v_key; } } - + $v_result = 'Unknown'; - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); return $v_result; } // -------------------------------------------------------------------------------- diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php index 2569a867..6b0d0981 100644 --- a/wp-admin/includes/class-wp-filesystem-base.php +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -210,7 +210,7 @@ class WP_Filesystem_Base { return trailingslashit($base . $last_path); } if ( $loop ) - return false;//Prevent tihs function looping again. + return false; //Prevent tihs function looping again. //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. return $this->search_for_folder($folder, '/', true); @@ -242,7 +242,7 @@ class WP_Filesystem_Base { $info = 'd'; elseif (($perms & 0x2000) == 0x2000) // Character special $info = 'c'; - elseif (($perms & 0x1000) == 0x1000)// FIFO pipe + elseif (($perms & 0x1000) == 0x1000) // FIFO pipe $info = 'p'; else // Unknown $info = 'u'; diff --git a/wp-admin/includes/class-wp-filesystem-direct.php b/wp-admin/includes/class-wp-filesystem-direct.php index 03a79773..88e4a902 100644 --- a/wp-admin/includes/class-wp-filesystem-direct.php +++ b/wp-admin/includes/class-wp-filesystem-direct.php @@ -15,38 +15,84 @@ * @uses WP_Filesystem_Base Extends class */ class WP_Filesystem_Direct extends WP_Filesystem_Base { - var $permission = null; var $errors = null; + /** + * constructor + * + * @param $arg mixed ingored argument + */ function WP_Filesystem_Direct($arg) { $this->method = 'direct'; $this->errors = new WP_Error(); } + /** + * connect filesystem. + * + * @return bool Returns true on success or false on failure (always true for WP_Filesystem_Direct). + */ function connect() { return true; } - function setDefaultPermissions($perm) { - $this->permission = $perm; - } + /** + * Reads entire file into a string + * + * @param $file string Name of the file to read. + * @return string|bool The function returns the read data or false on failure. + */ function get_contents($file) { return @file_get_contents($file); } + /** + * Reads entire file into an array + * + * @param $file string Path to the file. + * @return array|bool the file contents in an array or false on failure. + */ function get_contents_array($file) { return @file($file); } + /** + * Write a string to a file + * + * @param $file string Path to the file where to write the data. + * @param $contents string The data to write. + * @param $mode int (optional) The file permissions as octal number, usually 0644. + * @param $type string (optional) Specifies additional type of access you require to the file. + * @return bool False upon failure. + */ function put_contents($file, $contents, $mode = false, $type = '') { if ( ! ($fp = @fopen($file, 'w' . $type)) ) return false; @fwrite($fp, $contents); @fclose($fp); - $this->chmod($file,$mode); + $this->chmod($file, $mode); return true; } + /** + * Gets the current working directory + * + * @return string|bool the current working directory on success, or false on failure. + */ function cwd() { return @getcwd(); } + /** + * Change directory + * + * @param $dir string The new current directory. + * @return bool Returns true on success or false on failure. + */ function chdir($dir) { return @chdir($dir); } + /** + * Changes file group + * + * @param $file string Path to the file. + * @param $group mixed A group name or number. + * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False. + * @return bool Returns true on success or false on failure. + */ function chgrp($file, $group, $recursive = false) { if ( ! $this->exists($file) ) return false; @@ -62,19 +108,25 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return true; } + /** + * Changes filesystem permissions + * + * @param $file string Path to the file. + * @param $mode int (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs. + * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False. + * @return bool Returns true on success or false on failure. + */ function chmod($file, $mode = false, $recursive = false) { if ( ! $this->exists($file) ) return false; if ( ! $mode ) { - if ( $this->permission ) - $mode = $this->permission; - elseif ( $this->is_file($file) ) + if ( $this->is_file($file) ) $mode = FS_CHMOD_FILE; elseif ( $this->is_dir($file) ) $mode = FS_CHMOD_DIR; else - return false; + return false; } if ( ! $recursive ) @@ -89,6 +141,14 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return true; } + /** + * Changes file owner + * + * @param $file string Path to the file. + * @param $owner mixed A user name or number. + * @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False. + * @return bool Returns true on success or false on failure. + */ function chown($file, $owner, $recursive = false) { if ( ! $this->exists($file) ) return false; @@ -98,11 +158,17 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return @chown($file, $owner); //Is a directory, and we want recursive $filelist = $this->dirlist($file); - foreach ($filelist as $filename){ + foreach ($filelist as $filename) { $this->chown($file . '/' . $filename, $owner, $recursive); } return true; } + /** + * Gets file owner + * + * @param $file string Path to the file. + * @return string Username of the user. + */ function owner($file) { $owneruid = @fileowner($file); if ( ! $owneruid ) @@ -112,6 +178,14 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { $ownerarray = posix_getpwuid($owneruid); return $ownerarray['name']; } + /** + * Gets file permissions + * + * FIXME does not handle errors in fileperms() + * + * @param $file string Path to the file. + * @return string Mode of the file (last 4 digits). + */ function getchmod($file) { return substr(decoct(@fileperms($file)),3); } @@ -133,7 +207,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { function move($source, $destination, $overwrite = false) { //Possible to use rename()? - if ( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){ + if ( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ) { $this->delete($source); return true; } else { @@ -197,7 +271,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return @filesize($file); } - function touch($file, $time = 0, $atime = 0){ + function touch($file, $time = 0, $atime = 0) { if ($time == 0) $time = time(); if ($atime == 0) @@ -205,7 +279,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return @touch($file, $time, $atime); } - function mkdir($path, $chmod = false, $chown = false, $chgrp = false){ + function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { + if ( ! $chmod ) + $chmod = FS_CHMOD_DIR; + if ( ! @mkdir($path) ) return false; $this->chmod($path, $chmod); @@ -230,29 +307,34 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return @rmdir($path); } - function dirlist($path, $incdot = false, $recursive = false) { + function dirlist($path, $include_hidden = true, $recursive = false) { if ( $this->is_file($path) ) { - $limitFile = basename($path); + $limit_file = basename($path); $path = dirname($path); } else { - $limitFile = false; + $limit_file = false; } + if ( ! $this->is_dir($path) ) return false; - $ret = array(); $dir = @dir($path); if ( ! $dir ) return false; + + $ret = array(); + while (false !== ($entry = $dir->read()) ) { $struc = array(); $struc['name'] = $entry; if ( '.' == $struc['name'] || '..' == $struc['name'] ) - continue; //Do not care about these folders. - if ( '.' == $struc['name'][0] && !$incdot) continue; - if ( $limitFile && $struc['name'] != $limitFile) + + if ( ! $include_hidden && '.' == $struc['name'][0] ) + continue; + + if ( $limit_file && $struc['name'] != $limit_file) continue; $struc['perms'] = $this->gethchmod($path.'/'.$entry); @@ -268,7 +350,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { if ( 'd' == $struc['type'] ) { if ( $recursive ) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); + $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive); else $struc['files'] = array(); } diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php index 24611c92..b8d5c9ae 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -16,12 +16,9 @@ */ class WP_Filesystem_FTPext extends WP_Filesystem_Base { var $link; - var $timeout = 5; var $errors = null; var $options = array(); - var $permission = null; - function WP_Filesystem_FTPext($opt='') { $this->method = 'ftpext'; $this->errors = new WP_Error(); @@ -33,6 +30,11 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } // Set defaults: + //This Class uses the timeout on a per-connection basis, Others use it on a per-action basis. + + if ( ! defined('FS_TIMEOUT') ) + define('FS_TIMEOUT', 240); + if ( empty($opt['port']) ) $this->options['port'] = 21; else @@ -64,9 +66,9 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { function connect() { if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') ) - $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], $this->timeout); + $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT); else - $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], $this->timeout); + $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT); if ( ! $this->link ) { $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); @@ -80,23 +82,21 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { //Set the Connection to use Passive FTP @ftp_pasv( $this->link, true ); + if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT ) + @ftp_set_option($this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT); return true; } - function setDefaultPermissions($perm) { - $this->permission = $perm; - } - - function get_contents($file, $type = '', $resumepos = 0 ){ - if( empty($type) ) + function get_contents($file, $type = '', $resumepos = 0 ) { + if ( empty($type) ) $type = FTP_BINARY; $temp = tmpfile(); if ( ! $temp ) return false; - if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) ) + if ( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) ) return false; fseek($temp, 0); //Skip back to the start of the file being written to @@ -112,7 +112,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return explode("\n", $this->get_contents($file)); } function put_contents($file, $contents, $type = '' ) { - if( empty($type) ) + if ( empty($type) ) $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; $temp = tmpfile(); @@ -129,23 +129,29 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } function cwd() { $cwd = @ftp_pwd($this->link); - if( $cwd ) + if ( $cwd ) $cwd = trailingslashit($cwd); return $cwd; } function chdir($dir) { - return @ftp_chdir($dir); + return @ftp_chdir($this->link, $dir); } function chgrp($file, $group, $recursive = false ) { return false; } function chmod($file, $mode = false, $recursive = false) { - if( ! $mode ) - $mode = $this->permission; - if( ! $mode ) - return false; if ( ! $this->exists($file) && ! $this->is_dir($file) ) return false; + + if ( ! $mode ) { + if ( $this->is_file($file) ) + $mode = FS_CHMOD_FILE; + elseif ( $this->is_dir($file) ) + $mode = FS_CHMOD_DIR; + else + return false; + } + if ( ! $recursive || ! $this->is_dir($file) ) { if ( ! function_exists('ftp_chmod') ) return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file)); @@ -153,7 +159,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } //Is a directory, and we want recursive $filelist = $this->dirlist($file); - foreach($filelist as $filename){ + foreach ( $filelist as $filename ) { $this->chmod($file . '/' . $filename, $mode, $recursive); } return true; @@ -174,10 +180,10 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return $dir[$file]['group']; } function copy($source, $destination, $overwrite = false ) { - if( ! $overwrite && $this->exists($destination) ) + if ( ! $overwrite && $this->exists($destination) ) return false; $content = $this->get_contents($source); - if( false === $content) + if ( false === $content) return false; return $this->put_contents($destination, $content); } @@ -201,7 +207,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } function exists($file) { - $list = @ftp_rawlist($this->link, $file, false); + $list = @ftp_nlist($this->link, $file); return !empty($list); //empty list = no file, so invert. } function is_file($file) { @@ -210,7 +216,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { function is_dir($path) { $cwd = $this->cwd(); $result = @ftp_chdir($this->link, trailingslashit($path) ); - if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) { + if ( $result && $path == $this->cwd() || $this->cwd() != $cwd ) { @ftp_chdir($this->link, $cwd); return true; } @@ -237,13 +243,14 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return false; } function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { - if( !ftp_mkdir($this->link, $path) ) + if ( !ftp_mkdir($this->link, $path) ) return false; - if( $chmod ) - $this->chmod($path, $chmod); - if( $chown ) + if ( ! $chmod ) + $chmod = FS_CHMOD_DIR; + $this->chmod($path, $chmod); + if ( $chown ) $this->chown($path, $chown); - if( $chgrp ) + if ( $chgrp ) $this->chgrp($path, $chgrp); return true; } @@ -256,9 +263,9 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { if ( is_null($is_windows) ) $is_windows = strpos( strtolower(ftp_systype($this->link)), 'win') !== false; - if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/", $line, $lucifer)) { + if ( $is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/", $line, $lucifer) ) { $b = array(); - if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix + if ( $lucifer[3] < 70 ) { $lucifer[3] +=2000; } else { $lucifer[3] += 1900; } // 4digit year fix $b['isdir'] = ($lucifer[7]==""); if ( $b['isdir'] ) $b['type'] = 'd'; @@ -316,12 +323,12 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return $b; } - function dirlist($path = '.', $incdot = false, $recursive = false) { - if( $this->is_file($path) ) { - $limitFile = basename($path); + function dirlist($path = '.', $include_hidden = true, $recursive = false) { + if ( $this->is_file($path) ) { + $limit_file = basename($path); $path = dirname($path) . '/'; } else { - $limitFile = false; + $limit_file = false; } $list = @ftp_rawlist($this->link, '-a ' . $path, false); @@ -335,7 +342,13 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { if ( empty($entry) ) continue; - if ( '.' == $entry["name"] || '..' == $entry["name"] ) + if ( '.' == $entry['name'] || '..' == $entry['name'] ) + continue; + + if ( ! $include_hidden && '.' == $entry['name'][0] ) + continue; + + if ( $limit_file && $entry['name'] != $limit_file) continue; $dirlist[ $entry['name'] ] = $entry; @@ -343,34 +356,23 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { if ( ! $dirlist ) return false; - if ( empty($dirlist) ) - return array(); $ret = array(); - foreach ( $dirlist as $struc ) { - + foreach ( (array)$dirlist as $struc ) { if ( 'd' == $struc['type'] ) { - $struc['files'] = array(); - - if ( $incdot ){ - //We're including the doted starts - if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } else { //No dots - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } + if ( $recursive ) + $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive); + else + $struc['files'] = array(); } - //File - $ret[$struc['name']] = $struc; + + $ret[ $struc['name'] ] = $struc; } return $ret; } - function __destruct(){ - if( $this->link ) + function __destruct() { + if ( $this->link ) ftp_close($this->link); } } diff --git a/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/wp-admin/includes/class-wp-filesystem-ftpsockets.php index 759eaa82..a72abaa7 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -16,18 +16,15 @@ */ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { var $ftp = false; - var $timeout = 5; var $errors = null; var $options = array(); - var $permission = null; - function WP_Filesystem_ftpsockets($opt = '') { $this->method = 'ftpsockets'; $this->errors = new WP_Error(); //Check if possible to use ftp functions. - if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) + if ( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) return false; $this->ftp = new ftp(); @@ -61,12 +58,13 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { if ( ! $this->ftp ) return false; - //$this->ftp->Verbose = true; + $this->ftp->setTimeout(FS_CONNECT_TIMEOUT); if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) { $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); return false; } + if ( ! $this->ftp->connect() ) { $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); return false; @@ -79,18 +77,15 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { $this->ftp->SetType(FTP_AUTOASCII); $this->ftp->Passive(true); + $this->ftp->setTimeout(FS_TIMEOUT); return true; } - function setDefaultPermissions($perm) { - $this->permission = $perm; - } - function get_contents($file, $type = '', $resumepos = 0) { - if( ! $this->exists($file) ) + if ( ! $this->exists($file) ) return false; - if( empty($type) ) + if ( empty($type) ) $type = FTP_AUTOASCII; $this->ftp->SetType($type); @@ -121,13 +116,13 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } function put_contents($file, $contents, $type = '' ) { - if( empty($type) ) + if ( empty($type) ) $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; $this->ftp->SetType($type); $temp = wp_tempnam( $file ); - if ( ! $temphandle = fopen($temp, 'w+') ){ + if ( ! $temphandle = fopen($temp, 'w+') ) { unlink($temp); return false; } @@ -144,7 +139,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { function cwd() { $cwd = $this->ftp->pwd(); - if( $cwd ) + if ( $cwd ) $cwd = trailingslashit($cwd); return $cwd; } @@ -158,20 +153,25 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } function chmod($file, $mode = false, $recursive = false ) { - if( ! $mode ) - $mode = $this->permission; - if( ! $mode ) - return false; - //if( ! $this->exists($file) ) - // return false; - if( ! $recursive || ! $this->is_dir($file) ) { - return $this->ftp->chmod($file,$mode); + + if ( ! $mode ) { + if ( $this->is_file($file) ) + $mode = FS_CHMOD_FILE; + elseif ( $this->is_dir($file) ) + $mode = FS_CHMOD_DIR; + else + return false; + } + + if ( ! $recursive || ! $this->is_dir($file) ) { + return $this->ftp->chmod($file, $mode); } + //Is a directory, and we want recursive $filelist = $this->dirlist($file); - foreach($filelist as $filename){ + foreach ( $filelist as $filename ) $this->chmod($file . '/' . $filename, $mode, $recursive); - } + return true; } @@ -195,7 +195,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } function copy($source, $destination, $overwrite = false ) { - if( ! $overwrite && $this->exists($destination) ) + if ( ! $overwrite && $this->exists($destination) ) return false; $content = $this->get_contents($source); @@ -264,57 +264,57 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) { - if( ! $this->ftp->mkdir($path) ) + if ( ! $this->ftp->mkdir($path) ) return false; - if( $chmod ) - $this->chmod($path, $chmod); - if( $chown ) + if ( ! $chmod ) + $chmod = FS_CHMOD_DIR; + $this->chmod($path, $chmod); + if ( $chown ) $this->chown($path, $chown); - if( $chgrp ) + if ( $chgrp ) $this->chgrp($path, $chgrp); return true; } function rmdir($path, $recursive = false ) { - if( ! $recursive ) + if ( ! $recursive ) return $this->ftp->rmdir($path); return $this->ftp->mdel($path); } - function dirlist($path = '.', $incdot = false, $recursive = false ) { - if( $this->is_file($path) ) { - $limitFile = basename($path); + function dirlist($path = '.', $include_hidden = true, $recursive = false ) { + if ( $this->is_file($path) ) { + $limit_file = basename($path); $path = dirname($path) . '/'; } else { - $limitFile = false; + $limit_file = false; } $list = $this->ftp->dirlist($path); - if( ! $list ) + if ( ! $list ) return false; - if( empty($list) ) - return array(); $ret = array(); foreach ( $list as $struc ) { + if ( '.' == $struc['name'] || '..' == $struc['name'] ) + continue; + + if ( ! $include_hidden && '.' == $struc['name'][0] ) + continue; + + if ( $limit_file && $struc['name'] != $limit_file ) + continue; + if ( 'd' == $struc['type'] ) { - $struc['files'] = array(); - - if ( $incdot ){ - //We're including the doted starts - if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } else { //No dots - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } + if ( $recursive ) + $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive); + else + $struc['files'] = array(); } - //File - $ret[$struc['name']] = $struc; + + $ret[ $struc['name'] ] = $struc; } return $ret; } diff --git a/wp-admin/includes/class-wp-filesystem-ssh2.php b/wp-admin/includes/class-wp-filesystem-ssh2.php index 89763df8..0337658c 100644 --- a/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -45,19 +45,9 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { var $link = false; var $sftp_link = false; var $keys = false; - /* - * This is the timeout value for ssh results. - * Slower servers might need this incressed, but this number otherwise should not change. - * - * @parm $timeout int - * - */ - var $timeout = 15; var $errors = array(); var $options = array(); - var $permission = 0644; - function WP_Filesystem_SSH2($opt='') { $this->method = 'ssh2'; $this->errors = new WP_Error(); @@ -148,7 +138,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { $this->errors->add('command', sprintf(__('Unable to perform command: %s'), $command)); } else { stream_set_blocking( $stream, true ); - stream_set_timeout( $stream, $this->timeout ); + stream_set_timeout( $stream, FS_TIMEOUT ); $data = stream_get_contents( $stream ); fclose( $stream ); @@ -160,12 +150,6 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { return false; } - function setDefaultPermissions($perm) { - $this->debug("setDefaultPermissions();"); - if ( $perm ) - $this->permission = $perm; - } - function get_contents($file, $type = '', $resumepos = 0 ) { $file = ltrim($file, '/'); return file_get_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file); @@ -178,7 +162,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { function put_contents($file, $contents, $type = '' ) { $file = ltrim($file, '/'); - return file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents); + return false !== file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents); } function cwd() { @@ -201,12 +185,18 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { } function chmod($file, $mode = false, $recursive = false) { - if( ! $mode ) - $mode = $this->permission; - if( ! $mode ) - return false; if ( ! $this->exists($file) ) return false; + + if ( ! $mode ) { + if ( $this->is_file($file) ) + $mode = FS_CHMOD_FILE; + elseif ( $this->is_dir($file) ) + $mode = FS_CHMOD_DIR; + else + return false; + } + if ( ! $recursive || ! $this->is_dir($file) ) return $this->run_command(sprintf('chmod %o %s', $mode, escapeshellarg($file)), true); return $this->run_command(sprintf('chmod -R %o %s', $mode, escapeshellarg($file)), true); @@ -315,9 +305,10 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { //Not implmented. } - function mkdir($path, $chmod = null, $chown = false, $chgrp = false) { + function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { $path = untrailingslashit($path); - $chmod = !empty($chmod) ? $chmod : $this->permission; + if ( ! $chmod ) + $chmod = FS_CHMOD_DIR; if ( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) ) return false; if ( $chown ) @@ -331,29 +322,34 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { return $this->delete($path, $recursive); } - function dirlist($path, $incdot = false, $recursive = false) { + function dirlist($path, $include_hidden = true, $recursive = false) { if ( $this->is_file($path) ) { - $limitFile = basename($path); + $limit_file = basename($path); $path = dirname($path); } else { - $limitFile = false; + $limit_file = false; } + if ( ! $this->is_dir($path) ) return false; $ret = array(); $dir = @dir('ssh2.sftp://' . $this->sftp_link .'/' . ltrim($path, '/') ); + if ( ! $dir ) return false; + while (false !== ($entry = $dir->read()) ) { $struc = array(); $struc['name'] = $entry; if ( '.' == $struc['name'] || '..' == $struc['name'] ) continue; //Do not care about these folders. - if ( '.' == $struc['name'][0] && !$incdot) + + if ( ! $include_hidden && '.' == $struc['name'][0] ) continue; - if ( $limitFile && $struc['name'] != $limitFile) + + if ( $limit_file && $struc['name'] != $limit_file ) continue; $struc['perms'] = $this->gethchmod($path.'/'.$entry); @@ -369,7 +365,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { if ( 'd' == $struc['type'] ) { if ( $recursive ) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); + $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive); else $struc['files'] = array(); } diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 76b11fe8..2be38f75 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -81,20 +81,28 @@ class WP_Upgrader { return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors); foreach ( (array)$directories as $dir ) { - if ( ABSPATH == $dir && ! $wp_filesystem->abspath() ) - return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']); - - elseif ( WP_CONTENT_DIR == $dir && ! $wp_filesystem->wp_content_dir() ) - return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']); - - elseif ( WP_PLUGIN_DIR == $dir && ! $wp_filesystem->wp_plugins_dir() ) - return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']); - - elseif ( WP_CONTENT_DIR . '/themes' == $dir && ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') ) - return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']); - - elseif ( ! $wp_filesystem->find_folder($dir) ) - return new WP_Error('fs_no_folder', sprintf($strings['fs_no_folder'], $dir)); + switch ( $dir ) { + case ABSPATH: + if ( ! $wp_filesystem->abspath() ) + return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']); + break; + case WP_CONTENT_DIR: + if ( ! $wp_filesystem->wp_content_dir() ) + return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']); + break; + case WP_PLUGIN_DIR: + if ( ! $wp_filesystem->wp_plugins_dir() ) + return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']); + break; + case WP_CONTENT_DIR . '/themes': + if ( ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') ) + return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']); + break; + default: + if ( ! $wp_filesystem->find_folder($dir) ) + return new WP_Error('fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir)); + break; + } } return true; } //end fs_connect(); @@ -202,24 +210,26 @@ class WP_Upgrader { $destination = trailingslashit($destination) . trailingslashit(basename($source)); } - //If we're not clearing the destination folder, and something exists there allready, Bail. - if ( ! $clear_destination && $wp_filesystem->exists($remote_destination) ) { - $wp_filesystem->delete($remote_source, true); //Clear out the source files. - return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination ); - } else if ( $clear_destination ) { - //We're going to clear the destination if theres something there - $this->skin->feedback('remove_old'); - - $removed = true; - if ( $wp_filesystem->exists($remote_destination) ) + if ( $wp_filesystem->exists($remote_destination) ) { + if ( $clear_destination ) { + //We're going to clear the destination if theres something there + $this->skin->feedback('remove_old'); $removed = $wp_filesystem->delete($remote_destination, true); - - $removed = apply_filters('upgrader_clear_destination', $removed, $local_destination, $remote_destination, $hook_extra); - - if ( is_wp_error($removed) ) - return $removed; - else if ( ! $removed ) - return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); + $removed = apply_filters('upgrader_clear_destination', $removed, $local_destination, $remote_destination, $hook_extra); + + if ( is_wp_error($removed) ) + return $removed; + else if ( ! $removed ) + return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); + } else { + //If we're not clearing the destination folder and something exists there allready, Bail. + //But first check to see if there are actually any files in the folder. + $_files = $wp_filesystem->dirlist($remote_destination); + if ( ! empty($_files) ) { + $wp_filesystem->delete($remote_source, true); //Clear out the source files. + return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination ); + } + } } //Create destination if needed @@ -261,6 +271,7 @@ class WP_Upgrader { 'destination' => '', //And this 'clear_destination' => false, 'clear_working' => true, + 'is_multi' => false, 'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters. ); @@ -277,7 +288,9 @@ class WP_Upgrader { return $res; } - $this->skin->header(); + if ( !$is_multi ) // call $this->header separately if running multiple times + $this->skin->header(); + $this->skin->before(); //Download the package (Note, This just returns the filename of the file if the package is a local file) @@ -311,7 +324,10 @@ class WP_Upgrader { $this->skin->feedback('process_success'); } $this->skin->after(); - $this->skin->footer(); + + if ( !$is_multi ) + $this->skin->footer(); + return $result; } @@ -344,6 +360,8 @@ class WP_Upgrader { class Plugin_Upgrader extends WP_Upgrader { var $result; + var $bulk = false; + var $show_before = ''; function upgrade_strings() { $this->strings['up_to_date'] = __('The plugin is at the latest version.'); @@ -414,7 +432,7 @@ class Plugin_Upgrader extends WP_Upgrader { ) )); - //Cleanup our hooks, incase something else does a upgrade on this connection. + // Cleanup our hooks, incase something else does a upgrade on this connection. remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade')); remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); @@ -425,6 +443,76 @@ class Plugin_Upgrader extends WP_Upgrader { delete_transient('update_plugins'); } + function bulk_upgrade($plugins) { + + $this->init(); + $this->bulk = true; + $this->upgrade_strings(); + + $current = get_transient( 'update_plugins' ); + + add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); + + $this->skin->header(); + + // Connect to the Filesystem first. + $res = $this->fs_connect( array(WP_CONTENT_DIR, WP_PLUGIN_DIR) ); + if ( ! $res ) { + $this->skin->footer(); + return false; + } + + $this->maintenance_mode(true); + + $all = count($plugins); + $i = 1; + foreach ( $plugins as $plugin ) { + + $this->show_before = sprintf( '

      ' . __('Updating plugin %1$d of %2$d...') . '

      ', $i, $all ); + $i++; + + if ( !isset( $current->response[ $plugin ] ) ) { + $this->skin->set_result(false); + $this->skin->error('up_to_date'); + $this->skin->after(); + $results[$plugin] = false; + continue; + } + + // Get the URL to the zip file + $r = $current->response[ $plugin ]; + + $this->skin->plugin_active = is_plugin_active($plugin); + + $result = $this->run(array( + 'package' => $r->package, + 'destination' => WP_PLUGIN_DIR, + 'clear_destination' => true, + 'clear_working' => true, + 'is_multi' => true, + 'hook_extra' => array( + 'plugin' => $plugin + ) + )); + + $results[$plugin] = $this->result; + + // Prevent credentials auth screen from displaying multiple times + if ( false === $result ) + break; + } + $this->maintenance_mode(false); + $this->skin->footer(); + + // Cleanup our hooks, incase something else does a upgrade on this connection. + remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); + + // Force refresh of plugin update information + delete_transient('update_plugins'); + + return $results; + } + //return plugin info. function plugin_info() { if ( ! is_array($this->result) ) @@ -560,7 +648,7 @@ class Theme_Upgrader extends WP_Upgrader { $this->skin->after(); return false; } - + $r = $current->response[ $theme ]; add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2); @@ -820,11 +908,15 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { } function after() { + if ( $this->upgrader->bulk ) + return; + $this->plugin = $this->upgrader->plugin_info(); if( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){ show_message(__('Attempting reactivation of the plugin')); echo ''; } + $update_actions = array( 'activate_plugin' => '' . __('Activate Plugin') . '', 'plugins_page' => '' . __('Return to Plugins page') . '' @@ -838,6 +930,13 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { if ( ! empty($update_actions) ) $this->feedback('' . __('Actions:') . ' ' . implode(' | ', (array)$update_actions)); } + + function before() { + if ( $this->upgrader->show_before ) { + echo $this->upgrader->show_before; + $this->upgrader->show_before = ''; + } + } } /** @@ -996,10 +1095,10 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin { $name = $theme_info['Name']; $stylesheet = $this->upgrader->result['destination_name']; $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet; - + $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) ); $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template); - + $update_actions = array( 'preview' => '' . __('Preview') . '', 'activate' => '' . __('Activate') . '', diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 56c5581e..6137a93c 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -34,11 +34,12 @@ function wp_dashboard_setup() { // Incoming Links Widget if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { $update = true; + $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10; $widget_options['dashboard_incoming_links'] = array( 'home' => get_option('home'), - 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), - 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=20&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), - 'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10, + 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), + 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), + 'items' => $num_items, 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false ); } @@ -132,7 +133,7 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ function _wp_dashboard_control_callback( $dashboard, $meta_box ) { echo ''; wp_dashboard_trigger_widget_control( $meta_box['id'] ); - echo "

      "; + echo '

      '; echo ''; } @@ -163,7 +164,7 @@ function wp_dashboard() { $hide2 = $hide3 = $hide4 = 'display:none;'; } ?> -
      +
      \n"; do_meta_boxes( 'dashboard', 'normal', '' ); @@ -179,7 +180,7 @@ function wp_dashboard() { ?>
      -
      +

      total_comments); + $num = '' . number_format_i18n($num_comm->total_comments) . ''; $text = _n( 'Comment', 'Comments', $num_comm->total_comments ); if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; @@ -258,7 +259,7 @@ function wp_dashboard_right_now() { echo '' . $text . ''; // Approved Comments - $num = number_format_i18n($num_comm->approved); + $num = '' . number_format_i18n($num_comm->approved) . ''; $text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved ); if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; @@ -280,10 +281,10 @@ function wp_dashboard_right_now() { echo '' . $text . ''; // Pending Comments - $num = number_format_i18n($num_comm->moderated); + $num = '' . number_format_i18n($num_comm->moderated) . ''; $text = _n( 'Pending', 'Pending', $num_comm->moderated ); if ( current_user_can( 'moderate_comments' ) ) { - $num = "$num"; + $num = "$num"; $text = "$text"; } echo '' . $num . ''; @@ -339,9 +340,9 @@ function wp_dashboard_right_now() { } else { if ( current_user_can( 'switch_themes' ) ) { echo '' . __('Change Theme') . ''; - printf('Theme %1$s', $ct->title); + printf( __('Theme %1$s'), $ct->title ); } else { - printf('Theme %1$s', $ct->title); + printf( __('Theme %1$s'), $ct->title ); } } echo '

      '; @@ -447,7 +448,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) { foreach ( $drafts as $draft ) { $url = get_edit_post_link( $draft->ID ); $title = _draft_or_post_title( $draft->ID ); - $item = "

      $title " . get_the_time( get_option( 'date_format' ), $draft ) . '

      '; + $item = "

      " . esc_html($title) . " " . get_the_time( get_option( 'date_format' ), $draft ) . '

      '; if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) ) $item .= '

      ' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '

      '; $list[] = $item; @@ -480,7 +481,7 @@ function wp_dashboard_recent_comments() { $comments = array(); $start = 0; - while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments ORDER BY comment_date_gmt DESC LIMIT $start, 50" ) ) { + while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) { foreach ( $possible as $comment ) { if ( count( $comments ) >= 5 ) @@ -509,6 +510,7 @@ function wp_dashboard_recent_comments() { @@ -527,24 +529,37 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $comment_post_link = "$comment_post_title"; $comment_link = '#'; - $delete_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); - $approve_url = esc_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); - $unapprove_url = esc_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); - $spam_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); - - $actions = array(); - $actions_string = ''; if ( current_user_can('edit_post', $comment->comment_post_ID) ) { + // preorder it: Approve | Reply | Edit | Spam | Trash + $actions = array( + 'approve' => '', 'unapprove' => '', + 'reply' => '', + 'edit' => '', + 'spam' => '', + 'trash' => '', 'delete' => '' + ); + + $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); + $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) ); + + $approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" ); + $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" ); + $spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); + $trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); + $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); + $actions['approve'] = "" . __( 'Approve' ) . ''; $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; $actions['edit'] = "". __('Edit') . ''; - //$actions['quickedit'] = '' . __('Quick Edit') . ''; $actions['reply'] = '' . __('Reply') . ''; $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; - $actions['delete'] = "" . __('Delete') . ''; + if ( !EMPTY_TRASH_DAYS ) + $actions['delete'] = "" . __('Delete Permanently') . ''; + else + $actions['trash'] = "" . _x('Trash', 'verb') . ''; - $actions = apply_filters( 'comment_row_actions', $actions, $comment ); + $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment ); $i = 0; foreach ( $actions as $action => $link ) { @@ -567,7 +582,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
      -

      ' . get_comment_author_link() . '', $comment_post_link." ".$comment_link, ' ' . __( '[Pending]' ) . '' ); ?>

      +

      ' . get_comment_author_link() . '', $comment_post_link.' '.$comment_link, ' ' . __( '[Pending]' ) . '' ); ?>

      -

      $type", $comment_post_link ); ?>

      +

      $type", $comment_post_link." ".$comment_link ); ?>

      - -
      get_item_quantity() ) { echo '

      ' . __('This dashboard widget queries Google Blog Search so that when another blog links to your site it will show up here. It has found no incoming links… yet. It’s okay — there is no rush.') . "

      \n"; + $rss->__destruct(); + unset($rss); return; } @@ -682,7 +691,8 @@ function wp_dashboard_incoming_links_output() { } echo "\n"; - + $rss->__destruct(); + unset($rss); } function wp_dashboard_incoming_links_control() { @@ -706,7 +716,7 @@ function wp_dashboard_primary_control() { */ function wp_dashboard_rss_output( $widget_id ) { $widgets = get_option( 'dashboard_widget_options' ); - echo "
      "; + echo '
      '; wp_widget_rss_output( $widgets[$widget_id] ); echo "
      "; } @@ -738,11 +748,15 @@ function wp_dashboard_secondary_output() { echo '

      '; } } elseif ( !$rss->get_item_quantity() ) { + $rss->__destruct(); + unset($rss); return false; } else { echo '
      '; wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] ); echo '
      '; + $rss->__destruct(); + unset($rss); } } @@ -825,6 +839,9 @@ function wp_dashboard_plugins_output() { echo "

      $label

      \n"; echo "
      $title
       (" . __( 'Install' ) . ")\n"; echo "

      $description

      \n"; + + $$feed->__destruct(); + unset($$feed); } } @@ -918,10 +935,13 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) { // title is optional. If black, fill it if possible if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { $rss = fetch_feed($widget_options[$widget_id]['url']); - if ( ! is_wp_error($rss) ) - $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); - else + if ( is_wp_error($rss) ) { $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed')); + } else { + $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); + $rss->__destruct(); + unset($rss); + } } update_option( 'dashboard_widget_options', $widget_options ); } diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 641e1738..921a2377 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -24,7 +24,7 @@ define('WXR_VERSION', '1.0'); * @param unknown_type $author */ function export_wp($author='') { -global $wpdb, $post_ids, $post; +global $wpdb, $post_ids, $post, $wp_taxonomies; do_action('export_wp'); @@ -46,6 +46,13 @@ $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_dat $categories = (array) get_categories('get=all'); $tags = (array) get_tags('get=all'); +$custom_taxonomies = $wp_taxonomies; +unset($custom_taxonomies['category']); +unset($custom_taxonomies['post_tag']); +unset($custom_taxonomies['link_category']); +$custom_taxonomies = array_keys($custom_taxonomies); +$terms = (array) get_terms($custom_taxonomies, 'get=all'); + /** * {@internal Missing Short Description}} * @@ -182,6 +189,34 @@ function wxr_tag_description($t) { echo '' . wxr_cdata($t->description) . ''; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $t Term Object + */ +function wxr_term_name($t) { + if ( empty($t->name) ) + return; + + echo '' . wxr_cdata($t->name) . ''; +} + +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $t Term Object + */ +function wxr_term_description($t) { + if ( empty($t->description) ) + return; + + echo '' . wxr_cdata($t->description) . ''; +} + /** * {@internal Missing Short Description}} * @@ -221,7 +256,7 @@ echo '\n"; - + @@ -255,6 +290,9 @@ echo '\n"; slug; ?> + + + taxonomy; ?>slug; ?>parent ? $custom_taxonomies[$t->parent]->name : ''; ?> \n"; // Don't export revisions. They bloat the export. if ( 'revision' == $post->post_type ) continue; - setup_postdata($post); ?> + setup_postdata($post); + + $is_sticky = 0; + if ( is_sticky( $post->ID ) ) + $is_sticky = 1; + +?> <?php echo apply_filters('the_title_rss', $post->post_title); ?> @@ -291,6 +335,7 @@ echo '\n"; menu_order; ?> post_type; ?> post_password; ?> + post_type == 'attachment') { ?> ID); ?> @@ -313,7 +358,7 @@ if ( $comments ) { foreach ( $comments as $c ) { ?> comment_ID; ?> comment_author); ?> comment_author_email; ?> -comment_author_url; ?> +comment_author_url ); ?> comment_author_IP; ?> comment_date; ?> comment_date_gmt; ?> diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 5cd7a454..4120532d 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -99,13 +99,14 @@ function get_real_file_to_edit( $file ) { } /** - * {@internal Missing Short Description}} + * Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep. + * The depth of the recursiveness can be controlled by the $levels param. * - * @since unknown + * @since 2.6.0 * - * @param string $folder Optional. Full path to folder - * @param int $levels Optional. Levels of folders to follow, Default: 100 (PHP Loop limit). - * @return bool|array + * @param string $folder Full path to folder + * @param int $levels (optional) Levels of folders to follow, Default: 100 (PHP Loop limit). + * @return bool|array False on failure, Else array of files */ function list_files( $folder = '', $levels = 100 ) { if( empty($folder) ) @@ -135,11 +136,14 @@ function list_files( $folder = '', $levels = 100 ) { } /** - * {@internal Missing Short Description}} + * Determines a writable directory for temporary files. + * Function's preference is to WP_CONTENT_DIR followed by the return value of sys_get_temp_dir(), before finally defaulting to /tmp/ * - * @since unknown + * In the event that this function does not find a writable location, It may be overridden by the WP_TEMP_DIR constant in your wp-config.php file. * - * @return unknown + * @since 2.5.0 + * + * @return string Writable temporary directory */ function get_temp_dir() { if ( defined('WP_TEMP_DIR') ) @@ -156,13 +160,17 @@ function get_temp_dir() { } /** - * {@internal Missing Short Description}} + * Returns a filename of a Temporary unique file. + * Please note that the calling function must unlink() this itself. * - * @since unknown + * The filename is based off the passed parameter or defaults to the current unix timestamp, + * while the directory can either be passed as well, or by leaving it blank, default to a writable temporary directory. * - * @param unknown_type $filename - * @param unknown_type $dir - * @return unknown + * @since 2.6.0 + * + * @param string $filename (optional) Filename to base the Unique file off + * @param string $dir (optional) Directory to store the file in + * @return string a writable filename */ function wp_tempnam($filename = '', $dir = ''){ if ( empty($dir) ) @@ -171,6 +179,7 @@ function wp_tempnam($filename = '', $dir = ''){ if ( empty($filename) ) $filename = time(); + $filename = preg_replace('|\..*$|', '.tmp', $filename); $filename = $dir . wp_unique_filename($dir, $filename); touch($filename); return $filename; @@ -186,8 +195,6 @@ function wp_tempnam($filename = '', $dir = ''){ * @return unknown */ function validate_file_to_edit( $file, $allowed_files = '' ) { - $file = stripslashes( $file ); - $code = validate_file( $file, $allowed_files ); if (!$code ) @@ -197,8 +204,8 @@ function validate_file_to_edit( $file, $allowed_files = '' ) { case 1 : wp_die( __('Sorry, can’t edit files with “..” in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.' )); - case 2 : - wp_die( __('Sorry, can’t call files with their real path.' )); + //case 2 : + // wp_die( __('Sorry, can’t call files with their real path.' )); case 3 : wp_die( __('Sorry, that file cannot be edited.' )); @@ -222,9 +229,15 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { } } + $file = apply_filters( 'wp_handle_upload_prefilter', $file ); + // You may define your own function and pass the name in $overrides['upload_error_handler'] $upload_error_handler = 'wp_handle_upload_error'; + // You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully. + if ( isset( $file['error'] ) && !ctype_digit( $file['error'] ) && $file['error'] ) + return $upload_error_handler( $file, $file['error'] ); + // You may define your own function and pass the name in $overrides['unique_filename_callback'] $unique_filename_callback = null; @@ -264,7 +277,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { // A non-empty file will pass this test. if ( $test_size && !($file['size'] > 0 ) ) - return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' )); + return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' )); // A properly uploaded file will pass this test. There should be no reason to override this one. if (! @ is_uploaded_file( $file['tmp_name'] ) ) @@ -424,10 +437,10 @@ function wp_handle_sideload( &$file, $overrides = false ) { } /** - * Downloads a url to a local file using the Snoopy HTTP Class. + * Downloads a url to a local temporary file using the WordPress HTTP Class. + * Please note, That the calling function must unlink() the file. * - * @since unknown - * @todo Transition over to using the new HTTP Request API (jacob). + * @since 2.5.0 * * @param string $url the URL of the file to download * @return mixed WP_Error on failure, string Filename on success. @@ -466,13 +479,17 @@ function download_url( $url ) { } /** - * {@internal Missing Short Description}} + * Unzip's a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction. + * Assumes that WP_Filesystem() has already been called and set up. * - * @since unknown + * Attempts to increase the PHP Memory limit to 256M before uncompressing, + * However, The most memory required shouldn't be much larger than the Archive itself. * - * @param unknown_type $file - * @param unknown_type $to - * @return unknown + * @since 2.5.0 + * + * @param string $file Full path and filename of zip archive + * @param string $to Full path on the filesystem to extract archive to + * @return mixed WP_Error on failure, True on success */ function unzip_file($file, $to) { global $wp_filesystem; @@ -480,7 +497,7 @@ function unzip_file($file, $to) { if ( ! $wp_filesystem || !is_object($wp_filesystem) ) return new WP_Error('fs_unavailable', __('Could not access filesystem.')); - // Unzip uses a lot of memory + // Unzip uses a lot of memory, but not this much hopefully @ini_set('memory_limit', '256M'); $fs =& $wp_filesystem; @@ -538,13 +555,14 @@ function unzip_file($file, $to) { } /** - * {@internal Missing Short Description}} + * Copies a directory from one location to another via the WordPress Filesystem Abstraction. + * Assumes that WP_Filesystem() has already been called and setup. * - * @since unknown + * @since 2.5.0 * - * @param unknown_type $from - * @param unknown_type $to - * @return unknown + * @param string $from source directory + * @param string $to destination directory + * @return mixed WP_Error on failure, True on success. */ function copy_dir($from, $to) { global $wp_filesystem; @@ -573,15 +591,20 @@ function copy_dir($from, $to) { return $result; } } + return true; } /** - * {@internal Missing Short Description}} + * Initialises and connects the WordPress Filesystem Abstraction classes. + * This function will include the chosen transport and attempt connecting. * - * @since unknown + * Plugins may add extra transports, And force WordPress to use them by returning the filename via the 'filesystem_method_file' filter. * - * @param unknown_type $args - * @return unknown + * @since 2.5.0 + * + * @param array $args (optional) Connection args, These are passed directly to the WP_Filesystem_*() classes. + * @param string $context (optional) Context for get_filesystem_method(), See function declaration for more information. + * @return boolean false on failure, true on success */ function WP_Filesystem( $args = false, $context = false ) { global $wp_filesystem; @@ -597,13 +620,19 @@ function WP_Filesystem( $args = false, $context = false ) { $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method); if( ! file_exists($abstraction_file) ) return; - + require_once($abstraction_file); } $method = "WP_Filesystem_$method"; $wp_filesystem = new $method($args); + //Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default. + if ( ! defined('FS_CONNECT_TIMEOUT') ) + define('FS_CONNECT_TIMEOUT', 30); + if ( ! defined('FS_TIMEOUT') ) + define('FS_TIMEOUT', 30); + if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ) return false; @@ -620,13 +649,20 @@ function WP_Filesystem( $args = false, $context = false ) { } /** - * {@internal Missing Short Description}} + * Determines which Filesystem Method to use. + * The priority of the Transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets (Via Sockets class, or fsoxkopen()) * - * @since unknown + * Note that the return value of this function can be overridden in 2 ways + * - By defining FS_METHOD in your wp-config.php file + * - By using the filesystem_method filter + * Valid values for these are: 'direct', 'ssh', 'ftpext' or 'ftpsockets' + * Plugins may also define a custom transport handler, See the WP_Filesystem function for more information. + * + * @since 2.5.0 * - * @param unknown_type $args + * @param array $args Connection details. * @param string $context Full path to the directory that is tested for being writable. - * @return unknown + * @return string The transport to use, see description for valid return values. */ function get_filesystem_method($args = array(), $context = false) { $method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets' @@ -635,13 +671,13 @@ function get_filesystem_method($args = array(), $context = false) { if ( !$context ) $context = WP_CONTENT_DIR; $context = trailingslashit($context); - $temp_file_name = $context . '.write-test-' . time(); + $temp_file_name = $context . 'temp-write-test-' . time(); $temp_handle = @fopen($temp_file_name, 'w'); if ( $temp_handle ) { - if ( getmyuid() == fileowner($temp_file_name) ) + if ( getmyuid() == @fileowner($temp_file_name) ) $method = 'direct'; @fclose($temp_handle); - unlink($temp_file_name); + @unlink($temp_file_name); } } @@ -652,14 +688,20 @@ function get_filesystem_method($args = array(), $context = false) { } /** - * {@internal Missing Short Description}} + * Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem. + * All chosen/entered details are saved, Excluding the Password. * - * @since unknown + * Hostnames may be in the form of hostname:portnumber (eg: wordpress.org:2467) to specify an alternate FTP/SSH port. * - * @param unknown_type $form_post - * @param unknown_type $type - * @param unknown_type $error - * @return unknown + * Plugins may override this form by returning true|false via the request_filesystem_credentials filter. + * + * @since 2.5.0 + * + * @param string $form_post the URL to post the form to + * @param string $type the chosen Filesystem method in use + * @param boolean $error if the current request has failed to connect + * @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method() + * @return boolean False on failure. True on success. */ function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false) { $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error, $context); @@ -675,28 +717,31 @@ function request_filesystem_credentials($form_post, $type = '', $error = false, $credentials = get_option('ftp_credentials', array( 'hostname' => '', 'username' => '')); // If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option) - $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']); - $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); - $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : ''); + $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? stripslashes($_POST['hostname']) : $credentials['hostname']); + $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? stripslashes($_POST['username']) : $credentials['username']); + $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? stripslashes($_POST['password']) : ''); // Check to see if we are setting the public/private keys for ssh - $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : ''); - $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : ''); + $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? stripslashes($_POST['public_key']) : ''); + $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? stripslashes($_POST['private_key']) : ''); //sanitize the hostname, Some people might pass in odd-data: $credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off - if ( strpos($credentials['hostname'], ':') ) + if ( strpos($credentials['hostname'], ':') ) { list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2); - else + if ( ! is_numeric($credentials['port']) ) + unset($credentials['port']); + } else { unset($credentials['port']); + } - if ( defined('FTP_SSH') || (defined('FS_METHOD') && 'ssh' == FS_METHOD) ) + if ( (defined('FTP_SSH') && FTP_SSH) || (defined('FS_METHOD') && 'ssh' == FS_METHOD) ) $credentials['connection_type'] = 'ssh'; - else if ( defined('FTP_SSL') && 'ftpext' == $type ) //Only the FTP Extension understands SSL + else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type ) //Only the FTP Extension understands SSL $credentials['connection_type'] = 'ftps'; else if ( !empty($_POST['connection_type']) ) - $credentials['connection_type'] = $_POST['connection_type']; + $credentials['connection_type'] = stripslashes($_POST['connection_type']); else if ( !isset($credentials['connection_type']) ) //All else fails (And its not defaulted to something else saved), Default to FTP $credentials['connection_type'] = 'ftp'; @@ -725,6 +770,17 @@ function request_filesystem_credentials($form_post, $type = '', $error = false, $error_string = $error->get_error_message(); echo '

      ' . $error_string . '

      '; } + + $types = array(); + if ( extension_loaded('ftp') || extension_loaded('sockets') || function_exists('fsockopen') ) + $types[ 'ftp' ] = __('FTP'); + if ( extension_loaded('ftp') ) //Only this supports FTPS + $types[ 'ftps' ] = __('FTPS (SSL)'); + if ( extension_loaded('ssh2') && function_exists('stream_get_contents') ) + $types[ 'ssh' ] = __('SSH2'); + + $types = apply_filters('fs_ftp_connection_types', $types, $credentials, $type, $error, $context); + ?> - false); - $file = wp_handle_sideload($file_array, $overrides); + $file = wp_handle_sideload($file_array, $overrides); if ( isset($file['error']) ) return new WP_Error( 'upload_error', $file['error'] ); @@ -279,7 +276,7 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = 'post_content' => $content, ), $post_data ); - // Save the data + // Save the attachment metadata $id = wp_insert_attachment($attachment, $file, $post_id); if ( !is_wp_error($id) ) { wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); @@ -316,13 +313,19 @@ wp_enqueue_style( 'ie' ); @@ -405,6 +408,15 @@ function media_upload_form_handler() { $post = apply_filters('attachment_fields_to_save', $post, $attachment); + if ( isset($attachment['image_alt']) && !empty($attachment['image_alt']) ) { + $image_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true); + if ( $image_alt != stripslashes($attachment['image_alt']) ) { + $image_alt = wp_strip_all_tags( stripslashes($attachment['image_alt']), true ); + // update_meta expects slashed + update_post_meta( $attachment_id, '_wp_attachment_image_alt', addslashes($image_alt) ); + } + } + if ( isset($post['errors']) ) { $errors[$attachment_id] = $post['errors']; unset($post['errors']); @@ -413,9 +425,10 @@ function media_upload_form_handler() { if ( $post != $_post ) wp_update_post($post); - foreach ( get_attachment_taxonomies($post) as $t ) + foreach ( get_attachment_taxonomies($post) as $t ) { if ( isset($attachment[$t]) ) wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false); + } } if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?> @@ -468,6 +481,8 @@ function media_upload_image() { } if ( !empty($_POST['insertonlybutton']) ) { + $alt = $align = ''; + $src = $_POST['insertonly']['src']; if ( !empty($src) && !strpos($src, '://') ) $src = "http://$src"; @@ -477,8 +492,9 @@ function media_upload_image() { $class = " class='align$align'"; } if ( !empty($src) ) - $html = "$alt"; - $html = apply_filters('image_send_to_editor_url', $html, $src, $alt, $align); + $html = "$alt"; + + $html = apply_filters('image_send_to_editor_url', $html, esc_url_raw($src), $alt, $align); return media_send_to_editor($html); } @@ -514,25 +530,33 @@ function media_upload_image() { */ function media_sideload_image($file, $post_id, $desc = null) { if (!empty($file) ) { - $file_array['name'] = basename($file); + // Download file to temp location $tmp = download_url($file); + + // Set variables for storage + // fix file filename for query strings + preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $file, $matches); + $file_array['name'] = basename($matches[0]); $file_array['tmp_name'] = $tmp; - $desc = @$desc; + // If error storing temporarily, unlink if ( is_wp_error($tmp) ) { @unlink($file_array['tmp_name']); $file_array['tmp_name'] = ''; } - $id = media_handle_sideload($file_array, $post_id, $desc); + // do the validation and storage stuff + $id = media_handle_sideload($file_array, $post_id, @$desc); $src = $id; + // If error storing permanently, unlink if ( is_wp_error($id) ) { @unlink($file_array['tmp_name']); return $id; } } + // Finally check to make sure the file has been saved, then return the html if ( !empty($src) ) { $alt = @$desc; $html = "$alt"; @@ -565,12 +589,16 @@ function media_upload_audio() { $href = $_POST['insertonly']['href']; if ( !empty($href) && !strpos($href, '://') ) $href = "http://$href"; + $title = esc_attr($_POST['insertonly']['title']); if ( empty($title) ) - $title = basename($href); + $title = esc_attr( basename($href) ); + if ( !empty($title) && !empty($href) ) - $html = "$title"; + $html = "$title"; + $html = apply_filters('audio_send_to_editor_url', $html, $href, $title); + return media_send_to_editor($html); } @@ -619,12 +647,16 @@ function media_upload_video() { $href = $_POST['insertonly']['href']; if ( !empty($href) && !strpos($href, '://') ) $href = "http://$href"; + $title = esc_attr($_POST['insertonly']['title']); - if ( empty($title) ) - $title = basename($href); + if ( empty($title) ) + $title = esc_attr( basename($href) ); + if ( !empty($title) && !empty($href) ) - $html = "$title"; + $html = "$title"; + $html = apply_filters('video_send_to_editor_url', $html, $href, $title); + return media_send_to_editor($html); } @@ -673,12 +705,13 @@ function media_upload_file() { $href = $_POST['insertonly']['href']; if ( !empty($href) && !strpos($href, '://') ) $href = "http://$href"; + $title = esc_attr($_POST['insertonly']['title']); if ( empty($title) ) $title = basename($href); if ( !empty($title) && !empty($href) ) - $html = "$title"; - $html = apply_filters('file_send_to_editor_url', $html, $href, $title); + $html = "$title"; + $html = apply_filters('file_send_to_editor_url', $html, esc_url_raw($href), $title); return media_send_to_editor($html); } @@ -757,16 +790,19 @@ function media_upload_library() { */ function image_align_input_fields( $post, $checked = '' ) { + if ( empty($checked) ) + $checked = get_user_setting('align', 'none'); + $alignments = array('none' => __('None'), 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right')); if ( !array_key_exists( (string) $checked, $alignments ) ) $checked = 'none'; $out = array(); - foreach ($alignments as $name => $label) { + foreach ( $alignments as $name => $label ) { $name = esc_attr($name); $out[] = ""; + " />"; } return join("\n", $out); } @@ -780,27 +816,36 @@ function image_align_input_fields( $post, $checked = '' ) { * @param unknown_type $checked * @return unknown */ -function image_size_input_fields( $post, $checked = '' ) { +function image_size_input_fields( $post, $check = '' ) { // get a list of the actual pixel dimensions of each possible intermediate version of this image $size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size')); - foreach ( $size_names as $size => $name ) { + if ( empty($check) ) + $check = get_user_setting('imgsize', 'medium'); + + foreach ( $size_names as $size => $label ) { $downsize = image_downsize($post->ID, $size); + $checked = ''; // is this size selectable? $enabled = ( $downsize[3] || 'full' == $size ); $css_id = "image-size-{$size}-{$post->ID}"; // if this size is the default but that's not available, don't select it - if ( $checked && !$enabled ) - $checked = ''; - // if $checked was not specified, default to the first available size that's bigger than a thumbnail - if ( !$checked && $enabled && 'thumbnail' != $size ) - $checked = $size; - - $html = "
      "; - - $html .= ""; + if ( $size == $check ) { + if ( $enabled ) + $checked = " checked='checked'"; + else + $check = ''; + } elseif ( !$check && $enabled && 'thumbnail' != $size ) { + // if $check is not enabled, default to the first available size that's bigger than a thumbnail + $check = $size; + $checked = " checked='checked'"; + } + + $html = "
      "; + + $html .= ""; // only show the dimensions if that choice is available if ( $enabled ) $html .= " "; @@ -826,21 +871,25 @@ function image_size_input_fields( $post, $checked = '' ) { * @param unknown_type $url_type * @return unknown */ -function image_link_input_fields($post, $url_type='') { +function image_link_input_fields($post, $url_type = '') { $file = wp_get_attachment_url($post->ID); $link = get_attachment_link($post->ID); + if ( empty($url_type) ) + $url_type = get_user_setting('urlbutton', 'post'); + $url = ''; if ( $url_type == 'file' ) $url = $file; elseif ( $url_type == 'post' ) $url = $link; - return "
      - - - + return " +
      + + + "; } @@ -855,15 +904,17 @@ function image_link_input_fields($post, $url_type='') { */ function image_attachment_fields_to_edit($form_fields, $post) { if ( substr($post->post_mime_type, 0, 5) == 'image' ) { - $form_fields['post_title']['required'] = true; - $file = wp_get_attachment_url($post->ID); - - $form_fields['image_url']['value'] = $file; + $alt = get_post_meta($post->ID, '_wp_attachment_image_alt', true); + if ( empty($alt) ) + $alt = ''; - $form_fields['post_excerpt']['label'] = __('Caption'); - $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); + $form_fields['post_title']['required'] = true; - $form_fields['post_content']['label'] = __('Description'); + $form_fields['image_alt'] = array( + 'value' => $alt, + 'label' => __('Alternate text'), + 'helps' => __('Alt text for the image, e.g. “The Mona Lisa”') + ); $form_fields['align'] = array( 'label' => __('Alignment'), @@ -871,7 +922,10 @@ function image_attachment_fields_to_edit($form_fields, $post) { 'html' => image_align_input_fields($post, get_option('image_default_align')), ); - $form_fields['image-size'] = image_size_input_fields($post, get_option('image_default_size')); + $form_fields['image-size'] = image_size_input_fields( $post, get_option('image_default_size', 'medium') ); + + } else { + unset( $form_fields['image_alt'] ); } return $form_fields; } @@ -933,20 +987,12 @@ function image_media_send_to_editor($html, $attachment_id, $attachment) { $post =& get_post($attachment_id); if ( substr($post->post_mime_type, 0, 5) == 'image' ) { $url = $attachment['url']; - - if ( isset($attachment['align']) ) - $align = $attachment['align']; - else - $align = 'none'; - - if ( !empty($attachment['image-size']) ) - $size = $attachment['image-size']; - else - $size = 'medium'; - + $align = !empty($attachment['align']) ? $attachment['align'] : 'none'; + $size = !empty($attachment['image-size']) ? $attachment['image-size'] : 'medium'; + $alt = !empty($attachment['image_alt']) ? $attachment['image_alt'] : ''; $rel = ( $url == get_attachment_link($attachment_id) ); - return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size); + return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt); } return $html; @@ -976,22 +1022,23 @@ function get_attachment_fields_to_edit($post, $errors = null) { $form_fields = array( 'post_title' => array( 'label' => __('Title'), - 'value' => $edit_post->post_title, + 'value' => $edit_post->post_title ), + 'image_alt' => array(), 'post_excerpt' => array( 'label' => __('Caption'), - 'value' => $edit_post->post_excerpt, + 'value' => $edit_post->post_excerpt ), 'post_content' => array( 'label' => __('Description'), 'value' => $edit_post->post_content, - 'input' => 'textarea', + 'input' => 'textarea' ), 'url' => array( 'label' => __('Link URL'), 'input' => 'html', 'html' => image_link_input_fields($post, get_option('image_default_link_type')), - 'helps' => __('Enter a link URL or click above for presets.'), + 'helps' => __('Enter a link URL or click above for presets.') ), 'menu_order' => array( 'label' => __('Order'), @@ -1000,9 +1047,9 @@ function get_attachment_fields_to_edit($post, $errors = null) { 'image_url' => array( 'label' => __('File URL'), 'input' => 'html', - 'html' => "
      ", - 'value' => isset($edit_post->post_url) ? $edit_post->post_url : '', - 'helps' => __('Location of the uploaded file.'), + 'html' => "
      ", + 'value' => wp_get_attachment_url($post->ID), + 'helps' => __('Location of the uploaded file.') ) ); @@ -1062,9 +1109,12 @@ function get_media_items( $post_id, $errors ) { } $output = ''; - foreach ( (array) $attachments as $id => $attachment ) + foreach ( (array) $attachments as $id => $attachment ) { + if ( $attachment->post_status == 'trash' ) + continue; if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) ) $output .= "\n
      $item\n
      "; + } return $output; } @@ -1081,16 +1131,15 @@ function get_media_items( $post_id, $errors ) { function get_media_item( $attachment_id, $args = null ) { global $redir_tab; - $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true ); - $args = wp_parse_args( $args, $default_args ); - extract( $args, EXTR_SKIP ); - - global $post_mime_types; if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) ) $thumb_url = $thumb_url[0]; else return false; + $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true ); + $args = wp_parse_args( $args, $default_args ); + extract( $args, EXTR_SKIP ); + $toggle_on = __('Show'); $toggle_off = __('Hide'); @@ -1105,12 +1154,10 @@ function get_media_item( $attachment_id, $args = null ) { $tags = esc_attr(join(', ', $tags)); } - $type = ''; - if ( isset($post_mime_types) ) { - $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); - $type = array_shift($keys); - $type = ""; - } + $post_mime_types = get_post_mime_types(); + $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); + $type = array_shift($keys); + $type_html = ""; $form_fields = get_attachment_fields_to_edit($post, $errors); @@ -1125,7 +1172,7 @@ function get_media_item( $attachment_id, $args = null ) { } $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case - $display_title = $show_title ? "
      " . wp_html_excerpt($display_title, 60) . "
      " : ''; + $display_title = $show_title ? "
      " . wp_html_excerpt($display_title, 60) . "
      " : ''; $gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false; $order = ''; @@ -1142,22 +1189,41 @@ function get_media_item( $attachment_id, $args = null ) { } } + $media_dims = ''; + $meta = wp_get_attachment_metadata($post->ID); + if ( is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta) ) + $media_dims .= "{$meta['width']} × {$meta['height']} "; + $media_dims = apply_filters('media_meta', $media_dims, $post); + + $image_edit_button = ''; + if ( gd_edit_image_support($post->post_mime_type) ) { + $nonce = wp_create_nonce("image_editor-$post->ID"); + $image_edit_button = " "; + } + $item = " - $type + $type_html $toggle_links $order $display_title - + - - + + - - - + + \n"; + + if ( !empty($media_dims) ) + $item .= "\n"; + + $item .= " + - \n"; + + + \n"; $defaults = array( 'input' => 'text', @@ -1166,15 +1232,31 @@ function get_media_item( $attachment_id, $args = null ) { 'extra_rows' => array(), ); - $delete_href = wp_nonce_url("post.php?action=delete-post&post=$attachment_id", 'delete-post_' . $attachment_id); if ( $send ) $send = ""; - if ( $delete ) - $delete = "" . __('Delete') . ""; - if ( ( $send || $delete ) && !isset($form_fields['buttons']) ) - $form_fields['buttons'] = array('tr' => "\t\t\n"); + if ( $delete && current_user_can('delete_post', $attachment_id) ) { + if ( !EMPTY_TRASH_DAYS ) { + $delete = "" . __('Delete Permanently') . ""; + } elseif ( !MEDIA_TRASH ) { + $delete = "" . __('Delete') . "
      " . sprintf(__("You are about to delete %s."), $filename) . " " . __('Continue') . " " . __('Cancel') . "
      "; + } else { + $delete = "" . __('Move to Trash') . "" . __('Undo') . ""; + } + } else { + $delete = ''; + } + + $thumbnail = ''; + $calling_post_id = 0; + if ( isset( $_GET['post_id'] ) ) + $calling_post_id = $_GET['post_id']; + elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set + $calling_post_id = $post->post_parent; + if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) + $thumbnail = "" . esc_html__( "Use as thumbnail" ) . ""; + + if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) ) + $form_fields['buttons'] = array('tr' => "\t\t\n"); $hidden_fields = array(); @@ -1206,7 +1288,7 @@ function get_media_item( $attachment_id, $args = null ) { elseif ( $field['input'] == 'textarea' ) { $item .= ""; } else { - $item .= ""; + $item .= ""; } if ( !empty($field['helps']) ) $item .= "

      " . join( "

      \n

      ", array_unique((array) $field['helps']) ) . '

      '; @@ -1324,6 +1406,7 @@ SWFUpload.onload = function() { post_params : { "post_id" : "", "auth_cookie" : "", + "logged_in_cookie": "", "_wpnonce" : "", "type" : "", "tab" : "", @@ -1369,7 +1452,7 @@ SWFUpload.onload = function() {

      - +

      @@ -1400,6 +1483,7 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) { ?> + @@ -1474,21 +1558,23 @@ var addExtImage = { align : 'alignnone', insert : function() { - var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = null; + var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = ''; - if ( '' == f.src.value || '' == t.width ) return false; + if ( '' == f.src.value || '' == t.width ) + return false; if ( f.title.value ) { - title = f.title.value.replace(/['"<>]+/g, ''); + title = f.title.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); title = ' title="'+title+'"'; } - if ( f.alt.value ) { - alt = f.alt.value.replace(/['"<>]+/g, ''); + if ( f.alt.value ) + alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); + - caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); + if ( f.caption.value ) + caption = f.caption.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); - } cls = caption ? '' : ' class="'+t.align+'"'; @@ -1502,6 +1588,7 @@ var addExtImage = { var win = window.dialogArguments || opener || parent || top; win.send_to_editor(html); + return false; }, resetImageData : function() { @@ -1510,8 +1597,8 @@ var addExtImage = { t.width = t.height = ''; document.getElementById('go_button').style.color = '#bbb'; if ( ! document.forms[0].src.value ) - document.getElementById('status_img').src = 'images/required.gif'; - else document.getElementById('status_img').src = 'images/no.png'; + document.getElementById('status_img').innerHTML = '*'; + else document.getElementById('status_img').innerHTML = ''; }, updateImageData : function() { @@ -1520,7 +1607,7 @@ var addExtImage = { t.width = t.preloadImg.width; t.height = t.preloadImg.height; document.getElementById('go_button').style.color = '#333'; - document.getElementById('status_img').src = 'images/yes.png'; + document.getElementById('status_img').innerHTML = ''; }, getImageData : function() { @@ -1530,7 +1617,7 @@ var addExtImage = { t.resetImageData(); return false; } - document.getElementById('status_img').src = 'images/wpspin_light.gif'; + document.getElementById('status_img').innerHTML = ''; t.preloadImg = new Image(); t.preloadImg.onload = t.updateImageData; t.preloadImg.onerror = t.resetImageData; @@ -1560,13 +1647,14 @@ var addExtImage = { * @param unknown_type $errors */ function media_upload_gallery_form($errors) { - global $redir_tab; + global $redir_tab, $type; $redir_tab = 'gallery'; media_upload_header(); $post_id = intval($_REQUEST['post_id']); - $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id"); + $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id"); + $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); ?> + + +id, true, $post->post_type ); // TODO: ROLE SYSTEM + if ( $post->post_author && !in_array($post->post_author, $authors) ) + $authors[] = $post->post_author; +?> + $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> + +
      + + $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?> +

      + +
      + +

      + +
      +

      +

      + + + +
        +
      • +
      • +
      + +
      +
        + link_id) ) + wp_link_category_checklist($link->link_id); + else + wp_link_category_checklist(); + ?> +
      +
      + + + +
      +

      + +
      + +
      +

      +

      +

      +
      +

      +link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; + $rels = preg_split('/\s+/', $link_rel); + + if ('' != $value && in_array($value, $rels) ) { + 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"'; + } +} + + +/** + * Display xfn form fields. + * + * @since 2.6.0 + * + * @param object $link + */ +function link_xfn_meta_box($link) { +?> +
      $filename" . __('File name:') . " $filename
      $post->post_mime_type
      " . mysql2date($post->post_date, get_option('time_format')) . "
      " . apply_filters('media_meta', '', $post) . "
      " . __('File type:') . " $post->post_mime_type
      " . __('Upload date:') . " " . mysql2date( get_option('date_format'), $post->post_date ) . "
      " . __('Dimensions:') . " $media_dims
      $image_edit_button
      $send $delete -
      " . sprintf(__("You are about to delete %s."), $filename) . " " . __('Continue') . " - " . __('Cancel') . "
      $send $thumbnail $delete
      + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + +
      + +
      + + +
      + + + +
      + + + + + + +
      + + + + +
      +
      +

      XFN.'); ?>

      + + + + + + + + + + + + + + + + + + +
        +
      +ID, '_thumbnail_id', true ); + echo _wp_post_thumbnail_html( $thumbnail_id ); +} diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 356c6b00..96bcab3e 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -154,7 +154,7 @@ function iis7_save_url_rewrite_rules(){ // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) { if ( iis7_supports_permalinks() ) { - $rule = $wp_rewrite->iis7_url_rewrite_rules(); + $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', ''); if ( ! empty($rule) ) { return iis7_add_rewrite_rule($web_config_file, $rule); } else { @@ -587,6 +587,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) { $rule_fragment->appendXML($rewrite_rule); $rules_node->appendChild($rule_fragment); + $doc->encoding = "UTF-8"; $doc->formatOutput = true; saveDomDocument($doc, $filename); diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 88a95dda..da1e076a 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -66,38 +66,25 @@ * @return array See above for description. */ function get_plugin_data( $plugin_file, $markup = true, $translate = true ) { - // We don't need to write to the file, so just open for reading. - $fp = fopen($plugin_file, 'r'); - - // Pull only the first 8kiB of the file in. - $plugin_data = fread( $fp, 8192 ); - - // PHP will close file handle, but we are good citizens. - fclose($fp); - - preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name ); - preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri ); - preg_match( '|Version:(.*)|i', $plugin_data, $version ); - preg_match( '|Description:(.*)$|mi', $plugin_data, $description ); - preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name ); - preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri ); - preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain ); - preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path ); - - foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) { - if ( !empty( ${$field} ) ) - ${$field} = _cleanup_header_comment(${$field}[1]); - else - ${$field} = ''; - } - $plugin_data = array( - 'Name' => $name, 'Title' => $name, 'PluginURI' => $uri, 'Description' => $description, - 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, - 'TextDomain' => $text_domain, 'DomainPath' => $domain_path - ); + $default_headers = array( + 'Name' => 'Plugin Name', + 'PluginURI' => 'Plugin URI', + 'Version' => 'Version', + 'Description' => 'Description', + 'Author' => 'Author', + 'AuthorURI' => 'Author URI', + 'TextDomain' => 'Text Domain', + 'DomainPath' => 'Domain Path' + ); + + $plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' ); + + //For backward compatibility by default Title is the same as Name. + $plugin_data['Title'] = $plugin_data['Name']; + if ( $markup || $translate ) - $plugin_data = _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup, $translate); + $plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate ); return $plugin_data; } @@ -107,9 +94,9 @@ function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup = //Translate fields if( $translate && ! empty($plugin_data['TextDomain']) ) { if( ! empty( $plugin_data['DomainPath'] ) ) - load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file). $plugin_data['DomainPath']); + load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']); else - load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file)); + load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file)); foreach ( array('Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version') as $field ) $plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']); @@ -272,7 +259,7 @@ function get_plugins($plugin_folder = '') { * @return bool True, if in the active plugins list. False, not in the list. */ function is_plugin_active($plugin) { - return in_array($plugin, get_option('active_plugins')); + return in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ); } /** @@ -314,8 +301,10 @@ function activate_plugin($plugin, $redirect = '') { @include(WP_PLUGIN_DIR . '/' . $plugin); $current[] = $plugin; sort($current); + do_action( 'activate_plugin', trim( $plugin) ); update_option('active_plugins', $current); - do_action('activate_' . $plugin); + do_action( 'activate_' . trim( $plugin ) ); + do_action( 'activated_plugin', trim( $plugin) ); ob_end_clean(); } @@ -343,9 +332,19 @@ function deactivate_plugins($plugins, $silent= false) { $plugin = plugin_basename($plugin); if( ! is_plugin_active($plugin) ) continue; - array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu! - if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. - do_action('deactivate_' . trim( $plugin )); + if ( ! $silent ) + do_action( 'deactivate_plugin', trim( $plugin ) ); + + $key = array_search( $plugin, (array) $current ); + + if ( false !== $key ) + array_splice( $current, $key, 1 ); + + //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. + if ( ! $silent ) { + do_action( 'deactivate_' . trim( $plugin ) ); + do_action( 'deactivated_plugin', trim( $plugin ) ); + } } update_option('active_plugins', $current); @@ -477,7 +476,7 @@ function delete_plugins($plugins, $redirect = '' ) { } function validate_active_plugins() { - $check_plugins = get_option('active_plugins'); + $check_plugins = apply_filters( 'active_plugins', get_option('active_plugins') ); // Sanity check. If the active plugin list is not an array, make it an // empty array. @@ -584,7 +583,7 @@ function uninstall_plugin($plugin) { // Menu // -function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) { +function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '', $position = NULL ) { global $menu, $admin_page_hooks, $_registered_pages; $file = plugin_basename( $file ); @@ -595,12 +594,19 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio if (!empty ( $function ) && !empty ( $hookname )) add_action( $hookname, $function ); - if ( empty($icon_url) ) + if ( empty($icon_url) ) { $icon_url = 'images/generic.png'; - elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) + } elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) { $icon_url = 'https://' . substr($icon_url, 7); + } - $menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); + $new_menu = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); + + if ( NULL === $position ) { + $menu[] = $new_menu; + } else { + $menu[$position] = $new_menu; + } $_registered_pages[$hookname] = true; @@ -608,51 +614,19 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio } function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { - global $menu, $admin_page_hooks, $_wp_last_object_menu, $_registered_pages; - - $file = plugin_basename( $file ); - - $admin_page_hooks[$file] = sanitize_title( $menu_title ); - - $hookname = get_plugin_page_hookname( $file, '' ); - if (!empty ( $function ) && !empty ( $hookname )) - add_action( $hookname, $function ); - - if ( empty($icon_url) ) - $icon_url = 'images/generic.png'; + global $_wp_last_object_menu; $_wp_last_object_menu++; - $menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); - - $_registered_pages[$hookname] = true; - - return $hookname; + return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_object_menu); } function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { - global $menu, $admin_page_hooks, $_wp_last_utility_menu, $_registered_pages; - - $file = plugin_basename( $file ); - - $admin_page_hooks[$file] = sanitize_title( $menu_title ); - - $hookname = get_plugin_page_hookname( $file, '' ); - if (!empty ( $function ) && !empty ( $hookname )) - add_action( $hookname, $function ); - - if ( empty($icon_url) ) - $icon_url = 'images/generic.png'; - elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) - $icon_url = 'https://' . substr($icon_url, 7); + global $_wp_last_utility_menu; $_wp_last_utility_menu++; - $menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); - - $_registered_pages[$hookname] = true; - - return $hookname; + return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_utility_menu); } function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) { @@ -692,7 +666,7 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi $_registered_pages[$hookname] = true; // backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php - if ( 'tools.php' == $parent ) + if ( 'tools.php' == $parent ) $_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true; return $hookname; @@ -1003,7 +977,8 @@ function user_can_access_admin_page() { * * @since 2.7.0 * - * @param string $option_group A settings group name. Can be anything. + * @param string $option_group A settings group name. Should correspond to a whitelisted option key name. + * Default whitelisted option key names include "general," "discussion," and "reading," among others. * @param string $option_name The name of an option to sanitize and save. * @param unknown_type $sanitize_callback A callback function that sanitizes the option's value. * @return unknown diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 51bb136c..e5924f1d 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -236,6 +236,14 @@ function bulk_edit_posts( $post_data = null ) { wp_die( __('You are not allowed to edit posts.') ); } + if ( -1 == $post_data['_status'] ) { + $post_data['post_status'] = null; + unset($post_data['post_status']); + } else { + $post_data['post_status'] = $post_data['_status']; + } + unset($post_data['_status']); + $post_IDs = array_map( 'intval', (array) $post_data['post'] ); $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' ); @@ -298,7 +306,7 @@ function bulk_edit_posts( $post_data = null ) { $post_data['ID'] = $post_ID; $updated[] = wp_update_post( $post_data ); - if ( current_user_can( 'edit_others_posts' ) && isset( $post_data['sticky'] ) ) { + if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) { if ( 'sticky' == $post_data['sticky'] ) stick_post( $post_ID ); else @@ -318,29 +326,18 @@ function bulk_edit_posts( $post_data = null ) { * @return unknown */ function get_default_post_to_edit() { + + $post_title = ''; if ( !empty( $_REQUEST['post_title'] ) ) $post_title = esc_html( stripslashes( $_REQUEST['post_title'] )); - else if ( !empty( $_REQUEST['popuptitle'] ) ) { - $post_title = esc_html( stripslashes( $_REQUEST['popuptitle'] )); - $post_title = funky_javascript_fix( $post_title ); - } else { - $post_title = ''; - } $post_content = ''; if ( !empty( $_REQUEST['content'] ) ) $post_content = esc_html( stripslashes( $_REQUEST['content'] )); - else if ( !empty( $post_title ) ) { - $text = esc_html( stripslashes( urldecode( $_REQUEST['text'] ) ) ); - $text = funky_javascript_fix( $text); - $popupurl = esc_url($_REQUEST['popupurl']); - $post_content = ''.$post_title.''."\n$text"; - } + $post_excerpt = ''; if ( !empty( $_REQUEST['excerpt'] ) ) $post_excerpt = esc_html( stripslashes( $_REQUEST['excerpt'] )); - else - $post_excerpt = ''; $post->ID = 0; $post->post_name = ''; @@ -562,7 +559,9 @@ function add_meta( $post_ID ) { $metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : ''; $metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( trim( $_POST['metakeyinput'] ) ) : ''; - $metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes( trim( $_POST['metavalue'] ) ) ) : ''; + $metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes_deep( $_POST['metavalue'] ) ) : ''; + if ( is_string($metavalue) ) + $metavalue = trim( $metavalue ); if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) { // We have a key/value pair. If both the select and the @@ -580,6 +579,8 @@ function add_meta( $post_ID ) { wp_cache_delete($post_ID, 'post_meta'); $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)", $post_ID, $metakey, $metavalue) ); + do_action( 'added_postmeta', $wpdb->insert_id, $post_ID, $metakey, $metavalue ); + return $wpdb->insert_id; } return false; @@ -598,9 +599,13 @@ function delete_meta( $mid ) { $mid = (int) $mid; $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) ); + + do_action( 'delete_postmeta', $mid ); wp_cache_delete($post_id, 'post_meta'); + $rval = $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) ); + do_action( 'deleted_postmeta', $mid ); - return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) ); + return $rval; } /** @@ -681,15 +686,19 @@ function update_meta( $meta_id, $meta_key, $meta_value ) { return false; $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) ); - wp_cache_delete($post_id, 'post_meta'); - $meta_value = maybe_serialize( stripslashes( $meta_value ) ); + $meta_value = maybe_serialize( stripslashes_deep( $meta_value ) ); $meta_id = (int) $meta_id; $data = compact( 'meta_key', 'meta_value' ); $where = compact( 'meta_id' ); - return $wpdb->update( $wpdb->postmeta, $data, $where ); + do_action( 'update_postmeta', $meta_id, $post_id, $meta_key, $meta_value ); + $rval = $wpdb->update( $wpdb->postmeta, $data, $where ); + wp_cache_delete($post_id, 'post_meta'); + do_action( 'updated_postmeta', $meta_id, $post_id, $meta_key, $meta_value ); + + return $rval; } // @@ -706,6 +715,7 @@ function update_meta( $meta_id, $meta_key, $meta_value ) { * @return unknown */ function _fix_attachment_links( $post_ID ) { + global $_fix_attachment_link_id; $post = & get_post( $post_ID, ARRAY_A ); @@ -733,7 +743,8 @@ function _fix_attachment_links( $post_ID ) { } $post_search[$i] = $anchor; - $post_replace[$i] = preg_replace( "#href=(\"|')[^'\"]*\\1#e", "stripslashes( 'href=\\1' ).get_attachment_link( $id ).stripslashes( '\\1' )", $anchor ); + $_fix_attachment_link_id = $id; + $post_replace[$i] = preg_replace_callback( "#href=(\"|')[^'\"]*\\1#", '_fix_attachment_links_replace_cb', $anchor ); ++$i; } @@ -745,6 +756,11 @@ function _fix_attachment_links( $post_ID ) { return wp_update_post( $post); } +function _fix_attachment_links_replace_cb($match) { + global $_fix_attachment_link_id; + return stripslashes( 'href='.$match[1] ).get_attachment_link( $_fix_attachment_link_id ).stripslashes( $match[1] ); +} + /** * Move child posts to a new parent. * @@ -759,7 +775,17 @@ function _relocate_children( $old_ID, $new_ID ) { global $wpdb; $old_ID = (int) $old_ID; $new_ID = (int) $new_ID; - return $wpdb->update($wpdb->posts, array('post_parent' => $new_ID), array('post_parent' => $old_ID) ); + + $children = $wpdb->get_col( $wpdb->prepare(" + SELECT post_id + FROM $wpdb->postmeta + WHERE meta_key = '_wp_attachment_temp_parent' + AND meta_value = %d", $old_ID) ); + + foreach ( $children as $child_id ) { + $wpdb->update($wpdb->posts, array('post_parent' => $new_ID), array('ID' => $child_id) ); + delete_post_meta($child_id, '_wp_attachment_temp_parent'); + } } /** @@ -795,6 +821,7 @@ function wp_edit_posts_query( $q = false ) { 'pending' => array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review (%s)', 'Pending Review (%s)')), 'draft' => array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft (%s)', 'Drafts (%s)')), 'private' => array(_x('Private', 'post'), __('Private posts'), _n_noop('Private (%s)', 'Private (%s)')), + 'trash' => array(_x('Trash', 'post'), __('Trash posts'), _n_noop('Trash (%s)', 'Trash (%s)')), ); $post_stati = apply_filters('post_stati', $post_stati); @@ -818,16 +845,33 @@ function wp_edit_posts_query( $q = false ) { $orderby = 'date'; } - $posts_per_page = get_user_option('edit_per_page'); - if ( empty($posts_per_page) ) + $posts_per_page = (int) get_user_option( 'edit_per_page', 0, false ); + if ( empty( $posts_per_page ) || $posts_per_page < 1 ) $posts_per_page = 15; - $posts_per_page = apply_filters('edit_posts_per_page', $posts_per_page); + $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page ); wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby"); return array($post_stati, $avail_post_stati); } +/** + * Get default post mime types + * + * @since 2.9.0 + * + * @return array + */ +function get_post_mime_types() { + $post_mime_types = array( // array( adj, noun ) + 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')), + 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')), + 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')), + ); + + return apply_filters('post_mime_types', $post_mime_types); +} + /** * {@internal Missing Short Description}} * @@ -858,18 +902,13 @@ function wp_edit_attachments_query( $q = false ) { $q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0; $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0; $q['post_type'] = 'attachment'; - $q['post_status'] = 'any'; - $media_per_page = get_user_option('upload_per_page'); - if ( empty($media_per_page) ) + $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'inherit'; + $media_per_page = (int) get_user_option( 'upload_per_page', 0, false ); + if ( empty( $media_per_page ) || $media_per_page < 1 ) $media_per_page = 20; - $q['posts_per_page'] = $media_per_page; - $post_mime_types = array( // array( adj, noun ) - 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')), - 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')), - 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')), - ); - $post_mime_types = apply_filters('post_mime_types', $post_mime_types); + $q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page ); + $post_mime_types = get_post_mime_types(); $avail_post_mime_types = get_available_post_mime_types('attachment'); if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) ) @@ -906,12 +945,12 @@ function postbox_classes( $id, $page ) { * * @since unknown * - * @param unknown_type $id - * @param unknown_type $title - * @param unknown_type $name - * @return unknown + * @param int|object $id Post ID or post object. + * @param string $title (optional) Title + * @param string $name (optional) Name + * @return array With two entries of type string */ -function get_sample_permalink($id, $title=null, $name = null) { +function get_sample_permalink($id, $title = null, $name = null) { $post = &get_post($id); if (!$post->ID) { return array('', ''); @@ -924,7 +963,7 @@ function get_sample_permalink($id, $title=null, $name = null) { // drafts, so we will fake, that our post is published if (in_array($post->post_status, array('draft', 'pending'))) { $post->post_status = 'publish'; - $post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID); + $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID); } $post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent); @@ -932,7 +971,7 @@ function get_sample_permalink($id, $title=null, $name = null) { // If the user wants to set a new name -- override the current one // Note: if empty name is supplied -- use the title instead, see #6072 if (!is_null($name)) { - $post->post_name = sanitize_title($name? $name : $title, $post->ID); + $post->post_name = sanitize_title($name ? $name : $title, $post->ID); } $post->filter = 'sample'; @@ -960,40 +999,48 @@ function get_sample_permalink($id, $title=null, $name = null) { } /** - * {@internal Missing Short Description}} + * sample permalink html * + * intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. + * * @since unknown * - * @param unknown_type $id - * @param unknown_type $new_title - * @param unknown_type $new_slug - * @return unknown + * @param int|object $id Post ID or post object. + * @param string $new_title (optional) New title + * @param string $new_slug (optional) New slug + * @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. */ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { $post = &get_post($id); list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); - if ( 'publish' == $post->post_status ) + + if ( 'publish' == $post->post_status ) { $view_post = 'post' == $post->post_type ? __('View Post') : __('View Page'); + $title = __('Click to edit this part of the permalink'); + } else { + $title = __('Temporary permalink. Click to edit this part.'); + } if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { $return = '' . __('Permalink:') . "\n" . '' . $permalink . "\n"; - if ( current_user_can( 'manage_options' ) ) + if ( current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) $return .= '' . __('Change Permalinks') . "\n"; if ( isset($view_post) ) $return .= "$view_post\n"; + $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); + return $return; } - $title = __('Click to edit this part of the permalink'); - if (function_exists('mb_strlen')) { - if (mb_strlen($post_name) > 30) { + if ( function_exists('mb_strlen') ) { + if ( mb_strlen($post_name) > 30 ) { $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14); } else { $post_name_abridged = $post_name; } } else { - if (strlen($post_name) > 30) { + if ( strlen($post_name) > 30 ) { $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); } else { $post_name_abridged = $post_name; @@ -1004,20 +1051,51 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink); $return = '' . __('Permalink:') . "\n" . '' . $display_link . "\n"; - $return .= '' . __('Edit') . "\n"; + $return .= '' . __('Edit') . "\n"; $return .= '' . $post_name . "\n"; if ( isset($view_post) ) $return .= "$view_post\n"; + $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); + return $return; } /** - * {@internal Missing Short Description}} + * Output HTML for the post thumbnail meta-box. * - * @since unknown + * @since 2.9.0 + * + * @param int $thumbnail_id ID of the attachment used for thumbnail + * @return string html + */ +function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { + global $content_width, $_wp_additional_image_sizes; + $content = '

      ' . esc_html__( 'Set thumbnail' ) . '

      '; + + if ( $thumbnail_id && get_post( $thumbnail_id ) ) { + $old_content_width = $content_width; + $content_width = 266; + if ( !isset( $_wp_additional_image_sizes['post-thumbnail'] ) ) + $thumbnail_html = wp_get_attachment_image( $thumbnail_id, array( $content_width, $content_width ) ); + else + $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' ); + if ( !empty( $thumbnail_html ) ) { + $content = '' . $thumbnail_html . ''; + $content .= '

      ' . esc_html__( 'Remove thumbnail' ) . '

      '; + } + $content_width = $old_content_width; + } + + return apply_filters( 'admin_post_thumbnail_html', $content ); +} + +/** + * Check to see if the post is currently being edited by another user. * - * @param unknown_type $post_id + * @since 2.5.0 + * + * @param int $post_id ID of the post to check for editing * @return bool|int False: not locked or locked by current user. Int: user ID of user with lock. */ function wp_check_post_lock( $post_id ) { @@ -1037,12 +1115,12 @@ function wp_check_post_lock( $post_id ) { } /** - * {@internal Missing Short Description}} + * Mark the post as currently being edited by the current user * - * @since unknown + * @since 2.5.0 * - * @param unknown_type $post_id - * @return unknown + * @param int $post_id ID of the post to being edited + * @return bool Returns false if the post doesn't exist of there is no current user */ function wp_set_post_lock( $post_id ) { global $current_user; @@ -1061,7 +1139,7 @@ function wp_set_post_lock( $post_id ) { /** * Outputs the notice message to say that someone else is editing this post at the moment. - * + * * @since 2.8.5 * @return none */ @@ -1069,7 +1147,7 @@ function _admin_notice_post_locked() { global $post; $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ); $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); - + switch ($post->post_type) { case 'post': $message = __( 'Warning: %s is currently editing this post' ); @@ -1080,9 +1158,9 @@ function _admin_notice_post_locked() { default: $message = __( 'Warning: %s is currently editing this.' ); } - + $message = sprintf( $message, esc_html( $last_user_name ) ); - echo "

      $message

      "; + echo "

      $message

      "; } /** @@ -1104,6 +1182,8 @@ function wp_create_post_autosave( $post_id ) { if ( $old_autosave = wp_get_post_autosave( $post_id ) ) { $new_autosave = _wp_post_revision_fields( $_POST, true ); $new_autosave['ID'] = $old_autosave->ID; + $current_user = wp_get_current_user(); + $new_autosave['post_author'] = $current_user->ID; return wp_update_post( $new_autosave ); } @@ -1187,8 +1267,9 @@ function post_preview() { * to the URL when queueing them with the mce_external_plugins filter. * * @param bool $teeny optional Output a trimmed down version used in Press This. + * @param mixed $settings optional An array that can add to or overwrite the default TinyMCE settings. */ -function wp_tiny_mce( $teeny = false ) { +function wp_tiny_mce( $teeny = false, $settings = false ) { global $concatenate_scripts, $compress_scripts, $tinymce_version; if ( ! user_can_richedit() ) @@ -1207,7 +1288,7 @@ function wp_tiny_mce( $teeny = false ) { $mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv'); if ( $teeny ) { - $plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'autosave', 'fullscreen') ); + $plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'fullscreen', 'wordpress') ); $ext_plugins = ''; } else { $plugins = array( 'safari', 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus' ); @@ -1341,7 +1422,9 @@ function wp_tiny_mce( $teeny = false ) { 'accessibility_focus' => true, 'tabfocus_elements' => 'major-publishing-actions', 'media_strict' => false, - 'save_callback' => 'switchEditors.saveCallback', + 'paste_remove_styles' => true, + 'paste_remove_spans' => true, + 'paste_strip_class_attributes' => 'all', 'wpeditimage_disable_captions' => $no_captions, 'plugins' => "$plugins" ); @@ -1351,6 +1434,9 @@ function wp_tiny_mce( $teeny = false ) { if ( ! empty($mce_css) ) $initArray['content_css'] = "$mce_css"; + if ( is_array($settings) ) + $initArray = array_merge($initArray, $settings); + // For people who really REALLY know what they're doing with TinyMCE // You can modify initArray to add, remove, change elements of the config before tinyMCE.init // Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through "tiny_mce_before_init". diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 53ec246d..e7d37f4c 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -19,12 +19,10 @@ $charset_collate = ''; // Declare these as global in case schema.php is included from a function. global $wpdb, $wp_queries; -if ( $wpdb->has_cap( 'collation' ) ) { - if ( ! empty($wpdb->charset) ) - $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; - if ( ! empty($wpdb->collate) ) - $charset_collate .= " COLLATE $wpdb->collate"; -} +if ( ! empty($wpdb->charset) ) + $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; +if ( ! empty($wpdb->collate) ) + $charset_collate .= " COLLATE $wpdb->collate"; /** Create WordPress database tables SQL */ $wp_queries = "CREATE TABLE $wpdb->terms ( @@ -54,6 +52,15 @@ CREATE TABLE $wpdb->term_relationships ( PRIMARY KEY (object_id,term_taxonomy_id), KEY term_taxonomy_id (term_taxonomy_id) ) $charset_collate; +CREATE TABLE $wpdb->commentmeta ( + meta_id bigint(20) unsigned NOT NULL auto_increment, + comment_id bigint(20) unsigned NOT NULL default '0', + meta_key varchar(255) default NULL, + meta_value longtext, + PRIMARY KEY (meta_id), + KEY comment_id (comment_id), + KEY meta_key (meta_key) +) $charset_collate; CREATE TABLE $wpdb->comments ( comment_ID bigint(20) unsigned NOT NULL auto_increment, comment_post_ID bigint(20) unsigned NOT NULL default '0', @@ -99,8 +106,8 @@ CREATE TABLE $wpdb->options ( option_name varchar(64) NOT NULL default '', option_value longtext NOT NULL, autoload varchar(20) NOT NULL default 'yes', - PRIMARY KEY (option_id,blog_id,option_name), - KEY option_name (option_name) + PRIMARY KEY (option_id), + UNIQUE KEY option_name (option_name) ) $charset_collate; CREATE TABLE $wpdb->postmeta ( meta_id bigint(20) unsigned NOT NULL auto_increment, @@ -180,12 +187,10 @@ function populate_options() { do_action('populate_options'); if ( ini_get('safe_mode') ) { - // Safe mode screws up mkdir(), so we must use a flat structure. + // Safe mode can break mkdir() so use a flat structure by default. $uploads_use_yearmonth_folders = 0; - $upload_path = WP_CONTENT_DIR; } else { $uploads_use_yearmonth_folders = 1; - $upload_path = WP_CONTENT_DIR . '/uploads'; } $options = array( @@ -200,7 +205,6 @@ function populate_options() { 'require_name_email' => 1, 'comments_notify' => 1, 'posts_per_rss' => 10, - 'rss_excerpt_length' => 50, 'rss_use_excerpt' => 0, 'mailserver_url' => 'mail.example.com', 'mailserver_login' => 'login@example.com', @@ -257,7 +261,7 @@ function populate_options() { // 2.0.1 'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders, - 'upload_path' => $upload_path, + 'upload_path' => '', // 2.0.3 'secret' => wp_generate_password(64), @@ -305,7 +309,12 @@ function populate_options() { 'widget_rss' => array(), // 2.8 - 'timezone_string' => '' + 'timezone_string' => '', + + // 2.9 + 'embed_autourls' => 1, + 'embed_size_w' => '', + 'embed_size_h' => 600, ); // Set autoload to no for these options @@ -339,9 +348,12 @@ function populate_options() { // Delete unused options $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', - 'page_uris', 'rewrite_rules', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed'); + 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length'); foreach ($unusedoptions as $option) delete_option($option); + + // delete obsolete magpie stuff + $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'"); } /** diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index b47e079d..79bc9900 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -177,14 +177,14 @@ function _cat_row( $category, $level, $name_override = false ) { $output .= "$edit"; $output .= ''; break; case 'description': $output .= "$category->description"; break; case 'slug': - $output .= "$category->slug"; + $output .= "" . apply_filters('editable_slug', $category->slug) . ""; break; case 'posts': $attributes = 'class="posts column-posts num"' . $style; @@ -347,14 +347,14 @@ function link_cat_row( $category, $name_override = false ) { $output .= "$edit"; $output .= ''; break; case 'description': $output .= "$category->description"; break; case 'slug': - $output .= "$category->slug"; + $output .= "" . apply_filters('editable_slug', $category->slug) . ""; break; case 'links': $attributes = 'class="links column-links num"' . $style; @@ -376,7 +376,7 @@ function link_cat_row( $category, $name_override = false ) { * * Compares the first two arguments and if identical marks as checked * - * @since 2.8 + * @since 1.0 * * @param any $checked One of the values to compare * @param any $current (true) The other value to compare if not just true @@ -391,7 +391,7 @@ function checked( $checked, $current = true, $echo = true) { * * Compares the first two arguments and if identical marks as selected * - * @since 2.8 + * @since 1.0 * * @param any selected One of the values to compare * @param any $current (true) The other value to compare if not just true @@ -415,7 +415,7 @@ function selected( $selected, $current = true, $echo = true) { * @param string $type The type of checked|selected we are doing. */ function __checked_selected_helper( $helper, $current, $echo, $type) { - if ( $helper == $current) + if ( (string) $helper === (string) $current) $result = " $type='$type'"; else $result = ''; @@ -487,7 +487,7 @@ class Walker_Category_Checklist extends Walker { * @param unknown_type $selected_cats * @param unknown_type $popular_cats */ -function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null ) { +function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) { if ( empty($walker) || !is_a($walker, 'Walker') ) $walker = new Walker_Category_Checklist; @@ -515,19 +515,21 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select $categories = get_categories('get=all'); } - // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) - $checked_categories = array(); - $keys = array_keys( $categories ); + if ( $checked_ontop ) { + // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) + $checked_categories = array(); + $keys = array_keys( $categories ); - foreach( $keys as $k ) { - if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) { - $checked_categories[] = $categories[$k]; - unset( $categories[$k] ); + foreach( $keys as $k ) { + if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) { + $checked_categories[] = $categories[$k]; + unset( $categories[$k] ); + } } - } - // Put checked cats on top - echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args)); + // Put checked cats on top + echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args)); + } // Then the rest of them echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args)); } @@ -545,10 +547,12 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select */ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { global $post_ID; + if ( $post_ID ) $checked_categories = wp_get_post_categories($post_ID); else $checked_categories = array(); + $categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) ); $popular_ids = array(); @@ -557,11 +561,12 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech if ( !$echo ) // hack for AJAX use continue; $id = "popular-category-$category->term_id"; + $checked = in_array( $category->term_id, $checked_categories ) ? 'checked="checked"' : ''; ?> @@ -663,7 +668,7 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { $actions = array(); $actions['edit'] = '' . __('Edit') . ''; $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; - $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; + $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; $actions = apply_filters('tag_row_actions', $actions, $tag); $action_count = count($actions); $i = 0; @@ -676,13 +681,13 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { $out .= '
      '; $out .= ''; + $out .= '
      ' . apply_filters('editable_slug', $qe_data->slug) . '
      '; break; case 'description': $out .= "$tag->description"; break; case 'slug': - $out .= "$tag->slug"; + $out .= "" . apply_filters('editable_slug', $tag->slug) . ""; break; case 'posts': $attributes = 'class="posts column-posts num"' . $style; @@ -730,7 +735,7 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'po $out = ''; $count = 0; foreach( $tags as $tag ) - $out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"', $taxonomy ); + $out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '', $taxonomy ); // filter and send to screen echo $out; @@ -753,7 +758,8 @@ function wp_manage_posts_columns() { $posts_columns['author'] = __('Author'); $posts_columns['categories'] = __('Categories'); $posts_columns['tags'] = __('Tags'); - if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) + $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; + if ( !in_array( $post_status, array('pending', 'draft', 'future') ) ) $posts_columns['comments'] = '
      Comments
      '; $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_posts_columns', $posts_columns); @@ -800,10 +806,8 @@ function wp_manage_pages_columns() { $posts_columns['cb'] = ''; $posts_columns['title'] = __('Title'); $posts_columns['author'] = __('Author'); - $post_status = 'all'; - if ( !empty($_GET['post_status']) ) - $post_status = $_GET['post_status']; - if ( !in_array($post_status, array('pending', 'draft', 'future')) ) + $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; + if ( !in_array( $post_status, array('pending', 'draft', 'future') ) ) $posts_columns['comments'] = '
      '; $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_pages_columns', $posts_columns); @@ -1055,21 +1059,18 @@ function inline_edit_row( $type ) { id, true, $type ); // TODO: ROLE SYSTEM + $authors_dropdown = ''; if ( $authors && count( $authors ) > 1 ) : - $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1); + $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1, 'echo' => 0); if ( $bulk ) $users_opt['show_option_none'] = __('- No Change -'); -?> - + $authors_dropdown = ''; - @@ -1294,7 +1295,7 @@ function get_inline_data($post) { echo ' + -

      +

      ID) ) wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') ); + if ( empty($post->ID) ) + wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') ); + + if ( !current_user_can('edit_post', $post_ID) ) + wp_die( __('You are not allowed to edit this post.') ); + + if ( 'trash' == $post->post_status ) + wp_die( __('You can’t edit this post because it is in the Trash. Please restore it and try again.') ); if ( 'post' != $post->post_type ) { wp_redirect( get_edit_post_link( $post->ID, 'url' ) ); @@ -131,20 +150,14 @@ case 'edit': wp_enqueue_script( 'admin-comments' ); enqueue_comment_hotkeys_js(); - if ( current_user_can('edit_post', $post_ID) ) { - if ( $last = wp_check_post_lock( $post->ID ) ) { - add_action('admin_notices', '_admin_notice_post_locked' ); - } else { - wp_set_post_lock( $post->ID ); - wp_enqueue_script('autosave'); - } + if ( $last = wp_check_post_lock( $post->ID ) ) { + add_action('admin_notices', '_admin_notice_post_locked' ); + } else { + wp_set_post_lock( $post->ID ); + wp_enqueue_script('autosave'); } $title = __('Edit Post'); - - if ( !current_user_can('edit_post', $post_ID) ) - die ( __('You are not allowed to edit this post.') ); - $post = get_post_to_edit($post_ID); include('edit-form-advanced.php'); @@ -177,6 +190,38 @@ case 'editpost': exit(); break; +case 'trash': + $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); + check_admin_referer('trash-post_' . $post_id); + + $post = & get_post($post_id); + + if ( !current_user_can('delete_post', $post_id) ) + wp_die( __('You are not allowed to move this post to the trash.') ); + + if ( ! wp_trash_post($post_id) ) + wp_die( __('Error in moving to trash...') ); + + wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) ); + exit(); + break; + +case 'untrash': + $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); + check_admin_referer('untrash-post_' . $post_id); + + $post = & get_post($post_id); + + if ( !current_user_can('delete_post', $post_id) ) + wp_die( __('You are not allowed to move this post out of the trash.') ); + + if ( ! wp_untrash_post($post_id) ) + wp_die( __('Error in restoring from trash...') ); + + wp_redirect( add_query_arg('untrashed', 1, $sendback) ); + exit(); + break; + case 'delete': $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); check_admin_referer('delete-post_' . $post_id); @@ -186,19 +231,17 @@ case 'delete': if ( !current_user_can('delete_post', $post_id) ) wp_die( __('You are not allowed to delete this post.') ); + $force = !EMPTY_TRASH_DAYS; if ( $post->post_type == 'attachment' ) { - if ( ! wp_delete_attachment($post_id) ) + $force = ( $force || !MEDIA_TRASH ); + if ( ! wp_delete_attachment($post_id, $force) ) wp_die( __('Error in deleting...') ); } else { - if ( !wp_delete_post($post_id) ) + if ( !wp_delete_post($post_id, $force) ) wp_die( __('Error in deleting...') ); } - $sendback = wp_get_referer(); - if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?deleted=1'); - elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); - else $sendback = add_query_arg('deleted', 1, $sendback); - wp_redirect($sendback); + wp_redirect( add_query_arg('deleted', 1, $sendback) ); exit(); break; diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index c6632b51..4eda788c 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -42,38 +42,39 @@ function aposfix($text) { function press_it() { // define some basic variables $quick['post_status'] = 'draft'; // set as draft first - $quick['post_category'] = isset($_REQUEST['post_category']) ? $_REQUEST['post_category'] : null; - $quick['tax_input'] = isset($_REQUEST['tax_input']) ? $_REQUEST['tax_input'] : ''; - $quick['post_title'] = isset($_REQUEST['title']) ? $_REQUEST['title'] : ''; - $quick['post_content'] = ''; + $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null; + $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null; + $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' '; + $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : ''; // insert the post with nothing in it, to get an ID $post_ID = wp_insert_post($quick, true); - $content = isset($_REQUEST['content']) ? $_REQUEST['content'] : ''; + if ( is_wp_error($post_ID) ) + wp_die($post_ID); + + $content = isset($_POST['content']) ? $_POST['content'] : ''; $upload = false; - if( !empty($_REQUEST['photo_src']) && current_user_can('upload_files') ) - foreach( (array) $_REQUEST['photo_src'] as $key => $image) + if( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { + foreach( (array) $_POST['photo_src'] as $key => $image) { // see if files exist in content - we don't want to upload non-used selected files. - if( strpos($_REQUEST['content'], $image) !== false ) { - $desc = isset($_REQUEST['photo_description'][$key]) ? $_REQUEST['photo_description'][$key] : ''; + if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) { + $desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : ''; $upload = media_sideload_image($image, $post_ID, $desc); // Replace the POSTED content with correct uploaded ones. Regex contains fix for Magic Quotes - if( !is_wp_error($upload) ) $content = preg_replace('/]*)src=\\\?(\"|\')'.preg_quote($image, '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); + if( !is_wp_error($upload) ) + $content = preg_replace('/]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); } - + } + } // set the post_content and status - $quick['post_status'] = isset($_REQUEST['publish']) ? 'publish' : 'draft'; + $quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft'; $quick['post_content'] = $content; - // error handling for $post - if ( is_wp_error($post_ID)) { - wp_die($id); - wp_delete_post($post_ID); // error handling for media_sideload - } elseif ( is_wp_error($upload)) { - wp_die($upload); + if ( is_wp_error($upload) ) { wp_delete_post($post_ID); + wp_die($upload); } else { $quick['ID'] = $post_ID; wp_update_post($quick); @@ -91,89 +92,96 @@ if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) { } // Set Variables -$title = isset($_GET['t']) ? esc_html(aposfix(stripslashes($_GET['t']))) : ''; -$selection = isset($_GET['s']) ? trim( aposfix( stripslashes($_GET['s']) ) ) : ''; +$title = isset( $_GET['t'] ) ? trim( strip_tags( aposfix( stripslashes( $_GET['t'] ) ) ) ) : ''; +$selection = isset( $_GET['s'] ) ? trim( htmlspecialchars( html_entity_decode( aposfix( stripslashes( $_GET['s'] ) ) ) ) ) : ''; if ( ! empty($selection) ) { $selection = preg_replace('/(\r?\n|\r)/', '

      ', $selection); $selection = '

      '.str_replace('

      ', '', $selection).'

      '; } + $url = isset($_GET['u']) ? esc_url($_GET['u']) : ''; $image = isset($_GET['i']) ? $_GET['i'] : ''; if ( !empty($_REQUEST['ajax']) ) { -switch ($_REQUEST['ajax']) { - case 'video': ?> - -
      -

      -
      - -

      -
      -
      - - -

      -
      -
      - -
      -
      - -

      - <?php echo esc_attr(__('Click to insert.')); ?>

      - -

      - - - + +
      +

      +
      + +

      +
      +
      + - -

      -
      -
      - + case 'photo_thickbox': ?> + +

      +
      +
      + +
      -
      +

      + + + <?php echo esc_attr(__('Click to insert.')); ?> + +

      + +

      + + +

      +
      +
      + +
      +
      +

      +
      +
      + +
      -
      -

      |

      - |

      + ]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is'; + $pattern = '/]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/i'; + $content = str_replace(array("\n","\t","\r"), '', $content); preg_match_all($pattern, $content, $matches); if ( empty($matches[0]) ) return ''; @@ -205,46 +215,45 @@ switch ($_REQUEST['ajax']) { $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); else $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); - $sources[] = esc_url($src); + $sources[] = esc_attr($src); } return "'" . implode("','", $sources) . "'"; } - $url = urldecode($url); - $url = str_replace(' ', '%20', $url); + $url = wp_kses(urldecode($url), null); echo 'new Array('.get_images_from_uri($url).')'; - break; case 'photo_js': ?> // gather images and load some default JS var last = null var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; + if(photostorage == false) { + var my_src = eval( + jQuery.ajax({ + type: "GET", + url: "", + cache : false, + async : false, + data: "ajax=photo_images&u=", + dataType : "script" + }).responseText + ); + if(my_src.length == 0) { var my_src = eval( jQuery.ajax({ - type: "GET", - url: "", + type: "GET", + url: "", cache : false, async : false, - data: "ajax=photo_images&u=", + data: "ajax=photo_images&u=", dataType : "script" }).responseText ); if(my_src.length == 0) { - var my_src = eval( - jQuery.ajax({ - type: "GET", - url: "", - cache : false, - async : false, - data: "ajax=photo_images&u=", - dataType : "script" - }).responseText - ); - if(my_src.length == 0) { - strtoappend = ''; - } + strtoappend = ''; } - + } + } for (i = 0; i < my_src.length; i++) { img = new Image(); img.src = my_src[i]; @@ -289,26 +298,12 @@ switch ($_REQUEST['ajax']) { desc = jQuery('#this_photo_description').val(); src = jQuery('#this_photo').val(); pick(src, desc); - jQuery('#extra_fields').hide(); - jQuery('#extra_fields').html(''); + jQuery('#extra-fields').hide(); + jQuery('#extra-fields').html(''); return false; } - - jQuery(document).ready(function() { - jQuery('#extra_fields').html('

      Photo ()

      '); - jQuery('.close').click(function() { - jQuery('#extra_fields').hide(); - jQuery('#extra_fields').html(''); - }); - jQuery('.refresh').click(function() { - show('photo'); - }); + jQuery('#extra-fields').html('

      Add Photos ()

      '); jQuery('#img_container').html(strtoappend); - jQuery('#photo_add_url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500'); - tb_init('#extra_fields .thickbox'); - - - }); @@ -342,10 +338,8 @@ var ajaxurl = ''; do_action('admin_print_scripts'); do_action('admin_head'); - if ( user_can_richedit() ) { - add_filter( 'teeny_mce_before_init', create_function( '$a', '$a["height"] = "400"; $a["onpageload"] = ""; $a["mode"] = "textareas"; $a["editor_selector"] = "mceEditor"; return $a;' ) ); - wp_tiny_mce( true ); - } + if ( user_can_richedit() ) + wp_tiny_mce( true, array( 'height' => '370' ) ); ?> - +
      -

      +

      @@ -454,6 +474,9 @@ var ajaxurl = '';
      diff --git a/wp-admin/rtl.css b/wp-admin/rtl.css index 201dfa67..d4774336 100644 --- a/wp-admin/rtl.css +++ b/wp-admin/rtl.css @@ -1,555 +1 @@ -/* 0 - 200 -=================================== */ -td.available-theme { - text-align: right; -} -#current-theme img { - float: right; - margin-right: 0; - margin-left: 1em; -} -.quicktags, .search { - font-family: Tahoma, "Times New Roman"; -} -/* 200 - 500 -=================================== */ -#save-post { - float: right; -} -.preview { - float: left; -} -#sticky-span { - margin-left: 0; - margin-right: 18px; -} -#post-body .misc-pub-section { - border-right-width: 0; - border-left-width: 1; - border-right-style: none; - border-left-style: solid; - float: right; -} -#post-body .misc-pub-section-last { - border-left: 0; -} -#delete-action { - text-align: right; - float: right; -} -#publishing-action { - text-align: left; - float: left; -} -.side-info ul { - padding-left: 0; - padding-right: 18px; -} -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - font-family: Tahoma, "Times New Roman"; -} -#wpcontent select { - font-family: Tahoma, "Times New Roman"; -} -#quicktags { - background-position: right top; -} -/* 500 - 700 -=================================== */ -#template div { - margin-right: 0; - margin-left: 190px; -} -* html #template div { - margin-left: 0; -} -#your-profile legend { - font-family: "Times New Roman", Tahoma; -} -#ajax-response.alignleft { - margin-left: 0; - margin-right: 2em; -} -.page-numbers { - margin-right: 0; - margin-left: 1px; -} -.column-author img, .column-username img { - float: right; - margin-right: 0; - margin-left: 10px; -} -.tablenav a.button-secondary { - margin: 8px 0 0 8px; -} -.tablenav .tablenav-pages { - float: left; -} -.tablenav .displaying-num { - margin-right: 0; - margin-left: 10px; - font-family: Tahoma, "Times New Roman"; -} -#postcustomstuff table input, -#postcustomstuff table select, -#postcustomstuff table textarea { - margin: 8px 8px 8px 0; -} -/* 700 - 1000 -=================================== */ -#pass-strength-result { - float: right; - margin: 12px 1px 5px 5px; -} -/* Admin Header */ -#user_info { - float: left; -} -#header-logo { - float: right; - margin: 7px 15px 0 0; -} -#wphead h1 { - font-family: "Times New Roman", Tahoma; - float: right; -} -#wphead h1.long-title { - font-family: "Times New Roman", Tahoma; -} -#adminmenu .wp-submenu a { - padding-left: 0; - padding-right: 12px; - border-width: 0 0 0 1px; - border-style: none none none solid; - font-family: Tahoma, "Times New Roman"; -} -#adminmenu a.menu-top, -#adminmenu .wp-submenu-head { - font-family: Tahoma, "Times New Roman"; -} -#adminmenu img.wp-menu-image { - float: right; -} -.folded #adminmenu img.wp-menu-image { - padding: 7px 6px 0 0; -} -#adminmenu a.separator { - cursor: e-resize; -} -.folded #adminmenu a.separator { - cursor: w-resize; -} -#adminmenu .wp-submenu .wp-submenu-head { - padding: 6px 10px 6px 4px; -} -.folded #adminmenu .wp-submenu { - margin: -1px 28px 0 0; -} -.folded #adminmenu .wp-submenu a { - padding-left: 0; - padding-right: 10px; -} -.folded #adminmenu a.wp-has-submenu { - margin-left: 0; - margin-right: 40px; -} -#adminmenu .wp-menu-toggle { - float: left; - padding: 1px 0 0 2px; - clear: left; -} -#adminmenu div.wp-menu-image { - float: right; -} -#wphead-info { - margin: 0 15px 0 0; - padding-right:0; - padding-left: 15px; -} -/* end side admin menu */ -/* 1000 - 1300 -=================================== */ -#adminmenu #awaiting-mod, -#adminmenu span.update-plugins, -#sidemenu li a span.update-plugins { - font-family: tahoma; - margin-left: 0; - margin-right: 2px; -} -#adminmenu li #awaiting-mod span, -#adminmenu li span.update-plugins span, -#sidemenu li a span.update-plugins span { - float: right; -} -.post-com-count-wrapper { - font-family: tahoma; -} -.column-response .post-com-count { - float: right; - margin-right: 0; - margin-left: 5px; -} -/* Tables used on comment.php and option/setting pages */ -.form-table th, -#wpbody-content .describe th { - text-align: right; -} -.form-table input.tog { - margin-right: 0; - margin-left: 2px; - float: right; -} -.form-table table.color-palette { - float: right; -} -#profile-page .form-table #rich_editing { - margin-right: 0; - margin-left: 5px; -} -/* Post Screen */ -/* 1300 - 1500 -=================================== */ -#normal-sortables .postbox .submit { - float: left; -} -#post-body .tagsdiv #newtag { - margin-right: 0; - margin-left: 5px; -} -#post-status-info { - padding: 0 7px 0 15px; -} -#comment-status-radio input { - margin: 2px 0 5px 3px; -} -.tagchecklist { - margin-left: 0; - margin-right: 10px; -} -.tagchecklist strong { - margin-left: 0; - margin-right: -8px; -} -.tagchecklist span { - float: right; -} -.tagchecklist span a { - margin: 6px -9px 0 0; - float: right; -} -.ac_results li { - text-align: right; -} -#poststuff h2 { - clear: right; -} -.description, .form-wrap p { - font-family: Tahoma, Arial; -} -/* 1500 - 1800 -=================================== */ -.meta-box-sortables .postbox .handlediv { - float: left; -} -.howto { - font-family: Tahoma, Arial; -} -.postarea h3 label { - float: right; -} -.postarea #add-media-button { - float: left; - right: auto; - left: 10px; -} -.wp_themeSkin tr.mceFirst td.mceToolbar { - background-position: right top; -} -#poststuff #edButtonPreview, -#poststuff #edButtonHTML { - margin: 5px 0 0 5px; - float: left; -} -#poststuff #edButtonHTML { - margin-right: 0; - margin-left: 15px; -} -#media-buttons a { - padding: 0 10px 5px 0; -} -.submitbox .submit { - text-align: right; -} - -.inside-submitbox #post_status { - margin: 2px -2px 2px 0; -} -.submitbox .submit input { - margin-right: 0; - margin-left: 4px; -} -/* Categories */ -#category-adder { - margin-left: 0; - margin-right: 120px; -} -#post-body ul#category-tabs li.tabs { - -moz-border-radius: 0 3px 3px 0; - -webkit-border-top-left-radius: 0; - -webkit-border-top-right-radius: 3px; - -webkit-border-bottom-left-radius: 0; - -webkit-border-bottom-right-radius: 3px; - border-top-left-radius: 0; - border-top-right-radius: 3px; - border-bottom-left-radius: 0; - border-bottom-right-radius: 3px; -} -#post-body ul#category-tabs { - float: right; - text-align: left; - margin: 0 0 0 -120px; -} -#post-body #categorydiv div.tabs-panel, -#post-body #linkcategorydiv div.tabs-panel { - margin: 0 120px 0 5px; -} -/* 1800 - 2000 -=================================== */ -#side-sortables #category-tabs li { - padding-right: 0; - padding-left: 8px; -} -#categorydiv ul.categorychecklist ul, -#linkcategorydiv ul.categorychecklist ul { - margin-left: 0; - margin-right: 18px; -} -/* positioning etc. */ -p.search-box { - float: left; -} -#posts-filter fieldset { - float: right; - margin: 0 0 1em 1.5ex; -} -#posts-filter fieldset legend { - padding: 0 1px .2em 0; -} -.view-switch { - float: left; -} -.filter { - float: right; - margin: -5px 10px 0 0; -} -#the-comment-list td.comment p.comment-author { - margin-right: 0; -} -#the-comment-list p.comment-author img { - float: right; - margin-right: 0; - margin-left: 8px; -} -.tablenav .delete { - margin-right: 0; - margin-left: 20px; -} -td.action-links, th.action-links { - text-align: left; -} -/* 2000 - 2300 -=================================== */ -.filter .subsubsub { - margin-left: 0; - margin-right: -10px; -} -#wp-word-count { - margin-right: 10px; -} -.tool-box .title { - font-family: "Times New Roman", Tahoma; -} -.settings-toggle { - text-align: left; - margin: 5px 0 15px 7px; -} -.curtime #timestamp { - background-position: right top; - padding-left: 0; - padding-right: 18px; -} -/* media popup 0819 */ -#sidemenu { - margin: -30px 315px 0 15px; - float: left; - padding-left: 0; - padding-right: 10px; -} -#sidemenu a { - float: right; -} -#replysubmit .button { - margin-right: 0; - margin-left: 5px; -} -/* 2300 - 2500 -=================================== */ -#edithead .inside { - float: right; - margin: 3px 5px 2px 0; -} -#replyrow #ed_reply_toolbar input { - margin: 1px 1px 1px 2px; -} -/* show/hide settings */ -#screen-meta-links { - margin: 0 0 0 9px; -} -#screen-options-link-wrap, -#contextual-help-link-wrap { - float: left; - font-family: Tahoma, "Times New Roman"; - margin: 0 0 0 6px; -} -.metabox-prefs label { - padding-right: 0; - padding-left: 15px; -} -.metabox-prefs label input { - margin: 0 2px 0 5px; -} -.inline-editor .save, -.inline-editor .cancel { - margin-right: 0; - margin-left: 5px; -} -/* 2500 - 2700 -=================================== */ -#bulk-titles div a { - float: right; - margin: 3px -2px 0 3px; -} -#wpbody-content .filename { - margin-left: 0; - margin-right: 10px; -} -#wpbody-content .inline-edit-row fieldset { - float: right; -} -#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col { - border-left: 0 none; - border-right: 1px solid; -} -#wpbody-content .bulk-edit-row .inline-edit-col-bottom { - float: left; -} -.inline-edit-row fieldset label span.title { - float: right; -} -.inline-edit-row fieldset label span.input-text-wrap { - margin-left: 0; - margin-right: 5em; -} -.quick-edit-row-post fieldset.inline-edit-col-right label span.title { - padding-right: 0; - padding-left: 0.5em; -} -#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child { - margin-right: 0; - margin-left: 0.5em; -} -/* 2700 - 3000 -=================================== */ -.inline-edit-row fieldset span.title, -.inline-edit-row fieldset span.checkbox-title { - font-family: Tahoma, "Times New Roman"; -} -.inline-edit-row fieldset .inline-edit-date { - float: right; -} -.inline-edit-row fieldset ul.cat-checklist label, -.inline-edit-row .catshow, -.inline-edit-row .cathide, -.inline-edit-row #bulk-titles div { - font-family: Tahoma, "Times New Roman"; -} -.quick-edit-row-post fieldset label.inline-edit-status { - float: right; -} -.describe-toggle-on, .describe-toggle-off { - float: left; - margin-right: 0; - margin-left: 20px; -} -#wpbody-content #media-items .filename { - float: right; - margin-left: 0; - margin-right: 10px; -} -.media-item .pinkynail { - float: right; -} -#find-posts-response .found-radio { - padding: 8px 8px 0 0; -} -.find-box-buttons { - left: auto; - right: 12px; -} -.find-box-search label { - padding-right: 0; - padding-left: 6px; -} -/* favorite-actions */ -#favorite-actions { - float: left; -} -#favorite-first { - padding: 3px 12px 4px 30px; -} -#favorite-inside { -} -#favorite-inside a { - padding: 3px 10px 3px 5px; -} -#favorite-toggle { - right: auto; - left: 0; - background:transparent url(images/fav-arrow-rtl.gif) no-repeat 10px -4px; -} -#utc-time, #local-time { - padding-left: 0; - padding-right: 25px; - font-family: Tahoma, Arial; -} -.icon32 { - float: right; - margin: 14px 0 0 6px; -} -.subtitle { - padding-left: 0; - padding-right: 25px; -} - -ol { - list-style-type:decimal; - margin-left:0; - margin-right:2em; -} - - -/* TinyMCE -=================================== */ -.clearlooks2 .mceTop .mceLeft { - width:100% !important; -} -/* ltr -=================================== */ -#author-email, #author-url, #rss-url-1, #edit-slug-box, #post_name, #trackback_url, #metakeyinput, #post_password, #slug, #category_nicename, #link_url, #link_image, #rss_uri, #menu_order, #email, #newcomment_author_url, #pages-exclude, #template textarea, #user_login, #url, #pass1, #pass2, #aim, #yim, #jabber, #siteurl, #home, #admin_email, #gmt_offset, #default_post_edit_rows, #mailserver_url, #mailserver_login, #mailserver_pass, #mailserver_port, #ping_sites, #posts_per_page, #posts_per_rss, #blog_charset, #close_comments_days_old, #comments_per_page, #comment_max_links, #moderation_keys, #blacklist_keys, #thumbnail_size_w, #thumbnail_size_h, #medium_size_w, #medium_size_h, #large_size_w, #large_size_h, #permalink_structure, #category_base, #tag_base, #upload_path, #upload_url_path, #rules { - direction: ltr; -} +td.available-theme{text-align:right;}#current-theme img{float:right;margin-right:0;margin-left:1em;}.quicktags,.search{font-family:Tahoma,Arial,sans-serif;}#save-post{float:right;}.preview{float:left;}#sticky-span{margin-left:0;margin-right:18px;}#post-body .misc-pub-section{border-right-width:0;border-left-width:1;border-right-style:none;border-left-style:solid;float:right;}#post-body .misc-pub-section-last{border-left:0;}#delete-action{text-align:right;float:right;}#publishing-action{text-align:left;float:left;}.side-info ul{padding-left:0;padding-right:18px;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:Tahoma,Arial,sans-serif;}#wpcontent select{font-family:Tahoma,Arial,sans-serif;}#quicktags{background-position:right top;}#template div{margin-right:0;margin-left:190px;}* html #template div{margin-left:0;}#your-profile legend{font-family:Tahoma,Arial,sans-serif;}#ajax-response.alignleft{margin-left:0;margin-right:2em;}.page-numbers{margin-right:0;margin-left:1px;}.column-author img,.column-username img{float:right;margin-right:0;margin-left:10px;}.tablenav a.button-secondary{margin:8px 0 0 8px;}.tablenav .tablenav-pages{float:left;}.tablenav .displaying-num{margin-right:0;margin-left:10px;font-family:Tahoma,Arial,sans-serif;}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{margin:8px 8px 8px 0;}#pass-strength-result{float:right;margin:12px 1px 5px 5px;}#user_info{float:left;}#header-logo{float:right;margin:7px 15px 0 0;}#wphead h1{font-family:Tahoma,Arial,sans-serif;float:right;}#wphead h1.long-title{font-family:Tahoma,Arial,sans-serif;}#adminmenu .wp-submenu a{padding-left:0;padding-right:12px;border-width:0 0 0 1px;border-style:none none none solid;font-family:Tahoma,Arial,sans-serif;}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font-family:Tahoma,Arial,sans-serif;}#adminmenu img.wp-menu-image{float:right;}.folded #adminmenu img.wp-menu-image{padding:7px 6px 0 0;}#adminmenu a.separator{cursor:e-resize;}.folded #adminmenu a.separator{cursor:w-resize;}#adminmenu .wp-submenu .wp-submenu-head{padding:6px 10px 6px 4px;}.folded #adminmenu .wp-submenu{margin:-1px 28px 0 0;}.folded #adminmenu .wp-submenu a{padding-left:0;padding-right:10px;}.folded #adminmenu a.wp-has-submenu{margin-left:0;margin-right:40px;}#adminmenu .wp-menu-toggle{float:left;padding:1px 0 0 2px;clear:left;}#adminmenu div.wp-menu-image{float:right;}#wphead-info{margin:0 15px 0 0;padding-right:0;padding-left:15px;}#adminmenu #awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:2px;}#adminmenu li #awaiting-mod span,#adminmenu li span.update-plugins span,#sidemenu li a span.update-plugins span{float:right;}.post-com-count-wrapper{font-family:Tahoma,Arial,sans-serif;}.column-response .post-com-count{float:right;margin-right:0;margin-left:5px;}.form-table th,#wpbody-content .describe th{text-align:right;}.form-table input.tog{margin-right:0;margin-left:2px;float:right;}.form-table table.color-palette{float:right;}#profile-page .form-table #rich_editing{margin-right:0;margin-left:5px;}#normal-sortables .postbox .submit{float:left;}#post-body .tagsdiv #newtag{margin-right:0;margin-left:5px;}#post-status-info{padding:0 7px 0 15px;}#comment-status-radio input{margin:2px 0 5px 3px;}.tagchecklist{margin-left:0;margin-right:10px;}.tagchecklist strong{margin-left:0;margin-right:-8px;}.tagchecklist span{float:right;}.tagchecklist span a{margin:6px -9px 0 0;float:right;}.ac_results li{text-align:right;}#poststuff h2{clear:right;}.description,.form-wrap p{font-family:Tahoma,Arial,sans-serif;}.meta-box-sortables .postbox .handlediv{float:left;}.howto{font-family:Tahoma,Arial,sans-serif;}.postarea h3 label{float:right;}.postarea #add-media-button{float:left;right:auto;left:10px;}.wp_themeSkin tr.mceFirst td.mceToolbar{background-position:right top;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{margin:5px 0 0 5px;float:left;}#poststuff #edButtonHTML{margin-right:0;margin-left:15px;}#media-buttons a{padding:0 10px 5px 0;}.submitbox .submit{text-align:right;}.inside-submitbox #post_status{margin:2px -2px 2px 0;}.submitbox .submit input{margin-right:0;margin-left:4px;}#category-adder{margin-left:0;margin-right:120px;}#post-body ul#category-tabs li.tabs{-moz-border-radius:0 3px 3px 0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-top-left-radius:0;border-top-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px;}#post-body ul#category-tabs{float:right;text-align:left;margin:0 0 0 -120px;}#post-body #categorydiv div.tabs-panel,#post-body #linkcategorydiv div.tabs-panel{margin:0 120px 0 5px;}#side-sortables #category-tabs li{padding-right:0;padding-left:8px;}#categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:0;margin-right:18px;}p.search-box{float:left;}#posts-filter fieldset{float:right;margin:0 0 1em 1.5ex;}#posts-filter fieldset legend{padding:0 1px .2em 0;}.view-switch{float:left;}.filter{float:right;margin:-5px 10px 0 0;}#the-comment-list td.comment p.comment-author{margin-right:0;}#the-comment-list p.comment-author img{float:right;margin-right:0;margin-left:8px;}.tablenav .delete{margin-right:0;margin-left:20px;}td.action-links,th.action-links{text-align:left;}.filter .subsubsub{margin-left:0;margin-right:-10px;}#wp-word-count{margin-right:10px;}.tool-box .title{font-family:Tahoma,Arial,sans-serif;}.settings-toggle{text-align:left;margin:5px 0 15px 7px;}.curtime #timestamp{background-position:right top;padding-left:0;padding-right:18px;}#sidemenu{margin:-30px 315px 0 15px;float:left;padding-left:0;padding-right:10px;}#sidemenu a{float:right;}#replysubmit .button{margin-right:0;margin-left:5px;}#edithead .inside{float:right;margin:3px 5px 2px 0;}#replyrow #ed_reply_toolbar input{margin:1px 1px 1px 2px;}#screen-meta-links{margin:0 0 0 9px;}#screen-options-link-wrap,#contextual-help-link-wrap{float:left;font-family:Tahoma,Arial,sans-serif;margin:0 0 0 6px;}.metabox-prefs label{padding-right:0;padding-left:15px;}.metabox-prefs label input{margin:0 2px 0 5px;}.inline-editor .save,.inline-editor .cancel{margin-right:0;margin-left:5px;}#bulk-titles div a{float:right;margin:3px -2px 0 3px;}#wpbody-content .filename{margin-left:0;margin-right:10px;}#wpbody-content .inline-edit-row fieldset{float:right;}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-left:0 none;border-right:1px solid;}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:left;}.inline-edit-row fieldset label span.title{float:right;}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;margin-right:5em;}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{padding-right:0;padding-left:.5em;}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:0;margin-left:.5em;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Tahoma,Arial,sans-serif;}.inline-edit-row fieldset .inline-edit-date{float:right;}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:Tahoma,Arial,sans-serif;}.quick-edit-row-post fieldset label.inline-edit-status{float:right;}.describe-toggle-on,.describe-toggle-off{float:left;margin-right:0;margin-left:20px;}#wpbody-content #media-items .filename{float:right;margin-left:0;margin-right:10px;}.media-item .pinkynail{float:right;}#find-posts-response .found-radio{padding:8px 8px 0 0;}.find-box-buttons{left:auto;right:12px;}.find-box-search label{padding-right:0;padding-left:6px;}#favorite-actions{float:left;}#favorite-first{padding:3px 12px 4px 30px;}#favorite-inside a{padding:3px 10px 3px 5px;}#favorite-toggle{right:auto;left:0;background:transparent url(images/fav-arrow-rtl.gif) no-repeat 10px -4px;}#utc-time,#local-time{padding-left:0;padding-right:25px;font-family:Tahoma,Arial;}.icon32{float:right;margin:14px 0 0 6px;}.subtitle{padding-left:0;padding-right:25px;}ol{list-style-type:decimal;margin-left:0;margin-right:2em;}.postbox-container{float:right;padding-left:.5%;padding-right:0;}.clearlooks2 .mceTop .mceLeft{width:100%!important;}#author-email,#author-url,#rss-url-1,#edit-slug-box,#post_name,#trackback_url,#metakeyinput,#post_password,#slug,#category_nicename,#link_url,#link_image,#rss_uri,#menu_order,#email,#newcomment_author_url,#pages-exclude,#template textarea,#user_login,#url,#pass1,#pass2,#aim,#yim,#jabber,#siteurl,#home,#admin_email,#gmt_offset,#default_post_edit_rows,#mailserver_url,#mailserver_login,#mailserver_pass,#mailserver_port,#ping_sites,#posts_per_page,#posts_per_rss,#blog_charset,#close_comments_days_old,#comments_per_page,#comment_max_links,#moderation_keys,#blacklist_keys,#thumbnail_size_w,#thumbnail_size_h,#medium_size_w,#medium_size_h,#large_size_w,#large_size_h,#permalink_structure,#category_base,#tag_base,#upload_path,#upload_url_path,#rules{direction:ltr;} \ No newline at end of file diff --git a/wp-admin/rtl.dev.css b/wp-admin/rtl.dev.css new file mode 100644 index 00000000..9e988b53 --- /dev/null +++ b/wp-admin/rtl.dev.css @@ -0,0 +1,560 @@ +/* 0 - 200 +=================================== */ +td.available-theme { + text-align: right; +} +#current-theme img { + float: right; + margin-right: 0; + margin-left: 1em; +} +.quicktags, .search { + font-family: Tahoma, Arial, sans-serif; +} +/* 200 - 500 +=================================== */ +#save-post { + float: right; +} +.preview { + float: left; +} +#sticky-span { + margin-left: 0; + margin-right: 18px; +} +#post-body .misc-pub-section { + border-right-width: 0; + border-left-width: 1; + border-right-style: none; + border-left-style: solid; + float: right; +} +#post-body .misc-pub-section-last { + border-left: 0; +} +#delete-action { + text-align: right; + float: right; +} +#publishing-action { + text-align: left; + float: left; +} +.side-info ul { + padding-left: 0; + padding-right: 18px; +} +.submit input, +.button, +.button-primary, +.button-secondary, +.button-highlighted, +#postcustomstuff .submit input { + font-family: Tahoma, Arial, sans-serif; +} +#wpcontent select { + font-family: Tahoma, Arial, sans-serif; +} +#quicktags { + background-position: right top; +} +/* 500 - 700 +=================================== */ +#template div { + margin-right: 0; + margin-left: 190px; +} +* html #template div { + margin-left: 0; +} +#your-profile legend { + font-family: Tahoma, Arial, sans-serif; +} +#ajax-response.alignleft { + margin-left: 0; + margin-right: 2em; +} +.page-numbers { + margin-right: 0; + margin-left: 1px; +} +.column-author img, .column-username img { + float: right; + margin-right: 0; + margin-left: 10px; +} +.tablenav a.button-secondary { + margin: 8px 0 0 8px; +} +.tablenav .tablenav-pages { + float: left; +} +.tablenav .displaying-num { + margin-right: 0; + margin-left: 10px; + font-family: Tahoma, Arial, sans-serif; +} +#postcustomstuff table input, +#postcustomstuff table select, +#postcustomstuff table textarea { + margin: 8px 8px 8px 0; +} +/* 700 - 1000 +=================================== */ +#pass-strength-result { + float: right; + margin: 12px 1px 5px 5px; +} +/* Admin Header */ +#user_info { + float: left; +} +#header-logo { + float: right; + margin: 7px 15px 0 0; +} +#wphead h1 { + font-family: Tahoma, Arial, sans-serif; + float: right; +} +#wphead h1.long-title { + font-family: Tahoma, Arial, sans-serif; +} +#adminmenu .wp-submenu a { + padding-left: 0; + padding-right: 12px; + border-width: 0 0 0 1px; + border-style: none none none solid; + font-family: Tahoma, Arial, sans-serif; +} +#adminmenu a.menu-top, +#adminmenu .wp-submenu-head { + font-family: Tahoma, Arial, sans-serif; +} +#adminmenu img.wp-menu-image { + float: right; +} +.folded #adminmenu img.wp-menu-image { + padding: 7px 6px 0 0; +} +#adminmenu a.separator { + cursor: e-resize; +} +.folded #adminmenu a.separator { + cursor: w-resize; +} +#adminmenu .wp-submenu .wp-submenu-head { + padding: 6px 10px 6px 4px; +} +.folded #adminmenu .wp-submenu { + margin: -1px 28px 0 0; +} +.folded #adminmenu .wp-submenu a { + padding-left: 0; + padding-right: 10px; +} +.folded #adminmenu a.wp-has-submenu { + margin-left: 0; + margin-right: 40px; +} +#adminmenu .wp-menu-toggle { + float: left; + padding: 1px 0 0 2px; + clear: left; +} +#adminmenu div.wp-menu-image { + float: right; +} +#wphead-info { + margin: 0 15px 0 0; + padding-right:0; + padding-left: 15px; +} +/* end side admin menu */ +/* 1000 - 1300 +=================================== */ +#adminmenu #awaiting-mod, +#adminmenu span.update-plugins, +#sidemenu li a span.update-plugins { + font-family: Tahoma, Arial, sans-serif; + margin-left: 0; + margin-right: 2px; +} +#adminmenu li #awaiting-mod span, +#adminmenu li span.update-plugins span, +#sidemenu li a span.update-plugins span { + float: right; +} +.post-com-count-wrapper { + font-family: Tahoma, Arial, sans-serif; +} +.column-response .post-com-count { + float: right; + margin-right: 0; + margin-left: 5px; +} +/* Tables used on comment.php and option/setting pages */ +.form-table th, +#wpbody-content .describe th { + text-align: right; +} +.form-table input.tog { + margin-right: 0; + margin-left: 2px; + float: right; +} +.form-table table.color-palette { + float: right; +} +#profile-page .form-table #rich_editing { + margin-right: 0; + margin-left: 5px; +} +/* Post Screen */ +/* 1300 - 1500 +=================================== */ +#normal-sortables .postbox .submit { + float: left; +} +#post-body .tagsdiv #newtag { + margin-right: 0; + margin-left: 5px; +} +#post-status-info { + padding: 0 7px 0 15px; +} +#comment-status-radio input { + margin: 2px 0 5px 3px; +} +.tagchecklist { + margin-left: 0; + margin-right: 10px; +} +.tagchecklist strong { + margin-left: 0; + margin-right: -8px; +} +.tagchecklist span { + float: right; +} +.tagchecklist span a { + margin: 6px -9px 0 0; + float: right; +} +.ac_results li { + text-align: right; +} +#poststuff h2 { + clear: right; +} +.description, .form-wrap p { + font-family: Tahoma, Arial, sans-serif; +} +/* 1500 - 1800 +=================================== */ +.meta-box-sortables .postbox .handlediv { + float: left; +} +.howto { + font-family: Tahoma, Arial, sans-serif; +} +.postarea h3 label { + float: right; +} +.postarea #add-media-button { + float: left; + right: auto; + left: 10px; +} +.wp_themeSkin tr.mceFirst td.mceToolbar { + background-position: right top; +} +#poststuff #edButtonPreview, +#poststuff #edButtonHTML { + margin: 5px 0 0 5px; + float: left; +} +#poststuff #edButtonHTML { + margin-right: 0; + margin-left: 15px; +} +#media-buttons a { + padding: 0 10px 5px 0; +} +.submitbox .submit { + text-align: right; +} + +.inside-submitbox #post_status { + margin: 2px -2px 2px 0; +} +.submitbox .submit input { + margin-right: 0; + margin-left: 4px; +} +/* Categories */ +#category-adder { + margin-left: 0; + margin-right: 120px; +} +#post-body ul#category-tabs li.tabs { + -moz-border-radius: 0 3px 3px 0; + -webkit-border-top-left-radius: 0; + -webkit-border-top-right-radius: 3px; + -webkit-border-bottom-left-radius: 0; + -webkit-border-bottom-right-radius: 3px; + border-top-left-radius: 0; + border-top-right-radius: 3px; + border-bottom-left-radius: 0; + border-bottom-right-radius: 3px; +} +#post-body ul#category-tabs { + float: right; + text-align: left; + margin: 0 0 0 -120px; +} +#post-body #categorydiv div.tabs-panel, +#post-body #linkcategorydiv div.tabs-panel { + margin: 0 120px 0 5px; +} +/* 1800 - 2000 +=================================== */ +#side-sortables #category-tabs li { + padding-right: 0; + padding-left: 8px; +} +#categorydiv ul.categorychecklist ul, +#linkcategorydiv ul.categorychecklist ul { + margin-left: 0; + margin-right: 18px; +} +/* positioning etc. */ +p.search-box { + float: left; +} +#posts-filter fieldset { + float: right; + margin: 0 0 1em 1.5ex; +} +#posts-filter fieldset legend { + padding: 0 1px .2em 0; +} +.view-switch { + float: left; +} +.filter { + float: right; + margin: -5px 10px 0 0; +} +#the-comment-list td.comment p.comment-author { + margin-right: 0; +} +#the-comment-list p.comment-author img { + float: right; + margin-right: 0; + margin-left: 8px; +} +.tablenav .delete { + margin-right: 0; + margin-left: 20px; +} +td.action-links, th.action-links { + text-align: left; +} +/* 2000 - 2300 +=================================== */ +.filter .subsubsub { + margin-left: 0; + margin-right: -10px; +} +#wp-word-count { + margin-right: 10px; +} +.tool-box .title { + font-family: Tahoma, Arial, sans-serif; +} +.settings-toggle { + text-align: left; + margin: 5px 0 15px 7px; +} +.curtime #timestamp { + background-position: right top; + padding-left: 0; + padding-right: 18px; +} +/* media popup 0819 */ +#sidemenu { + margin: -30px 315px 0 15px; + float: left; + padding-left: 0; + padding-right: 10px; +} +#sidemenu a { + float: right; +} +#replysubmit .button { + margin-right: 0; + margin-left: 5px; +} +/* 2300 - 2500 +=================================== */ +#edithead .inside { + float: right; + margin: 3px 5px 2px 0; +} +#replyrow #ed_reply_toolbar input { + margin: 1px 1px 1px 2px; +} +/* show/hide settings */ +#screen-meta-links { + margin: 0 0 0 9px; +} +#screen-options-link-wrap, +#contextual-help-link-wrap { + float: left; + font-family: Tahoma, Arial, sans-serif; + margin: 0 0 0 6px; +} +.metabox-prefs label { + padding-right: 0; + padding-left: 15px; +} +.metabox-prefs label input { + margin: 0 2px 0 5px; +} +.inline-editor .save, +.inline-editor .cancel { + margin-right: 0; + margin-left: 5px; +} +/* 2500 - 2700 +=================================== */ +#bulk-titles div a { + float: right; + margin: 3px -2px 0 3px; +} +#wpbody-content .filename { + margin-left: 0; + margin-right: 10px; +} +#wpbody-content .inline-edit-row fieldset { + float: right; +} +#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col { + border-left: 0 none; + border-right: 1px solid; +} +#wpbody-content .bulk-edit-row .inline-edit-col-bottom { + float: left; +} +.inline-edit-row fieldset label span.title { + float: right; +} +.inline-edit-row fieldset label span.input-text-wrap { + margin-left: 0; + margin-right: 5em; +} +.quick-edit-row-post fieldset.inline-edit-col-right label span.title { + padding-right: 0; + padding-left: 0.5em; +} +#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child { + margin-right: 0; + margin-left: 0.5em; +} +/* 2700 - 3000 +=================================== */ +.inline-edit-row fieldset span.title, +.inline-edit-row fieldset span.checkbox-title { + font-family: Tahoma, Arial, sans-serif; +} +.inline-edit-row fieldset .inline-edit-date { + float: right; +} +.inline-edit-row fieldset ul.cat-checklist label, +.inline-edit-row .catshow, +.inline-edit-row .cathide, +.inline-edit-row #bulk-titles div { + font-family: Tahoma, Arial, sans-serif; +} +.quick-edit-row-post fieldset label.inline-edit-status { + float: right; +} +.describe-toggle-on, .describe-toggle-off { + float: left; + margin-right: 0; + margin-left: 20px; +} +#wpbody-content #media-items .filename { + float: right; + margin-left: 0; + margin-right: 10px; +} +.media-item .pinkynail { + float: right; +} +#find-posts-response .found-radio { + padding: 8px 8px 0 0; +} +.find-box-buttons { + left: auto; + right: 12px; +} +.find-box-search label { + padding-right: 0; + padding-left: 6px; +} +/* favorite-actions */ +#favorite-actions { + float: left; +} +#favorite-first { + padding: 3px 12px 4px 30px; +} +#favorite-inside { +} +#favorite-inside a { + padding: 3px 10px 3px 5px; +} +#favorite-toggle { + right: auto; + left: 0; + background:transparent url(images/fav-arrow-rtl.gif) no-repeat 10px -4px; +} +#utc-time, #local-time { + padding-left: 0; + padding-right: 25px; + font-family: Tahoma, Arial; +} +.icon32 { + float: right; + margin: 14px 0 0 6px; +} +.subtitle { + padding-left: 0; + padding-right: 25px; +} + +ol { + list-style-type:decimal; + margin-left:0; + margin-right:2em; +} + +.postbox-container { + float: right; + padding-left: 0.5%; + padding-right: 0; +} + +/* TinyMCE +=================================== */ +.clearlooks2 .mceTop .mceLeft { + width:100% !important; +} +/* ltr +=================================== */ +#author-email, #author-url, #rss-url-1, #edit-slug-box, #post_name, #trackback_url, #metakeyinput, #post_password, #slug, #category_nicename, #link_url, #link_image, #rss_uri, #menu_order, #email, #newcomment_author_url, #pages-exclude, #template textarea, #user_login, #url, #pass1, #pass2, #aim, #yim, #jabber, #siteurl, #home, #admin_email, #gmt_offset, #default_post_edit_rows, #mailserver_url, #mailserver_login, #mailserver_pass, #mailserver_port, #ping_sites, #posts_per_page, #posts_per_rss, #blog_charset, #close_comments_days_old, #comments_per_page, #comment_max_links, #moderation_keys, #blacklist_keys, #thumbnail_size_w, #thumbnail_size_h, #medium_size_w, #medium_size_h, #large_size_w, #large_size_h, #permalink_structure, #category_base, #tag_base, #upload_path, #upload_url_path, #rules { + direction: ltr; +} diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 01b8f6a5..abab9904 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -16,6 +16,14 @@ */ define('WP_INSTALLING', true); +/** + * Disable error reporting + * + * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) f +or debugging + */ +error_reporting(0); + /**#@+ * These three defines are required to allow us to use require_wp_db() to load * the database class while being wp-content/db.php aware. @@ -35,9 +43,6 @@ if (!file_exists(ABSPATH . 'wp-config-sample.php')) $configFile = file(ABSPATH . 'wp-config-sample.php'); -if ( !is_writable(ABSPATH)) - wp_die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually."); - // Check if wp-config.php has been created if (file_exists(ABSPATH . 'wp-config.php')) wp_die("

      The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

      "); @@ -46,6 +51,12 @@ if (file_exists(ABSPATH . 'wp-config.php')) if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php')) wp_die("

      The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

      "); +if ( version_compare( '4.3', phpversion(), '>' ) ) + wp_die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) ); + +if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') ) + wp_die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ ); + if (isset($_GET['step'])) $step = $_GET['step']; else @@ -155,38 +166,52 @@ switch($step) { if ( !empty($wpdb->error) ) wp_die($wpdb->error->get_error_message()); - $handle = fopen(ABSPATH . 'wp-config.php', 'w'); - foreach ($configFile as $line_num => $line) { switch (substr($line,0,16)) { case "define('DB_NAME'": - fwrite($handle, str_replace("putyourdbnamehere", $dbname, $line)); + $configFile[$line_num] = str_replace("putyourdbnamehere", $dbname, $line); break; case "define('DB_USER'": - fwrite($handle, str_replace("'usernamehere'", "'$uname'", $line)); + $configFile[$line_num] = str_replace("'usernamehere'", "'$uname'", $line); break; case "define('DB_PASSW": - fwrite($handle, str_replace("'yourpasswordhere'", "'$passwrd'", $line)); + $configFile[$line_num] = str_replace("'yourpasswordhere'", "'$passwrd'", $line); break; case "define('DB_HOST'": - fwrite($handle, str_replace("localhost", $dbhost, $line)); + $configFile[$line_num] = str_replace("localhost", $dbhost, $line); break; case '$table_prefix =': - fwrite($handle, str_replace('wp_', $prefix, $line)); + $configFile[$line_num] = str_replace('wp_', $prefix, $line); break; - default: - fwrite($handle, $line); } } - fclose($handle); - chmod(ABSPATH . 'wp-config.php', 0666); - - display_header(); + if ( ! is_writable(ABSPATH) ) : + display_header(); +?> +

      Sorry, but I can't write the wp-config.php file.

      +

      You can create the wp-config.php manually and paste the following text into it.

      + +

      After you've done that, click "Run the install."

      +

      Run the install

      +

      All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…

      Run the install

      diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index c7343a7a..c85fa0ab 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -9,10 +9,13 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); +if ( !current_user_can('edit_themes') ) + wp_die('

      '.__('You do not have sufficient permissions to edit templates for this blog.').'

      '); + $title = __("Edit Themes"); $parent_file = 'themes.php'; -wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme')); +wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme', 'dir')); wp_admin_css( 'theme-editor' ); @@ -31,11 +34,17 @@ $allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme if (empty($file)) { $file = $allowed_files[0]; +} else { + $file = stripslashes($file); + if ( 'theme' == $dir ) { + $file = dirname(dirname($themes[$theme]['Template Dir'])) . $file ; + } else if ( 'style' == $dir) { + $file = dirname(dirname($themes[$theme]['Stylesheet Dir'])) . $file ; + } } -$file = validate_file_to_edit($file, $allowed_files); -$real_file = get_real_file_to_edit($file); - +validate_file_to_edit($file, $allowed_files); +$scrollto = isset($_REQUEST['scrollto']) ? (int) $_REQUEST['scrollto'] : 0; $file_show = basename( $file ); switch($action) { @@ -44,23 +53,20 @@ case 'update': check_admin_referer('edit-theme_' . $file . $theme); - if ( !current_user_can('edit_themes') ) - wp_die('

      '.__('You do not have sufficient permissions to edit templates for this blog.').'

      '); - $newcontent = stripslashes($_POST['newcontent']); $theme = urlencode($theme); - if (is_writeable($real_file)) { + if (is_writeable($file)) { //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable - $f = fopen($real_file, 'w+'); + $f = fopen($file, 'w+'); if ($f !== FALSE) { fwrite($f, $newcontent); fclose($f); - $location = "theme-editor.php?file=$file&theme=$theme&a=te"; + $location = "theme-editor.php?file=$file&theme=$theme&a=te&scrollto=$scrollto"; } else { - $location = "theme-editor.php?file=$file&theme=$theme"; + $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto"; } } else { - $location = "theme-editor.php?file=$file&theme=$theme"; + $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto"; } $location = wp_kses_no_null($location); @@ -73,21 +79,18 @@ break; default: - if ( !current_user_can('edit_themes') ) - wp_die('

      '.__('You do not have sufficient permissions to edit themes for this blog.').'

      '); - require_once('admin-header.php'); update_recently_edited($file); - if ( !is_file($real_file) ) + if ( !is_file($file) ) $error = 1; - if ( !$error && filesize($real_file) > 0 ) { - $f = fopen($real_file, 'r'); - $content = fread($f, filesize($real_file)); + if ( !$error && filesize($file) > 0 ) { + $f = fopen($file, 'r'); + $content = fread($f, filesize($file)); - if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) { + if ( '.php' == substr( $file, strrpos( $file, '.' ) ) ) { $functions = wp_doc_link_parse( $content ); $docs_select = ' +
      @@ -208,7 +212,7 @@ if ($allowed_files) :
      - +

      "; @@ -218,7 +222,7 @@ if ($allowed_files) :

      the Codex for more information.'); ?>

      - +

      ' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

      '; @@ -226,6 +230,14 @@ if ($allowed_files) : ?>
      + -

      +

      screenshot ) : ?> -<?php _e('Current theme preview'); ?> +<?php _e('Current theme preview'); ?>

      title, $ct->version, $ct->author) ; ?>

      description; ?>

      parent_theme) { ?> -

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?>

      +

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?>

      -

      %2$s.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?>

      +

      %2$s.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ) ); ?>

      tags ) : ?>

      tags); ?>

      @@ -203,6 +203,8 @@ foreach ( $cols as $col => $theme_name ) { $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir']; $template_dir = $themes[$theme_name]['Template Dir']; $parent_theme = $themes[$theme_name]['Parent Theme']; + $theme_root = $themes[$theme_name]['Theme Root']; + $theme_root_uri = $themes[$theme_name]['Theme Root URI']; $preview_link = esc_url(get_option('home') . '/'); if ( is_ssl() ) $preview_link = str_replace( 'http://', 'https://', $preview_link ); @@ -223,7 +225,7 @@ foreach ( $cols as $col => $theme_name ) { ?> - +

      $theme_name ) { -

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $title, $template_dir, $stylesheet_dir, $title, $parent_theme); ?>

      +

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?>

      -

      %2$s.'), $title, $template_dir, $stylesheet_dir); ?>

      +

      %2$s.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?>

      @@ -270,7 +272,7 @@ if ( count($broken_themes) ) {

      - +
      diff --git a/wp-admin/tools.php b/wp-admin/tools.php index aa953ef8..e7145f33 100644 --- a/wp-admin/tools.php +++ b/wp-admin/tools.php @@ -14,9 +14,9 @@ wp_enqueue_script( 'wp-gears' ); require_once('admin-header.php'); -screen_icon(); ?>
      +

      diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 5bd44c7a..ed24f180 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -95,12 +95,20 @@ function dismissed_updates() { * @return null */ function core_upgrade_preamble() { + global $upgrade_error; + $updates = get_core_updates(); ?>

      '; + _e('Please select one or more plugins to upgrade.'); + echo '

      '; + } + if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) { echo '

      '; _e('You have the latest version of WordPress. You do not need to upgrade'); @@ -126,9 +134,125 @@ function core_upgrade_preamble() { } echo ''; dismissed_updates(); + + list_plugin_updates(); + //list_theme_updates(); + do_action('core_upgrade_preamble'); echo '

      '; } +function list_plugin_updates() { + global $wp_version; + + $cur_wp_version = preg_replace('/-.*$/', '', $wp_version); + + require_once(ABSPATH . 'wp-admin/includes/plugin-install.php'); + $plugins = get_plugin_updates(); + if ( empty($plugins) ) + return; + $form_action = 'update-core.php?action=do-plugin-upgrade'; + + $core_updates = get_core_updates(); + if ( !isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response ) + $core_update_version = false; + else + $core_update_version = $core_updates[0]->current; + ?> +

      +

      +
      + +

      +
      + + + + + + + + + + + + + + + $plugin_data) { + $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug )); + // Get plugin compat for running version of WordPress. + if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) { + $compat = '
      ' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version); + } elseif ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) { + $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version]; + $compat = '
      ' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]); + } else { + $compat = '
      ' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version); + } + // Get plugin compat for updated version of WordPress. + if ( $core_update_version ) { + if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) { + $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version]; + $compat .= '
      ' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]); + } else { + $compat .= '
      ' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version); + } + } + // Get the upgrade notice for the new plugin version. + if ( isset($plugin_data->update->upgrade_notice) ) { + $upgrade_notice = '
      ' . strip_tags($plugin_data->update->upgrade_notice); + } else { + $upgrade_notice = ''; + } + echo " + + + + "; + } +?> + +
      {$plugin_data->Name}" . sprintf(__('You are running version %1$s. Upgrade to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "
      +

      + + +

      + + + + + + + + + + + + + + + + $theme_data) { + echo " + + + + "; + } +?> + +
      {$theme_data->Name}
      +bulk_upgrade($plugins); +} + $action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core'; +$upgrade_error = false; +if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) { + $upgrade_error = true; + $action = 'upgrade-core'; +} + +$title = __('Upgrade WordPress'); +$parent_file = 'tools.php'; + if ( 'upgrade-core' == $action ) { wp_version_check(); - $title = __('Upgrade WordPress'); - $parent_file = 'tools.php'; require_once('admin-header.php'); core_upgrade_preamble(); - include('admin-footer.php'); } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { check_admin_referer('upgrade-core'); - $title = __('Upgrade WordPress'); - $parent_file = 'tools.php'; // do the (un)dismiss actions before headers, // so that they can redirect if ( isset( $_POST['dismiss'] ) ) @@ -232,6 +382,10 @@ if ( 'upgrade-core' == $action ) { $reinstall = false; if ( isset( $_POST['upgrade'] ) ) do_core_upgrade($reinstall); - include('admin-footer.php'); +} elseif ( 'do-plugin-upgrade' == $action ) { + check_admin_referer('upgrade-core'); + require_once('admin-header.php'); + do_plugin_upgrade(); +} -}?> +include('admin-footer.php'); diff --git a/wp-admin/update-links.php b/wp-admin/update-links.php index 7b364165..f7f5c527 100644 --- a/wp-admin/update-links.php +++ b/wp-admin/update-links.php @@ -50,7 +50,7 @@ $returns = explode("\n", $body); foreach ($returns as $return) { $time = substr($return, 0, 19); $uri = preg_replace('/(.*?) | (.*?)/', '$2', $return); - $wdpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) ); + $wpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) ); } ?> diff --git a/wp-admin/update.php b/wp-admin/update.php index f05de5df..304c81f8 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -52,7 +52,12 @@ if ( isset($_GET['action']) ) { if( isset($_GET['failure']) ){ echo '

      ' . __('Plugin failed to reactivate due to a fatal error.') . '

      '; - error_reporting( E_ALL ^ E_NOTICE ); + + if ( defined('E_RECOVERABLE_ERROR') ) + error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); + else + error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); + @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. include(WP_PLUGIN_DIR . '/' . $plugin); } diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php index 7c093d1c..4c27b605 100644 --- a/wp-admin/upgrade.php +++ b/wp-admin/upgrade.php @@ -68,7 +68,7 @@ switch ( $step ) : break; case 1: wp_upgrade(); - + $backto = empty($_GET['backto']) ? '' : $_GET['backto'] ; $backto = stripslashes( urldecode( $backto ) ); $backto = esc_url_raw( $backto ); diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 61e1d16e..2b891e13 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -11,13 +11,13 @@ require_once('admin.php'); wp_enqueue_script( 'wp-ajax-response' ); wp_enqueue_script( 'jquery-ui-draggable' ); -if (!current_user_can('upload_files')) +if ( !current_user_can('upload_files') ) wp_die(__('You do not have permission to upload files.')); -if ( isset($_GET['find_detached'] ) ) { +if ( isset($_GET['find_detached']) ) { check_admin_referer('bulk-media'); - if ( ! current_user_can('edit_posts') ) + if ( !current_user_can('edit_posts') ) wp_die( __('You are not allowed to scan for lost attachments.') ); $all_posts = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'post' OR post_type = 'page'"); @@ -62,38 +62,65 @@ if ( isset($_GET['find_detached'] ) ) { $location = $referer; } - $location = add_query_arg( array( 'detached' => 1, 'attached' => $attached ) , $location ); + $location = add_query_arg( array( 'attached' => $attached ) , $location ); wp_redirect($location); exit; } -} elseif ( isset($_GET['action']) && isset($_GET['media']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { +} elseif ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { check_admin_referer('bulk-media'); - $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; - if ( 'delete' == $doaction ) { - foreach( (array) $_GET['media'] as $post_id_del ) { - $post_del = & get_post($post_id_del); - - if ( !current_user_can('delete_post', $post_id_del) ) - wp_die( __('You are not allowed to delete this post.') ); + if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { + $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" ); + $doaction = 'delete'; + } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['media']) || isset($_GET['ids']) ) ) { + $post_ids = isset($_GET['media']) ? $_GET['media'] : explode(',', $_GET['ids']); + $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; + } else { + wp_redirect($_SERVER['HTTP_REFERER']); + } - if ( $post_del->post_type == 'attachment' ) - if ( ! wp_delete_attachment($post_id_del) ) - wp_die( __('Error in deleting...') ); - } + $location = 'upload.php'; + if ( $referer = wp_get_referer() ) { + if ( false !== strpos($referer, 'upload.php') ) + $location = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted'), $referer ); + } - $location = 'upload.php'; - if ( $referer = wp_get_referer() ) { - if ( false !== strpos($referer, 'upload.php') ) - $location = $referer; - } + switch ( $doaction ) { + case 'trash': + foreach( (array) $post_ids as $post_id ) { + if ( !current_user_can('delete_post', $post_id) ) + wp_die( __('You are not allowed to move this post to the trash.') ); - $location = add_query_arg('message', 2, $location); - $location = remove_query_arg('posted', $location); - wp_redirect($location); - exit; + if ( !wp_trash_post($post_id) ) + wp_die( __('Error in moving to trash...') ); + } + $location = add_query_arg( array( 'message' => 4, 'ids' => join(',', $post_ids) ), $location ); + break; + case 'untrash': + foreach( (array) $post_ids as $post_id ) { + if ( !current_user_can('delete_post', $post_id) ) + wp_die( __('You are not allowed to move this post out of the trash.') ); + + if ( !wp_untrash_post($post_id) ) + wp_die( __('Error in restoring from trash...') ); + } + $location = add_query_arg('message', 5, $location); + break; + case 'delete': + foreach( (array) $post_ids as $post_id_del ) { + if ( !current_user_can('delete_post', $post_id_del) ) + wp_die( __('You are not allowed to delete this post.') ); + + if ( !wp_delete_attachment($post_id_del) ) + wp_die( __('Error in deleting...') ); + } + $location = add_query_arg('message', 2, $location); + break; } + + wp_redirect($location); + exit; } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); exit; @@ -107,25 +134,24 @@ if ( ! isset( $_GET['paged'] ) || $_GET['paged'] < 1 ) if ( isset($_GET['detached']) ) { + $media_per_page = (int) get_user_option( 'upload_per_page', 0, false ); + if ( empty($media_per_page) || $media_per_page < 1 ) + $media_per_page = 20; + $media_per_page = apply_filters( 'upload_per_page', $media_per_page ); + if ( !empty($lost) ) { - $start = ( $_GET['paged'] - 1 ) * 50; - $page_links_total = ceil(count($lost) / 50); + $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page; + $page_links_total = ceil(count($lost) / $media_per_page); $lost = implode(',', $lost); - $orphans = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN ($lost) LIMIT $start, 50" ); + $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN (%s) LIMIT %d, %d", $lost, $start, $media_per_page ) ); } else { - $start = ( $_GET['paged'] - 1 ) * 25; - $orphans = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent < 1 LIMIT $start, 25" ); - $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / 25); + $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page; + $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ) ); + $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / $media_per_page); } - $post_mime_types = array( - 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')), - 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')), - 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')), - ); - $post_mime_types = apply_filters('post_mime_types', $post_mime_types); - + $post_mime_types = get_post_mime_types(); $avail_post_mime_types = get_available_post_mime_types('attachment'); if ( isset($_GET['post_mime_type']) && !array_intersect( (array) $_GET['post_mime_type'], array_keys($post_mime_types) ) ) @@ -135,10 +161,23 @@ if ( isset($_GET['detached']) ) { list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); } +$is_trash = ( isset($_GET['status']) && $_GET['status'] == 'trash' ); + wp_enqueue_script('media'); -require_once('admin-header.php'); ?> +require_once('admin-header.php'); + +do_action('restrict_manage_posts'); +?> + +
      + +

      ' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?> +

      ' . __('Undo') . ''; +$messages[5] = __('Media restored from the trash.'); if ( isset($_GET['message']) && (int) $_GET['message'] ) { $message = $messages[$_GET['message']]; $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); } -?> - - - -
      - -

      ' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?> -

      - +if ( !empty($message) ) { ?>

      - +

      +
      diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 6736e1c8..b3ecb63a 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -122,7 +122,7 @@ include ('admin-header.php');

      -
      + @@ -267,20 +267,16 @@ else + $desc) { +?> - - - - - - - - - - - - + + +

      @@ -288,7 +284,7 @@ else - @@ -315,16 +311,17 @@ if ( $show_password_fields ) : } ?> -caps) > count($profileuser->roles) && apply_filters('additional_capabilities_display', true, $profileuser)): ?> +caps) > count($profileuser->roles) && apply_filters('additional_capabilities_display', true, $profileuser) ) { ?>

      +

      caps as $cap => $value) { - if(!$wp_roles->is_role($cap)) { - if($output != '') $output .= ', '; + foreach ( $profileuser->caps as $cap => $value ) { + if ( !$wp_roles->is_role($cap) ) { + if ( $output != '' ) + $output .= ', '; $output .= $value ? $cap : "Denied: {$cap}"; } } @@ -332,7 +329,7 @@ if ( $show_password_fields ) : ?>
      - +

      diff --git a/wp-admin/users.php b/wp-admin/users.php index 758a5927..d11ee53d 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -239,7 +239,7 @@ if ( ! empty($messages) ) {

      -

      ' . __('Search results for “%s”') . '', esc_html( $_GET['usersearch'] ) ); ?>

      @@ -385,14 +385,6 @@ foreach ( $wp_user_search->get_results() as $userid ) {
      - 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) { - $var = 'new_' . $var; - $$var = isset($_REQUEST[$formpost]) ? esc_attr(stripslashes($_REQUEST[$formpost])) : ''; - } - unset($name); -?> -
      __('Inactive Widgets'), 'id' => 'wp_inactive_widgets', + 'description' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', @@ -252,13 +263,15 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {

      - $sbvalue ) { + $sbvalue ) { echo "\t\t
      "; if ( 'wp_inactive_widgets' == $sbname ) { echo ' '; } else { if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) { $j = 1; + $sidebars_widgets[$sbname] = array(); } else { $j = count($sidebars_widgets[$sbname]); if ( isset($_GET['addnew']) || !in_array($widget_id, $sidebars_widgets[$sbname], true) ) @@ -283,7 +296,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { - + @@ -300,15 +313,6 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { exit; } -$widgets_access = get_user_setting( 'widgets_access' ); -if ( isset($_GET['widgets-access']) ) { - $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off'; - set_user_setting( 'widgets_access', $widgets_access ); -} - -if ( 'on' == $widgets_access ) - add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') ); - $messages = array( __('Changes saved.') ); diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index aaa6757e..8d97c41e 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -1,3301 +1 @@ -textarea, -input, -select { - border-width: 1px; - border-style: solid; - -moz-border-radius: 4px; - -khtml-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; -} - -input[type="checkbox"], -input[type="radio"], -input[type="image"] { - border: 0 none; -} - -p, -ul, -ol, -blockquote, -input, -select { - font-size: 12px; -} - -select option { - padding: 2px; -} - -.plugins .name, -#pass-strength-result.strong, -#pass-strength-result.short, -.button-highlighted, -#quicktags #ed_strong, -#ed_reply_toolbar #ed_reply_strong { - font-weight: bold; -} - -.plugins p { - margin: 0 4px; - padding: 0; -} - -.plugins .desc p { - margin: 0 0 8px; -} - -.plugins td.desc { - line-height: 1.5em; -} - -.plugins .desc ul, -.plugins .desc ol { - margin: 0 0 0 2em; -} - -.plugins .desc ul { - list-style-type: disc; -} - -.plugins .action-links { - white-space: nowrap; -} - -.plugins .row-actions-visible { - padding: 0; -} - -.widefat tbody.plugins th.check-column { - padding: 7px 0; -} - -.widefat .plugins td, -.widefat .plugins th { - border-bottom: 0 none; -} - -#install-plugins .plugins td, -#install-plugins .plugins th { - border-bottom-style: solid; - border-bottom-width: 1px; -} - -.plugins .inactive td, -.plugins .inactive th, -.plugins .active td, -.plugins .active th { - border-top-style: solid; - border-top-width: 1px; - padding: 5px 7px 0; -} - -#wpbody-content .plugins .plugin-title { - padding-right: 12px; -} - -.plugins .second td, -.plugins .second th { - border-top: 0 none; - padding: 0 7px 5px; -} - -.plugins-php .widefat tfoot th, -.plugins-php .widefat tfoot td { - border-top-style: solid; - border-top-width: 1px; -} - -.import-system { - font-size: 16px; -} - -.anchors { - margin: 10px 20px 10px 20px; -} - -table#availablethemes { - border-spacing: 0; - border-width: 1px 0; - border-style: solid none; - margin: 10px auto; - width: 100%; -} - -td.available-theme { - vertical-align: top; - width: 240px; - margin: 0; - padding: 20px; - text-align: left; -} - -table#availablethemes td { - border-width: 0 1px 1px; - border-style: none solid solid; -} - -table#availablethemes td.right, -table#availablethemes td.left { - border-right: 0 none; - border-left: 0 none; -} - -table#availablethemes td.bottom { - border-bottom: 0 none; -} - -.available-theme a.screenshot { - width: 240px; - height: 180px; - display: block; - border-width: 1px; - border-style: solid; - margin-bottom: 10px; - overflow: hidden; -} - -.available-theme img { - width: 240px; -} - -.available-theme h3 { - margin: 15px 0 5px; -} - -#current-theme { - margin: 1em 0 1.5em; -} - -#current-theme a { - border-bottom: none; -} - -#current-theme h3 { - font-size: 17px; - font-weight: normal; - margin: 0; -} - -#current-theme .theme-description { - margin-top: 5px; -} - -#current-theme img { - float: left; - border-width: 1px; - border-style: solid; - margin-right: 1em; - margin-bottom: 1.5em; - width: 150px; -} - -#TB_window #TB_title a.tb-theme-preview-link, -#TB_window #TB_title a.tb-theme-preview-link:visited { - font-weight: bold; - text-decoration: none; -} - -#TB_window #TB_title { - background-color: #222; - color: #cfcfcf; -} - -.checkbox { - border: none; - margin: 0; - padding: 0; -} - -.code, code { - font-family: Consolas, Monaco, Courier, monospace; -} - -kbd, code { - padding: 1px 3px; - margin: 0 1px; - font-size: 11px; -} - -.commentlist li { - padding: 1em 1em .2em; - margin: 0; - border-bottom-width: 1px; - border-bottom-style: solid; -} - -.commentlist li li { - border-bottom: 0; - padding: 0; -} - -.commentlist p { - padding: 0; - margin: 0 0 .8em; -} - -.post-categories { - display: inline; - margin: 0; - padding: 0; -} - -.post-categories li { - display: inline; -} - -.quicktags, .search { - font: 12px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; -} - -.submit { - padding: 1.5em 0; - margin: 5px 0; - -moz-border-radius: 0 0 3px 3px; - -webkit-border-bottom-left-radius: 3px; - -webkit-border-bottom-right-radius: 3px; - -khtml-border-bottom-left-radius: 3px; - -khtml-border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; - border-bottom-right-radius: 3px; -} - -form p.submit a.cancel:hover { - text-decoration: none; -} - -#submitdiv h3, -#pagesubmitdiv h3 { - margin-bottom: 0 !important; -} - -#misc-publishing-actions { - padding: 6px 0 16px 0; -} - -.misc-pub-section { - padding: 6px; - border-bottom-width: 1px; - border-bottom-style: solid; -} - -.misc-pub-section-last { - border-bottom: 0 none; -} - -#minor-publishing-actions { - padding: 6px; - text-align: right; -} - -#minor-publishing { - border-bottom-width: 1px; - border-bottom-style: solid; -} - -#save-post { - float: left; -} - -.preview { - float: right; -} - -#major-publishing-actions { - padding: 6px; - clear: both; - border-top: none; -} - -#minor-publishing-actions input, -#major-publishing-actions input, -#minor-publishing-actions .preview { - min-width: 80px; - text-align: center; -} - -#delete-action { - line-height: 25px; - vertical-align: middle; - text-align: left; - float: left; -} - -#publishing-action { - text-align: right; - float: right; -} - -#post-body #minor-publishing { - padding-bottom: 10px; -} - -#post-body #misc-publishing-actions { - padding: 0; -} - -#post-body .misc-pub-section { - border-right-width: 1px; - border-right-style: solid; - border-bottom: 0 none; - min-height: 30px; - float: left; - max-width: 32%; -} - -#post-body .misc-pub-section-last { - border-right: 0; -} - -#sticky-span { - margin-left: 18px; -} - -#post-status-display, -#post-visibility-display { - font-weight: bold; -} - -.side-info { - margin: 0; - padding: 4px; - font-size: 11px; -} - -.side-info h5 { - padding-bottom: 7px; - font-size: 14px; - margin: 12px 2px 5px; - border-bottom-width: 1px; - border-bottom-style: solid; -} - -.side-info ul { - margin: 0; - padding-left: 18px; - list-style: square; -} - -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - text-decoration: none; - font-size: 11px !important; - line-height: 16px; - padding: 2px 8px; - cursor: pointer; - border-width: 1px; - border-style: solid; - -moz-border-radius: 11px; - -khtml-border-radius: 11px; - -webkit-border-radius: 11px; - border-radius: 11px; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - -khtml-box-sizing: content-box; - box-sizing: content-box; -} - -a.button, -a.button-primary, -a.button-secondary { - line-height: 1.2em; - -webkit-border-radius: 10px; - padding: 4px 10px; - white-space: nowrap; -} - -#doaction, -#doaction2 { - margin-right: 8px; -} - -.tablenav select[name="action"], -.tablenav select[name="action2"] { - width: 120px; -} - -.tablenav select[name="m"] { - width: 120px; -} - -.tablenav select#cat { - width: 150px; -} - -#wpcontent select { - padding: 2px; - height: 2em; - font-size: 11px; -} - -#wpcontent option { - padding: 2px; -} - -#timezone_string option { - margin-left: 1em; -} - -.approve { - display: none; -} - -.unapproved .approve, .spam .approve { - display: inline; -} - -.unapproved .unapprove { - display: none; -} - -.narrow { - width: 70%; - margin-bottom: 40px; -} - -.narrow p { - line-height: 150%; -} - -textarea.all-options, input.all-options { - width: 250px; -} - -#namediv table { - width: 100%; -} - -#namediv td.first { - width: 10px; - white-space: nowrap; -} - -#namediv input { - width: 98%; -} - -#namediv p { - margin: 10px 0; -} - -#wpbody-content .metabox-holder { - padding-top: 10px; -} - -#content { - margin: 0; - width: 100%; -} - -#editorcontainer #content { - padding: 6px; - line-height: 150%; - border: 0 none; - outline: none; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -khtml-box-sizing: border-box; - box-sizing: border-box; -} - -#editorcontainer, -#quicktags { - border-style: solid; - border-width: 1px; - border-collapse: separate; - -moz-border-radius: 6px 6px 0 0; - -webkit-border-top-right-radius: 6px; - -webkit-border-top-left-radius: 6px; - -khtml-border-top-right-radius: 6px; - -khtml-border-top-left-radius: 6px; - border-top-right-radius: 6px; - border-top-left-radius: 6px; -} - -#quicktags { - padding: 0; - margin-bottom: -3px; - border-bottom-width: 3px; - background-image: url("images/ed-bg.gif"); - background-position: left top; - background-repeat: repeat-x; -} - -#quicktags #ed_toolbar { - padding: 2px 4px 0; -} - -#ed_toolbar input, -#ed_reply_toolbar input { - margin: 3px 1px 4px; - line-height: 18px; - display: inline-block; - min-width: 26px; - padding: 2px 4px; - font-size: 12px; -} - -#ed_reply_toolbar input { - margin: 1px 2px 1px 1px; -} - -#quicktags #ed_link, -#ed_reply_toolbar #ed_reply_link { - text-decoration: underline; -} - -#quicktags #ed_del, -#ed_reply_toolbar #ed_reply_del { - text-decoration: line-through; -} - -#quicktags #ed_em, -#ed_reply_toolbar #ed_reply_em { - font-style: italic; -} - -#excerpt, .attachmentlinks { - margin: 0; - height: 4em; - width: 98%; -} - -/* post meta postbox */ -#postcustomstuff table, -#postcustomstuff input, -#postcustomstuff textarea { - border-width: 1px; - border-style: solid; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -#postcustomstuff .updatemeta, -#postcustomstuff .deletemeta { - margin: auto; -} - -#postcustomstuff thead th { - padding: 5px 8px 8px; -} - -#postcustom #postcustomstuff .submit, -#pagecustomdiv #postcustomstuff .submit { - border: 0 none; - float: none; - padding: 5px 8px; -} - -#side-sortables #postcustom #postcustomstuff .submit, -#side-sortables #pagecustomdiv #postcustomstuff .submit { - padding: 0 5px; -} - -#side-sortables #postcustom #postcustomstuff td.left input, -#side-sortables #pagecustomdiv #postcustomstuff td.left input { - margin: 3px 3px 0; -} - -#side-sortables #postcustom #postcustomstuff #the-list textarea, -#side-sortables #pagecustomdiv #postcustomstuff #the-list textarea { - height: 85px; - margin: 3px; -} - -#postcustomstuff table { - margin: 0; - width: 100%; - border-width: 1px; - border-style: solid; - border-spacing: 0; -} - -#postcustomstuff table input, -#postcustomstuff table select, -#postcustomstuff table textarea { - width: 95%; - margin: 8px 0 8px 8px; -} - -#postcustomstuff th.left, -#postcustomstuff td.left { - width: 38%; -} - -#postcustomstuff .submit input { - width: auto; -} - -#postcustomstuff #newmeta .submit { - padding: 0 8px; -} - -#postcustomstuff table #addmetasub { - width: auto; -} - -#postcustomstuff #newmetaleft { - vertical-align: top; -} - -#postcustomstuff #newmetaleft a { - padding: 0 10px; - text-decoration: none; -} - -#save { - width: 15em; -} - -#template div { - margin-right: 190px; -} - -* html #template div { - margin-right: 0; -} - -/* A handy div class for hiding controls. -Some browsers will disable them when you -set display: none; */ -.zerosize { - height: 0; - width: 0; - margin: 0; - border: 0; - padding: 0; - overflow: hidden; - position: absolute; -} - -* html #themeselect { - padding: 0 3px; - height: 22px; -} - -#your-profile legend { - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-size: 22px; -} - -#your-profile #rich_editing { - border: none; -} - -#howto { - font-size: 11px; - margin: 0 5px; - display: block; -} - -#ajax-response.alignleft { - margin-left: 2em; -} - -div.nav { - height: 2em; - padding: 7px 10px; - vertical-align: text-top; - margin: 5px 0; -} - -.nav .button-secondary { - padding: 2px 4px; -} - -a.page-numbers { - border-bottom-style: solid; - border-bottom-width: 2px; - font-weight: bold; - margin-right: 1px; - padding: 0 2px; -} - -p.pagenav { - margin: 0; - display: inline; -} - -.pagenav span { - font-weight: bold; - margin: 0 6px; -} - -.row-title { - font-size: 12px !important; - font-weight: bold; -} - -.column-comment p { - margin: 0.6em 0; -} - -.column-author img, .column-username img { - float: left; - margin-right: 10px; - margin-top: 3px; -} - -.tablenav a.button-secondary { - display: block; - margin: 3px 8px 0 0; -} - -.tablenav { - clear: both; - height: 30px; - margin: 6px 0 4px; - vertical-align: middle; -} - -.tablenav .tablenav-pages { - float: right; - display: block; - cursor: default; - height: 30px; - line-height: 30px; - font-size: 11px; -} - -.tablenav .tablenav-pages a, -.tablenav-pages span.current { - text-decoration: none; - border: none; - padding: 3px 6px; - border-width: 1px; - border-style: solid; - -moz-border-radius: 5px; - -khtml-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} - -.tablenav .displaying-num { - margin-right: 10px; - font-size: 12px; - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-style: italic; -} - -.tablenav .actions { - padding: 2px 8px 0 0; -} - -td.media-icon { - vertical-align: middle; - text-align: center; - width: 80px; -} - -td.media-icon img { - max-width: 80px; - max-height: 60px; -} - -#update-nag { - line-height: 29px; - font-size: 12px; - text-align: center; -} - -#update-nag { - border-width: 1px 0; - border-style: solid none; -} - -.plugins .plugin-update { - padding: 0; -} - -.plugin-update .update-message { - margin: 0 10px 8px 31px; - font-weight: bold; -} - -#pass-strength-result { - border-style: solid; - border-width: 1px; - float: left; - margin: 12px 5px 5px 1px; - padding: 3px 5px; - text-align: center; - width: 200px; -} - -.row-actions { - visibility: hidden; - padding: 2px 0 0; -} - -tr:hover .row-actions, -div.comment-item:hover .row-actions { - visibility: visible; -} - -.row-actions-visible { - padding: 2px 0 0; - cursor: pointer; -} - -/* Admin Header */ -#wphead-info { - margin: 0 0 0 15px; - padding-right: 15px; -} - -#user_info { - float: right; - font-size: 12px; - line-height: 46px; - height: 46px; -} - -#user_info p { - margin: 0; - padding: 0; - line-height: 46px; -} - -#wphead { - height: 46px; -} - -#wphead a, -#adminmenu a, -#sidemenu a, -#taglist a, -#catlist a, -#show-settings a { - text-decoration: none; -} - -#header-logo { - float: left; - margin: 7px 0 0 15px; -} - -#wphead h1 { - font: normal 22px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - padding: 10px 8px 5px; - margin: 0; - float: left; -} - -#wphead h1.long-title { - font: normal 18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - padding: 12px 10px 5px; -} - -#wphead #site-visit-button { - background-repeat:repeat-x; - background-position:0 0; - -moz-border-radius:3px; - -webkit-border-radius:3px; - -khtml-border-radius:3px; - border-radius:3px; - cursor:pointer; /* to keep IE happy */ - display:-moz-inline-stack; /* to keep FF2 happy */ - display:inline-block; - font-size: 50%; - font-style:normal; - line-height:17px; - margin-left:5px; - padding:0 6px; - vertical-align:middle; -} - -#wphead h1 a:hover { - text-decoration:none; -} -#wphead h1 a:hover #site-title { - text-decoration:underline; -} - -/* side admin menu */ -#adminmenu * { - -webkit-user-select: none; - -moz-user-select: none; - -khtml-user-select: none; - user-select: none; -} - -#adminmenu .wp-submenu { - display: none; - list-style: none; - padding: 0; - margin: 0; - position: relative; - z-index: 2; - border-width: 1px 0 0; - border-style: solid none none; -} - -#adminmenu .wp-submenu a { - font: normal 11px/18px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; -} - -#adminmenu .wp-submenu li.current, -#adminmenu .wp-submenu li.current a, -#adminmenu .wp-submenu li.current a:hover { - font-weight: bold; -} - -#adminmenu a.menu-top, -#adminmenu .wp-submenu-head { - font: normal 13px/18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; -} - -#adminmenu div.wp-submenu-head { - display: none; -} - -.folded #adminmenu div.wp-submenu-head, -.folded #adminmenu li.wp-has-submenu div.sub-open { - display: block; -} - -.folded #adminmenu a.menu-top, -.folded #adminmenu .wp-submenu, -.folded #adminmenu li.wp-menu-open .wp-submenu, -.folded #adminmenu div.wp-menu-toggle { - display: none; -} - -#adminmenu li.wp-menu-open .wp-submenu, -.no-js #adminmenu .open-if-no-js .wp-submenu { - display: block; -} - -#adminmenu div.wp-menu-image { - float: left; - width: 28px; - height: 28px; -} - -#adminmenu li { - margin: 0; - padding: 0; - cursor: pointer; -} - -#adminmenu a { - display: block; - line-height: 18px; - padding: 1px 5px 3px; -} - -#adminmenu li.menu-top { - min-height: 26px; -} - -#adminmenu a.menu-top { - line-height: 18px; - min-width: 10em; - padding: 5px 5px; - border-width: 1px 1px 0; - border-style: solid solid none; -} - -#adminmenu .wp-submenu a { - margin: 0; - padding-left: 12px; - border-width: 0 1px 0 0; - border-style: none solid none none; -} - -#adminmenu .menu-top-last ul.wp-submenu { - border-width: 0 0 1px; - border-style: none none solid; -} - -#adminmenu .wp-submenu li { - padding: 0; - margin: 0; -} - -.folded #adminmenu li.menu-top { - width: 28px; - height: 30px; - overflow: hidden; - border-width: 1px 1px 0; - border-style: solid solid none; -} - -#adminmenu .menu-top-first a.menu-top, -.folded #adminmenu li.menu-top-first, -#adminmenu .wp-submenu .wp-submenu-head { - border-width: 1px 1px 0; - border-style: solid solid none; - -moz-border-radius-topleft :6px; - -moz-border-radius-topright: 6px; - -webkit-border-top-right-radius: 6px; - -webkit-border-top-left-radius: 6px; - -khtml-border-top-right-radius: 6px; - -khtml-border-top-left-radius: 6px; - border-top-right-radius: 6px; - border-top-left-radius: 6px; -} - -#adminmenu .menu-top-last a.menu-top, -.folded #adminmenu li.menu-top-last { - border-width: 1px; - border-style: solid; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-bottomright: 6px; - -webkit-border-bottom-right-radius: 6px; - -webkit-border-bottom-left-radius: 6px; - -khtml-border-bottom-right-radius: 6px; - -khtml-border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; - border-bottom-left-radius: 6px; -} - -#adminmenu li.wp-menu-open a.menu-top-last { - border-bottom: 0 none; - -moz-border-radius-bottomright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -khtml-border-bottom-right-radius: 0; - -khtml-border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} - -#adminmenu img.wp-menu-image { - float: left; - padding: 8px 6px 0; - opacity: 0.6; - filter: alpha(opacity=60); -} - -#adminmenu li.menu-top:hover img.wp-menu-image, -#adminmenu li.wp-has-current-submenu img.wp-menu-image { - opacity: 1; - filter: alpha(opacity=100); -} - -.folded #adminmenu img.wp-menu-image { - padding: 7px 0 0 6px; -} - -#adminmenu li.wp-menu-separator { - height: 21px; - padding: 0; - margin: 0; -} - -#adminmenu a.separator { - cursor: w-resize; - height: 20px; - padding: 0; -} - -.folded #adminmenu a.separator { - cursor: e-resize; -} - -#adminmenu .wp-menu-separator-last { - height: 10px; - width: 1px; -} - -#adminmenu .wp-submenu .wp-submenu-head { - border-width: 1px; - border-style: solid; - padding: 6px 4px 6px 10px; - cursor: default; -} - -.folded #adminmenu .wp-submenu { - position: absolute; - margin: -1px 0 0 28px; - padding: 0 8px 8px; - z-index: 999; - border: 0 none; -} - -.folded #adminmenu .wp-submenu ul { - width: 140px; - border-width: 0 0 1px; - border-style: none none solid; -} - -.folded #adminmenu .wp-submenu li.wp-first-item { - border-top: 0 none; -} - -.folded #adminmenu .wp-submenu a { - padding-left: 10px; -} - -.folded #adminmenu a.wp-has-submenu { - margin-left: 40px; -} - -#adminmenu li.menu-top-last .wp-submenu ul { - border-width: 0 0 1px; - border-style: none none solid; -} - -#adminmenu .wp-menu-toggle { - width: 22px; - clear: right; - float: right; - margin: 1px 0 0; - height: 27px; - padding: 1px 2px 0 0; - cursor: default; -} - -#adminmenu li.wp-has-current-submenu ul { - border-bottom-width: 1px; - border-bottom-style: solid; -} - -#adminmenu .wp-menu-image a { - height: 24px; -} - -#adminmenu .wp-menu-image img { - padding: 6px 0 0 1px; -} - -/* end side admin menu */ - -/* comments/plugins bubble in menu */ -#adminmenu #awaiting-mod, -#adminmenu span.update-plugins, -#sidemenu li a span.update-plugins { - position: absolute; - font-family: Helvetica, Arial, sans-serif; - font-size: 7pt; - font-weight: bold; - margin-top: 2px; - margin-left: 2px; - -moz-border-radius: 7px; - -khtml-border-radius: 7px; - -webkit-border-radius: 7px; - border-radius: 7px; -} - -#adminmenu li #awaiting-mod span, -#adminmenu li span.update-plugins span, -#sidemenu li a span.update-plugins span { - float: left; - display: block; - height: 1.6em; - line-height: 1.6em; - padding: 0 6px; -} - -#adminmenu li span.count-0, -#sidemenu li a .count-0 { - display: none; -} -/* end menu stuff */ - -/* comments bubble */ -.post-com-count-wrapper { - min-width: 22px; - font-family: Helvetica, Arial, sans-serif; -} - -.post-com-count { - height: 1.3em; - line-height: 1.1em; - display: block; - text-decoration: none; - padding: 0 0 6px; - cursor: pointer; - background-position: center -80px; - background-repeat: no-repeat; -} - -.post-com-count span { - font-size: 9px; - font-weight: bold; - height: 1.7em; - line-height: 1.70em; - min-width: 0.7em; - padding: 0 6px; - display: inline-block; - cursor: pointer; - -moz-border-radius: 5px; - -khtml-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} - -strong .post-com-count { - background-position: center -55px; -} - -.post-com-count:hover { - background-position: center -3px; -} - -.column-response .post-com-count { - float: left; - margin-right: 5px; - text-align: center; -} - -.response-links { - float: left; -} - -#the-comment-list .attachment-80x60 { - padding: 4px 8px; -} - -/* Admin Footer */ -#footer { - margin-top: -45px; -} - -#footer, -#footer a { - font-size: 12px; - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-style: italic; -} - -#footer p { - margin: 0; - padding: 15px; - line-height: 15px; -} - -#footer a { - text-decoration: none; -} - -#footer a:hover { - text-decoration: underline; -} - -/* Tables used on comment.php and option/setting pages */ - -.form-table { - border-collapse: collapse; - margin-top: 0.5em; - width: 100%; - margin-bottom: -8px; - clear: both; -} - -.form-table td, -#wpbody-content .describe td { - margin-bottom: 9px; - padding: 4px 10px 12px; - line-height: 20px; - font-size: 11px; -} - -.form-table th, -.form-wrap label { - font-weight: normal; - text-shadow: rgba(255,255,255,1) 0 1px 0; -} - -.form-table th, -#wpbody-content .describe th { - vertical-align: top; - text-align: left; - padding: 10px; - width: 200px; -} - -.form-table th.th-full { - width: auto; -} - -.form-table input, -.form-table textarea, -#wpbody-content .describe input, -#wpbody-content .describe textarea { - border-width: 1px; - border-style: solid; -} - -.form-table div.color-option { - display: block; - clear: both; - margin-top: 12px; -} - -.form-table input.tog { - margin-top: 2px; - margin-right: 2px; - float: left; -} - -.form-table table.color-palette { - vertical-align: bottom; - float: left; - margin: -12px 3px 11px; -} - -.form-table .color-palette td { - border-width: 1px 1px 0; - border-style: solid solid none; - height: 10px; - line-height: 20px; - width: 10px; -} - -textarea.large-text { - width: 99%; -} - -.form-table input.regular-text, -#adduser .form-field input { - width: 25em; -} - -.form-table input.small-text { - width: 50px; -} - -#profile-page .form-table textarea { - width: 500px; - margin-bottom: 6px; -} - -#profile-page .form-table #rich_editing { - margin-right: 5px -} - -.form-table .pre { - padding: 8px; - margin: 0; -} - -.pre { - /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ -} - -table.form-table td .updated { - font-size: 13px; -} - -/* divs for cats and tags pages */ - -.form-wrap { - margin: 10px 0; - width: 97%; -} - -.form-wrap p, -.form-wrap label { - font-size: 11px; -} - -.form-wrap label { - display: block; - padding: 2px; - font-size: 12px; -} - -.form-field input, -.form-field textarea { - border-style: solid; - border-width: 1px; - width: 95%; -} - -p.description, -.form-wrap p { - margin: 2px 0 5px; -} - -p.help, -p.description, -span.description, -.form-wrap p { - font-size: 12px; - font-style: italic; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; -} - -.form-wrap .form-field { - margin: 0 0 10px; - padding: 8px; -} - -.col-wrap h3 { - margin: 12px 0; - font-size: 1.1em; -} - -.col-wrap p.submit { - margin-top: -10px; -} - -.tagcloud { - width: 97%; - margin: 0 0 40px; - text-align: justify; -} - -.tagcloud h3 { - margin: 2px 0 12px; -} - -/* Post Screen */ -#post-body #normal-sortables { - min-height: 50px; -} - -#post-body #advanced-sortables { - min-height: 20px; -} - -.postbox { - position: relative; - min-width: 255px; - width: 99.5%; -} - -#trackback_url { - width: 99%; -} - -#normal-sortables .postbox .submit { - background: transparent none; - border: 0 none; - float: right; - padding: 0 12px; - margin: 0; -} - -#normal-sortables .postbox #replyrow .submit { - float: none; - margin: 0; - padding: 3px 7px; -} - -#side-sortables .submitbox .submit input, -#side-sortables .submitbox .submit .preview, -#side-sortables .submitbox .submit a.preview:hover { - border: 0 none; -} - -#side-sortables .inside-submitbox .insidebox, -.stuffbox .insidebox { - margin: 11px 0; -} - -#side-sortables .comments-box, -#normal-sortables .comments-box { - border: 0 none; -} - -#side-sortables .comments-box thead th, -#normal-sortables .comments-box thead th { - background: transparent; - padding: 0 7px 4px; - font-style: italic; -} - -#commentsdiv img.waiting { - padding-left: 5px; - vertical-align: middle; -} - -#post-body .tagsdiv #newtag { - margin-right: 5px; - width: 16em; -} - -#side-sortables input#post_password { - width: 94% -} - -#side-sortables .tagsdiv #newtag { - width: 68%; -} - -#post-status-info { - border-width: 0 1px 1px; - border-style: none solid solid; - width: 100%; - -moz-border-radius: 0 0 6px 6px; - -webkit-border-bottom-left-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - -khtml-border-bottom-left-radius: 6px; - -khtml-border-bottom-right-radius: 6px; - border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; -} - -#post-status-info td { - font-size: 11px; -} - -.autosave-info { - padding: 2px 15px 2px 2px; - text-align: right; -} - -#editorcontent #post-status-info { - border: none; -} - -#post-body .wp_themeSkin .mceStatusbar a.mceResize { - display: block; - background: transparent url(images/resize.gif) no-repeat scroll right bottom; - width: 12px; - cursor: se-resize; - margin: 0 2px; - position: relative; - top: 22px; -} - - -#pagesubmitdiv div.inside, -#linksubmitdiv div.inside, - div.inside { - padding: 0; - margin: 0; -} - -#comment-status-radio p { - margin: 3px 0 5px; -} - -#comment-status-radio input { - margin: 2px 3px 5px 0; - vertical-align: middle; -} - -#comment-status-radio label { - padding: 5px 0; -} - -.tagchecklist { - margin-left: 10px; - font-size: 12px; - overflow: auto; -} - -.tagchecklist strong { - margin-left: -8px; - position: absolute; -} - -.tagchecklist span { - margin-right: 25px; - display: block; - float: left; - font-size: 11px; - line-height: 1.8em; - white-space: nowrap; - cursor: default; -} - -.tagchecklist span a { - margin: 6px 0pt 0pt -9px; - cursor: pointer; - width: 10px; - height: 10px; - display: block; - float: left; - text-indent: -9999px; - overflow: hidden; - position: absolute; -} - -.howto { - font-style: italic; - display: block; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; -} - -.ac_results { - padding: 0; - margin: 0; - list-style: none; - position: absolute; - z-index: 10000; - display: none; - border-width: 1px; - border-style: solid; -} - -.ac_results li { - padding: 2px 5px; - white-space: nowrap; - text-align: left; -} - -.ac_over { - cursor: pointer; -} - -.ac_match { - text-decoration: underline; -} - -#poststuff h2 { - margin-top: 20px; - font-size: 1.5em; - margin-bottom: 15px; - padding: 0 0 3px; - clear: left; -} - -.widget .widget-top, -.postbox h3 { - cursor: move; - -webkit-user-select: none; - -moz-user-select: none; - -khtml-user-select: none; - user-select: none; -} - -.postbox .hndle span { - padding: 6px 0; -} - -.postbox .hndle { - cursor: move; -} - -.hndle a { - font-size: 11px; - font-weight: normal; -} - -#dashboard-widgets .meta-box-sortables { - margin: 0 5px; -} - -.postbox .handlediv { - float: right; - width: 23px; - height: 26px; -} - -.sortable-placeholder { - border-width: 1px; - border-style: dashed; - margin-bottom: 20px; -} - -#poststuff h3, -.metabox-holder h3 { - font-size: 12px; - font-weight: bold; - padding: 7px 9px; - margin: 0; - line-height: 1; -} - -.widget, -.postbox, -.stuffbox { - margin-bottom: 20px; - border-width: 1px; - border-style: solid; - line-height: 1; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -.widget .widget-top, -.postbox h3, -.postbox h3, -.stuffbox h3 { - -moz-border-radius: 6px 6px 0 0; - -webkit-border-top-right-radius: 6px; - -webkit-border-top-left-radius: 6px; - -khtml-border-top-right-radius: 6px; - -khtml-border-top-left-radius: 6px; - border-top-right-radius: 6px; - border-top-left-radius: 6px; -} - -.postbox.closed h3 { - -moz-border-radius-bottomleft:4px; - -webkit-border-bottom-left-radius: 4px; - -khtml-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomright:4px; - -webkit-border-bottom-right-radius: 4px; - -khtml-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; -} - -.postbox table.form-table { - margin-bottom: 0; -} - -.postbox input[type="text"], -.postbox textarea, -.stuffbox input[type="text"], -.stuffbox textarea { - border-width: 1px; - border-style: solid; -} - -#poststuff .inside, -#poststuff .inside p { - font-size: 11px; - margin: 6px; -} - -#poststuff .inside .submitbox p { - margin: 1em 0; -} - -#post-visibility-select { - line-height: 1.5em; - margin-top: 3px; -} - -#poststuff #submitdiv .inside { - margin: 0; -} - -#titlediv, #poststuff .postarea { - margin-bottom: 20px; -} - -#titlediv { - margin-bottom: 20px; -} -#titlediv label { cursor: text; } - -#titlediv div.inside { - margin: 0; -} - -#poststuff #titlewrap { - border: 0; - padding: 0; - -} - -#titlediv #title { - padding: 3px 4px; - border-width: 1px; - border-style: solid; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - font-size: 1.7em; - width: 100%; - outline: none; -} - -#poststuff .inside-submitbox, -#side-sortables .inside-submitbox { - margin: 0 3px; - font-size: 11px; -} - -input#link_description, -input#link_url { - width: 98%; -} - -#pending { - background: 0 none; - border: 0 none; - padding: 0; - font-size: 11px; - margin-top: -1px; -} - -#edit-slug-box { - height: 1em; - margin-top: 8px; - padding: 0 7px; -} - -#editable-post-name-full { - display: none; -} - -#editable-post-name input { - width: 16em; -} - -.postarea h3 label { - float: left; -} - -.postarea #add-media-button { - float: right; - margin: 7px 0pt 0pt; - position: relative; - right: 10px; -} - -#poststuff #editor-toolbar { - height: 30px; -} - -.wp_themeSkin tr.mceFirst td.mceToolbar { - border-width: 0 0 1px; - border-style: none none solid; -} - -#edButtonPreview, -#edButtonHTML { - height: 18px; - margin: 5px 5px 0 0; - padding: 4px 5px 2px; - float: right; - cursor: pointer; - border-width: 1px; - border-style: solid; - -moz-border-radius: 3px 3px 0 0; - -webkit-border-top-right-radius: 3px; - -webkit-border-top-left-radius: 3px; - -khtml-border-top-right-radius: 3px; - -khtml-border-top-left-radius: 3px; - border-top-right-radius: 3px; - border-top-left-radius: 3px; -} - -.js .theEditor { - color: white; -} - -#poststuff #edButtonHTML { - margin-right: 15px; -} - -#media-buttons { - cursor: default; - padding: 8px 8px 0; -} - -#media-buttons a { - cursor: pointer; - padding: 0 0 5px 10px; -} - -#media-buttons img { - vertical-align: middle; -} - -.submitbox .submit { - text-align: left; - padding: 12px 10px 10px; - font-size: 11px; -} - -.submitbox .submitdelete { - border-bottom-width: 1px; - border-bottom-style: solid; - text-decoration: none; - padding: 1px 2px; -} - -.inside-submitbox #post_status { - margin: 2px 0 2px -2px; -} - -.submitbox .submit a:hover { - border-bottom-width: 1px; - border-bottom-style: solid; -} - -.submitbox .submit input { - margin-bottom: 8px; - margin-right: 4px; - padding: 6px; -} - -#post-status-select { - line-height: 2.5em; - margin-top: 3px; -} - -/* Categories */ - -#category-adder { - margin-left: 120px; - padding: 4px 0; -} - -#category-adder h4 { - margin: 0 0 8px; -} - -#side-sortables #category-adder { - margin: 0; -} - -#post-body #category-add input, #category-add select { - width: 30%; -} - -#side-sortables #category-add input { - width: 94%; -} - -#side-sortables #category-add select { - width: 100%; -} - -#category-add input#category-add-sumbit { - width: auto; -} - -#post-body ul#category-tabs { - float: left; - width: 120px; - text-align: right; - /* Negative margin for the sake of those without JS: all tabs display */ - margin: 0 -120px 0 5px; - padding: 0; -} - -#post-body ul#category-tabs li { - padding: 8px; -} - -#post-body ul#category-tabs li.tabs { - -moz-border-radius: 3px 0 0 3px; - -webkit-border-top-left-radius: 3px; - -webkit-border-bottom-left-radius: 3px; - -khtml-border-top-left-radius: 3px; - -khtml-border-bottom-left-radius: 3px; - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; -} - -#post-body ul#category-tabs li.tabs a { - font-weight: bold; - text-decoration: none; -} - -#categorydiv div.tabs-panel, -#linkcategorydiv div.tabs-panel { - height: 150px; - overflow: auto; - padding: 0.5em 0.9em; - border-style: solid; - border-width: 1px; -} - -#post-body #categorydiv div.tabs-panel, -#post-body #linkcategorydiv div.tabs-panel { - margin: 0 5px 0 125px; -} - -#side-sortables #category-tabs li { - display: inline; - padding-right: 8px; -} - -#side-sortables #category-tabs a { - text-decoration: none; -} - -#side-sortables #category-tabs { - margin-bottom: 3px; -} - -#categorydiv ul, -#linkcategorydiv ul { - list-style: none; - padding: 0; - margin: 0; -} - -#categorydiv ul.categorychecklist ul, -#linkcategorydiv ul.categorychecklist ul { - margin-left: 18px; -} - -ul.categorychecklist li { - margin: 0; - padding: 0; - line-height: 19px; -} - -#category-adder h4 { - margin-top: 4px; - margin-bottom: 0px; -} - -#categorydiv .tabs-panel { - border-width: 3px; - border-style: solid; -} - -ul#category-tabs { - margin-top: 12px; -} - -ul#category-tabs li.tabs { - border-style: solid solid none; - border-width: 1px 1px 0; -} - -#post-body #category-tabs li.tabs { - border-style: solid none solid solid; - border-width: 1px 0 1px 1px; - margin-right: -1px; -} - -ul#category-tabs li { - padding: 5px 8px; - -moz-border-radius: 3px 3px 0 0; - -webkit-border-top-left-radius: 3px; - -webkit-border-top-right-radius: 3px; - -khtml-border-top-left-radius: 3px; - -khtml-border-top-right-radius: 3px; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} - -/* positioning etc. */ - -form#tags-filter { - position: relative; -} - -p.search-box { - float: right; - margin: -5px 0 0; -} - -.screen-per-page { - width: 3em; -} - -#posts-filter fieldset { - float: left; - margin: 0 1.5ex 1em 0; - padding: 0; -} - -#posts-filter fieldset legend { - padding: 0 0 .2em 1px; -} - -/* Edit posts */ - -td.post-title strong, td.plugin-title strong { - display: block; - margin-bottom: .2em; -} - -td.post-title p, td.plugin-title p { - margin: 6px 0; -} - -td.plugin-title { - white-space: nowrap; -} - -/* Global classes */ - -.wp-hidden-children .wp-hidden-child, -.ui-tabs-hide, -#codepress-off { - display: none; -} - -.commentlist .avatar { - vertical-align: text-top; -} - -.defaultavatarpicker .avatar { - margin: 2px 0; - vertical-align: middle; -} - -body.wp-admin { - min-width: 785px; -} - -.view-switch { - float: right; - margin: 6px 8px 0; -} - -.view-switch a { - text-decoration: none; -} - -.filter { - float: left; - margin: -5px 0 0 10px; -} - -.filter .subsubsub { - margin-left: -10px; - margin-top: 13px; -} - -#the-comment-list td.comment p.comment-author { - margin-top: 0; - margin-left: 0; -} - -#the-comment-list p.comment-author img { - float: left; - margin-right: 8px; -} - -#the-comment-list p.comment-author strong a { - border: none; -} - -#the-comment-list td { - vertical-align: top; -} - -#the-comment-list td.comment { - word-wrap: break-word; -} - -#the-comment-list .check-column { - padding-top: 8px; -} - -#templateside ul li a { - text-decoration: none; -} - -.indicator-hint { - padding-top: 8px; -} - -#display_name { - width: 15em; -} - -.tablenav .delete { - margin-right: 20px; -} - -td.action-links, -th.action-links { - text-align: right; -} - -/* Diff */ - -table.diff { - width: 100%; -} - -table.diff col.content { - width: 50%; -} - -table.diff tr { - background-color: transparent; -} - -table.diff td, table.diff th { - padding: .5em; - font-family: Consolas, Monaco, Courier, monospace; - border: none; -} - -table.diff .diff-deletedline del, table.diff .diff-addedline ins { - text-decoration: none; -} - -#wp-word-count { - display: block; - padding: 2px 7px; -} - -fieldset { - border: 0; - padding: 0; - margin: 0; -} - -.tool-box { - margin: 15px 0 35px; -} - -.tool-box .buttons { - margin: 15px 0; -} - -.tool-box .title { - margin: 8px 0; - font: 18px/24px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; -} - -.pressthis a { - font-size: 1.2em; -} - -#wp_editbtns, -#wp_gallerybtns { - padding: 2px; - position: absolute; - display: none; - z-index: 999998; -} - -#wp_editimgbtn, -#wp_delimgbtn, -#wp_editgallery, -#wp_delgallery { - margin: 2px; - padding: 2px; - border-width: 1px; - border-style: solid; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.settings-toggle { - text-align: right; - margin: 5px 7px 15px 0; - font-size: 12px; -} - -.settings-toggle h3 { - margin: 0; -} - -#timestampdiv select { - height: 20px; - line-height: 20px; - padding: 0; -} - -#jj, #hh, #mn { - width: 2em; - padding: 1px; - font-size: 12px; -} - -#aa { - width: 3.4em; - padding: 1px; - font-size: 12px; -} - -.curtime #timestamp { - background-repeat: no-repeat; - background-position: left top; - padding-left: 18px; -} - -#timestampdiv { - padding-top: 5px; - line-height: 23px; -} - -#timestampdiv p { - margin: 8px 0 6px; -} - -#timestampdiv input { - border-width: 1px; - border-style: solid; -} - -/* media popup 0819 */ -#sidemenu { - margin: -30px 15px 0 315px; - list-style: none; - position: relative; - float: right; - padding-left: 10px; - font-size: 12px; -} - -#sidemenu a { - padding: 0 7px; - display: block; - float: left; - line-height: 28px; - border-top-width: 1px; - border-top-style: solid; - border-bottom-width: 1px; - border-bottom-style: solid; -} - -#sidemenu li { - display: inline; - line-height: 200%; - list-style: none; - text-align: center; - white-space: nowrap; - margin: 0; - padding: 0; -} - -#sidemenu a.current { - font-weight: normal; - padding-left: 6px; - padding-right: 6px; - -moz-border-radius: 4px 4px 0 0; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - -khtml-border-top-left-radius: 4px; - -khtml-border-top-right-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-width: 1px; - border-style: solid; -} - -#sidemenu { - margin: -30px 15px 0 315px; - list-style: none; - position: relative; - float: right; - padding-left: 10px; - font-size: 12px; -} - -#sidemenu a { - padding: 0 7px; - display: block; - float: left; - line-height: 28px; - border-top-width: 1px; - border-top-style: solid; - border-bottom-width: 1px; - border-bottom-style: solid; -} - -#sidemenu li a .count-0 { - display: none; -} - -/* reply to comments */ -#replyrow { - font-size: 11px; -} - -#replyrow input { - border-width: 1px; - border-style: solid; -} - -#replyrow td { - padding: 2px; -} - -#replyrow #editorcontainer { - border: 0 none; -} - -#replysubmit { - margin: 0; - padding: 3px 7px; -} - -#replysubmit img.waiting, -.inline-edit-save img.waiting, -#commentstatusdiv img.waiting { - padding: 0 10px; - vertical-align: top; -} - -#replysubmit .button { - margin-right: 5px; -} - -#replyrow #editor-toolbar { - display: none; -} - -#replyhead { - font-size: 12px; - font-weight: bold; - padding: 2px 10px 4px; -} - -#edithead .inside { - float: left; - padding: 3px 0 2px 5px; - margin: 0; - text-align: center; - font-size: 11px; -} - -#edithead .inside input { - width: 180px; - font-size: 11px; -} - -#edithead label { - padding: 2px 0; -} - -#replycontainer { - padding: 5px; - border: 0 none; - height: 120px; - overflow: hidden; - position: relative; -} - -#replycontent { - resize: none; - margin: 0; - width: 100%; - height: 100%; - padding: 0; - line-height: 150%; - border: 0 none; - outline: none; - font-size: 12px; -} - -#replyrow #ed_reply_toolbar { - margin: 0; - padding: 2px 3px; -} - -/* show/hide settings */ -#screen-meta { - position: relative; - clear: both; -} - -#screen-meta-links { - margin: 0 9px 0 0; -} - -#screen-meta .screen-reader-text { - visibility: hidden; -} - -#screen-options-link-wrap, -#contextual-help-link-wrap { - float: right; - background: transparent url( images/screen-options-left.gif ) no-repeat 0 0; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - height: 22px; - padding: 0; - margin: 0 6px 0 0; -} - -#screen-meta a.show-settings { - text-decoration: none; - z-index: 1; - padding: 0 16px 0 6px; - height: 22px; - line-height: 22px; - font-size: 10px; - display: block; - background-repeat: no-repeat; - background-position: right bottom; -} - -#screen-meta a.show-settings { - background-image: url( images/screen-options-right.gif ); -} - -#screen-meta a.show-settings:hover { - text-decoration: none; -} - -#screen-options-wrap h5, -#contextual-help-wrap h5 { - margin: 8px 0; - font-size: 13px; -} - -#screen-options-wrap, -#contextual-help-wrap { - border-style: none solid solid; - border-top: 0 none; - border-width: 0 1px 1px; - margin: 0 15px; - padding: 8px 12px 12px; - -moz-border-radius: 0 0 0 4px; - -webkit-border-bottom-left-radius: 4px; - -khtml-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; -} - -.metabox-prefs label { - padding-right: 15px; - white-space: nowrap; - line-height: 30px; -} - -.metabox-prefs label input { - margin: 0 5px 0 2px; -} - -.metabox-prefs label a { - display: none; -} - -/* Inline Editor - .quick-edit* is for Quick Edit - .bulk-edit* is for Bulk Edit - .inline-edit* is for everything -*/ -/* Layout */ -tr.inline-edit-row td { - padding: 0 0.5em; -} - -#wpbody-content .inline-edit-row fieldset { - font-size: 12px; - float: left; - margin: 0; - padding: 0; - width: 100%; -} - -#wpbody-content .inline-edit-row fieldset .inline-edit-col { - padding: 0 0.5em; -} - -#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col { - border-width: 0 0 0 1px; - border-style: none none none solid; -} - -#wpbody-content .quick-edit-row-post .inline-edit-col-left { - width: 40%; -} - -#wpbody-content .quick-edit-row-post .inline-edit-col-right { - width: 39%; -} - -#wpbody-content .inline-edit-row-post .inline-edit-col-center { - width: 20%; -} - -#wpbody-content .quick-edit-row-page .inline-edit-col-left { - width: 50%; -} - -#wpbody-content .quick-edit-row-page .inline-edit-col-right, -#wpbody-content .bulk-edit-row-post .inline-edit-col-right { - width: 49%; -} - -#wpbody-content .bulk-edit-row .inline-edit-col-left { - width: 30%; -} - -#wpbody-content .bulk-edit-row-page .inline-edit-col-right { - width: 69%; -} - -#wpbody-content .bulk-edit-row .inline-edit-col-bottom { - float: right; - width: 69%; -} - -#wpbody-content .inline-edit-row-page .inline-edit-col-right, -#owpbody-content .bulk-edit-row-post .inline-edit-col-right { - margin-top: 27px; -} - -.inline-edit-row fieldset .inline-edit-group { - clear: both; -} - -.inline-edit-row fieldset .inline-edit-group:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -.inline-edit-row p.submit { - clear: both; - padding: 0.5em; - margin: 0.5em 0 0; -} - -.inline-edit-row span.error { - line-height: 22px; - margin: 0 15px; - padding: 3px 5px; -} - -/* Positioning */ -.inline-edit-row h4 { - margin: .2em 0; - padding: 0; - line-height: 23px; -} -.inline-edit-row fieldset span.title, -.inline-edit-row fieldset span.checkbox-title { - margin: 0; - padding: 0; - line-height: 27px; -} - -.inline-edit-row fieldset label, -.inline-edit-row fieldset span.inline-edit-categories-label { - display: block; - margin: .2em 0; -} - -.inline-edit-row fieldset label.inline-edit-tags { - margin-top: 0; -} - -.inline-edit-row fieldset label.inline-edit-tags span.title { - margin: .2em 0; -} - -.inline-edit-row fieldset label span.title { - display: block; - float: left; - width: 5em; -} - -.inline-edit-row fieldset label span.input-text-wrap { - display: block; - margin-left: 5em; -} - -.quick-edit-row-post fieldset.inline-edit-col-right label span.title { - width: auto; - padding-right: 0.5em; -} - -.inline-edit-row .input-text-wrap input[type=text] { - width: 100%; -} - -.inline-edit-row fieldset label input[type=checkbox] { - vertical-align: text-bottom; -} - -.inline-edit-row fieldset label textarea { - width: 100%; - height: 4em; -} - -#wpbody-content .bulk-edit-row fieldset .inline-edit-group label { - max-width: 50%; -} - -#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child { - margin-right: 0.5em -} - -/* Styling */ -.inline-edit-row h4 { - text-transform: uppercase; -} - -.inline-edit-row fieldset span.title, -.inline-edit-row fieldset span.checkbox-title { - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-style: italic; - line-height: 1.8em; -} - -/* Specific Elements */ -.inline-edit-row fieldset input[type="text"], -.inline-edit-row fieldset textarea { - border-style: solid; - border-width: 1px; -} - -.inline-edit-row fieldset .inline-edit-date { - float: left; -} - -.inline-edit-row fieldset input[name=jj], -.inline-edit-row fieldset input[name=hh], -.inline-edit-row fieldset input[name=mn] { - font-size: 12px; - width: 2.1em; -} - -.inline-edit-row fieldset input[name=aa] { - font-size: 12px; - width: 3.5em; -} - -.inline-edit-row fieldset label input.inline-edit-password-input { - width: 8em; -} - -.inline-edit-row .catshow, -.inline-edit-row .cathide { - cursor: pointer; -} - -ul.cat-checklist { - height: 12em; - border-style: solid; - border-width: 1px; - overflow-y: scroll; - padding: 0 5px; - margin: 0; -} - -#bulk-titles { - display: block; - height: 12em; - border-style: solid; - border-width: 1px; - overflow-y: scroll; - padding: 0 5px; - margin: 0 0 5px; -} - -.inline-edit-row fieldset ul.cat-checklist li, -.inline-edit-row fieldset ul.cat-checklist input { - margin: 0; -} - -.inline-edit-row fieldset ul.cat-checklist label, -.inline-edit-row .catshow, -.inline-edit-row .cathide, -.inline-edit-row #bulk-titles div { - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - font-style: normal; - font-size: 11px; -} - -table .inline-edit-row fieldset ul.cat-hover { - height: auto; - max-height: 30em; - overflow-y: auto; - position: absolute; -} - -.inline-edit-row fieldset label input.inline-edit-menu-order-input { - width: 3em; -} - -.inline-edit-row fieldset label input.inline-edit-slug-input { - width: 75%; -} - -.quick-edit-row-post fieldset label.inline-edit-status { - float: left; -} - -#bulk-titles { - line-height: 140%; -} -#bulk-titles div { - margin: 0.2em 0.3em; -} - -#bulk-titles div a { - cursor: pointer; - display: block; - float: left; - height: 10px; - margin: 3px 3px 0 -2px; - overflow: hidden; - position: relative; - text-indent: -9999px; - width: 10px; -} - -/* Media library */ -#wpbody-content #media-items .describe { - border-collapse: collapse; - width: 100%; - border-top-style: solid; - border-top-width: 1px; - clear: both; - cursor: default; - padding: 5px; - width: 100%; -} - -#wpbody-content .describe .media-item-info tr { - background-color: transparent; -} - -#wpbody-content .filename { - padding: 0 10px; -} - -#wpbody-content .media-item .thumbnail { - max-height: 128px; - max-width: 128px; -} - -#wpbody-content .media-upload-form label { - display: block; - font-size: 13px; - margin: 0.5em; -} - -abbr.required { - border: medium none; - text-decoration: none; -} - -#wpbody-content .describe input[type="text"], -#wpbody-content .describe textarea { - width: 460px; -} - -#wpbody-content .describe p.help { - margin: 0; - padding: 0 0 0 5px; -} - -.describe-toggle-on, .describe-toggle-off { - display: block; - line-height: 36px; - float: right; - margin-right: 20px; -} - -.describe-toggle-off { - display: none; -} - -#wpbody-content .media-item { - border-bottom-style: solid; - border-bottom-width: 1px; - min-height: 36px; - position: relative; - width: 100%; -} - -#wpbody-content #media-items { - border-style: solid solid none; - border-width: 1px; - width: 670px; -} - -#wpbody-content #media-items .filename { - line-height: 36px; - overflow: hidden; -} - -.media-item .pinkynail { - float: left; - height: 32px; - margin: 2px; - max-width: 40px; - max-height: 40px; -} - -.media-item .startopen, -.media-item .startclosed { - display: none; -} - -.media-item .original { - position: relative; - height: 34px; - text-align: center; -} - -.media-item .percent { - font-weight: bold; -} - -.crunching { - display: block; - line-height: 32px; - text-align: right; - margin-right: 5px; -} - -button.dismiss { - position: absolute; - top: 7px; - right: 5px; - z-index: 4; - width: 8em; -} - -.file-error { - float: left; - font-weight: bold; - padding: 10px; -} - -.progress { - position: relative; - margin-bottom: -36px; - height: 36px; -} - -.bar { - width: 0; - height: 100%; - border-right-width: 3px; - border-right-style: solid; -} - -#media-items a.delete, -#media-items a.del-link { - padding: 1px 4px 2px; -} - - -/* find posts */ -.find-box { - width: 500px; - height: 300px; - overflow: hidden; - padding: 33px 5px 40px; - position: absolute; - z-index: 1000; -} - -.find-box-head { - cursor: move; - font-weight: bold; - height: 2em; - line-height: 2em; - padding: 1px 12px; - position: absolute; - top: 5px; - width: 100%; -} - -.find-box-inside { - overflow: auto; - width: 100%; - height: 100%; -} - -.find-box-search { - padding: 12px; - border-width: 1px; - border-style: none none solid; -} - -#find-posts-response { - margin: 8px 0; - padding: 0 1px; -} - -#find-posts-response table { - width: 100%; -} - -#find-posts-response .found-radio { - padding: 5px 0 0 8px; - width: 15px; -} - -.find-box-buttons { - width: 480px; - margin: 8px; -} - -.find-box-search label { - padding-right: 6px; -} - -.find-box #resize-se { - position: absolute; - right: 1px; - bottom: 1px; -} - -/* favorite-actions */ -#favorite-actions { - float: right; - margin: 11px 12px 0; - min-width: 130px; - position: relative; -} - -#favorite-first { - -moz-border-radius: 12px; - -khtml-border-radius: 12px; - -webkit-border-radius: 12px; - border-radius: 12px; - line-height: 15px; - padding: 3px 30px 4px 12px; - border-width: 1px; - border-style: solid; -} - -#favorite-inside { - margin: 0 0 0 0px; - padding: 0 1px 6px 1px; - border-width: 1px; - border-style: solid; - position: absolute; - z-index: 11; - display: none; - -moz-border-radius: 0 0 12px 12px; - -webkit-border-bottom-right-radius: 12px; - -webkit-border-bottom-left-radius: 12px; - -khtml-border-bottom-right-radius: 12px; - -khtml-border-bottom-left-radius: 12px; - border-bottom-right-radius: 12px; - border-bottom-left-radius: 12px; -} - -#favorite-actions a { - display: block; - text-decoration: none; - font-size: 11px; -} - -#favorite-inside a { - padding: 3px 5px 3px 10px; -} - -#favorite-toggle { - height: 22px; - position: absolute; - right: 0; - top: 1px; - width: 28px; -} - -#favorite-actions .slide-down { - -moz-border-radius: 12px 12px 0 0; - -webkit-border-bottom-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -khtml-border-bottom-right-radius: 0; - -khtml-border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - border-bottom-width: 1px; - border-bottom-style: solid; -} - -#utc-time, #local-time { - padding-left: 25px; - font-style: italic; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; -} - -ul#dismissed-updates { - display: none; -} -form.upgrade { - margin-top: 8px; -} - -form.upgrade .hint { - font-style: italic; - font-size: 85%; - margin: -0.5em 0 2em 0; -} - -#poststuff .inside .the-tagcloud { - margin: 5px 0 10px; - padding: 8px; - border-width: 1px; - border-style: solid; - line-height: 1.8em; - word-spacing: 3px; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -br.clear { - height: 2px; - line-height: 2px; -} - -.swfupload { - margin: 5px 10px; - vertical-align: middle; -} - -/* table.fixed column width */ -table.fixed { - table-layout: fixed; -} - -.fixed .column-rating, -.fixed .column-visible { - width: 8%; -} - -.fixed .column-date, -.fixed .column-parent, -.fixed .column-links { - width: 10%; -} - -.fixed .column-response, -.fixed .column-author, -.fixed .column-categories, -.fixed .column-tags, -.fixed .column-rel, -.fixed .column-role { - width: 15%; -} - -.fixed .column-comments { - width: 4em; - padding-top: 8px; -} - -.fixed .column-slug { - width: 25%; -} - -.fixed .column-posts { - width: 10%; -} - -.fixed .column-icon { - width: 80px; -} - -#commentstatusdiv .fixed .column-author, -#comments-form .fixed .column-author, -#commentstatusdiv .fixed .column-date { - width: 20%; -} - -.widefat th, -.widefat td { - overflow: hidden; -} - -.widefat td p { - margin: 2px 0 0.8em; -} - -table .vers, -table .column-visible, -table .column-rating { - text-align: center; -} - -.icon32 { - float: left; - height: 36px; - margin: 14px 6px 0 0; - width: 36px; -} - -.key-labels label { - line-height: 24px; -} - -.subtitle { - font-size: 0.75em; - line-height: 1; - padding-left: 25px; -} - -ol { - list-style-type: decimal; - margin-left: 2em; -} - -.postbox-container { - float: left; - padding-right: 0.5%; -} - -.postbox-container .meta-box-sortables { - min-height: 300px; -} - -.temp-border { - border: 1px dotted #ccc; -} - -.columns-prefs label { - padding: 0 5px; -} - -.theme-install-php h4, -.plugin-install-php h4 { - margin: 2.5em 0 8px; -} - -p.install-help { - margin: 8px 0; - font-style: italic; -} - -p.popular-tags { - -moz-border-radius: 8px; - -khtml-border-radius: 8px; - -webkit-border-radius: 8px; - border-radius: 8px; - border-width: 1px; - border-style: solid; - line-height: 2em; - padding: 8px 12px 12px; - text-align: justify; -} - -p.popular-tags a { - padding: 0 3px; -} - -.stuffbox .editcomment { - clear: none; -} - -.ajax-feedback { - visibility: hidden; - vertical-align: bottom; -} - -.tagsdiv .newtag { - width: 180px; -} - -.tagsdiv .the-tags { - display: block; - height: 60px; - margin: 0 auto; - overflow: auto; - width: 260px; -} - -#post-body-content .tagsdiv .the-tags { - margin: 0 5px; -} - -label, -#your-profile label + a { - vertical-align: middle; -} - -.plugin-update-tr .update-message { - margin: 5px; - padding: 3px 5px; - border-width: 1px; - border-style: solid; - -moz-border-radius: 5px; - -khtml-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} +textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-width:1px;border-style:solid;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}p,ul,ol,blockquote,input,select{font-size:12px;}select option{padding:2px;}.plugins .name,#pass-strength-result.strong,#pass-strength-result.short,.button-highlighted,#quicktags #ed_strong,#ed_reply_toolbar #ed_reply_strong{font-weight:bold;}.plugins p{margin:0 4px;padding:0;}.plugins .desc p{margin:0 0 8px;}.plugins td.desc{line-height:1.5em;}.plugins .desc ul,.plugins .desc ol{margin:0 0 0 2em;}.plugins .desc ul{list-style-type:disc;}.plugins .action-links{white-space:nowrap;}.plugins .row-actions-visible{padding:0;}.widefat tbody.plugins th.check-column{padding:7px 0;}.widefat .plugins td,.widefat .plugins th{border-bottom:0 none;}#install-plugins .plugins td,#install-plugins .plugins th{border-bottom-style:solid;border-bottom-width:1px;}.plugins .inactive td,.plugins .inactive th,.plugins .active td,.plugins .active th{border-top-style:solid;border-top-width:1px;padding:5px 7px 0;}#wpbody-content .plugins .plugin-title{padding-right:12px;}.plugins .second td,.plugins .second th{border-top:0 none;padding:0 7px 5px;}.plugins-php .widefat tfoot th,.plugins-php .widefat tfoot td{border-top-style:solid;border-top-width:1px;}.import-system{font-size:16px;}.anchors{margin:10px 20px 10px 20px;}table#availablethemes{border-spacing:0;border-width:1px 0;border-style:solid none;margin:10px auto;width:100%;}td.available-theme{vertical-align:top;width:240px;margin:0;padding:20px;text-align:left;}table#availablethemes td{border-width:0 1px 1px;border-style:none solid solid;}table#availablethemes td.right,table#availablethemes td.left{border-right:0 none;border-left:0 none;}table#availablethemes td.bottom{border-bottom:0 none;}.available-theme a.screenshot{width:240px;height:180px;display:block;border-width:1px;border-style:solid;margin-bottom:10px;overflow:hidden;}.available-theme img{width:240px;}.available-theme h3{margin:15px 0 5px;}#current-theme{margin:1em 0 1.5em;}#current-theme a{border-bottom:none;}#current-theme h3{font-size:17px;font-weight:normal;margin:0;}#current-theme .theme-description{margin-top:5px;}#current-theme img{float:left;border-width:1px;border-style:solid;margin-right:1em;margin-bottom:1.5em;width:150px;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{font-weight:bold;text-decoration:none;}#TB_window #TB_title{background-color:#222;color:#cfcfcf;}.checkbox{border:none;margin:0;padding:0;}.code,code{font-family:Consolas,Monaco,Courier,monospace;}kbd,code{padding:1px 3px;margin:0 1px;font-size:11px;}.commentlist li{padding:1em 1em .2em;margin:0;border-bottom-width:1px;border-bottom-style:solid;}.commentlist li li{border-bottom:0;padding:0;}.commentlist p{padding:0;margin:0 0 .8em;}.post-categories{display:inline;margin:0;padding:0;}.post-categories li{display:inline;}.quicktags,.search{font:12px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}.submit{padding:1.5em 0;margin:5px 0;-moz-border-radius:0 0 3px 3px;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-bottom-left-radius:3px;-khtml-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;}form p.submit a.cancel:hover{text-decoration:none;}#submitdiv h3{margin-bottom:0!important;}#misc-publishing-actions{padding:6px 0 16px 0;}.misc-pub-section{padding:6px;border-bottom-width:1px;border-bottom-style:solid;}.misc-pub-section-last{border-bottom:0 none;}#minor-publishing-actions{padding:6px;text-align:right;}#minor-publishing{border-bottom-width:1px;border-bottom-style:solid;}#save-post{float:left;}.preview{float:right;}#major-publishing-actions{padding:6px;clear:both;border-top:none;}#minor-publishing-actions input,#major-publishing-actions input,#minor-publishing-actions .preview{min-width:80px;text-align:center;}#delete-action{line-height:25px;vertical-align:middle;text-align:left;float:left;}#publishing-action{text-align:right;float:right;line-height:23px;}#post-body #minor-publishing{padding-bottom:10px;}#post-body #misc-publishing-actions{padding:0;}#post-body .misc-pub-section{border-right-width:1px;border-right-style:solid;border-bottom:0 none;min-height:30px;float:left;max-width:32%;}#post-body .misc-pub-section-last{border-right:0;}#sticky-span{margin-left:18px;}#post-status-display,#post-visibility-display{font-weight:bold;}.side-info{margin:0;padding:4px;font-size:11px;}.side-info h5{padding-bottom:7px;font-size:14px;margin:12px 2px 5px;border-bottom-width:1px;border-bottom-style:solid;}.side-info ul{margin:0;padding-left:18px;list-style:square;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{text-decoration:none;font-size:11px!important;line-height:14px;padding:2px 8px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}a.button,a.button-primary,a.button-secondary{line-height:15px;padding:3px 10px;white-space:nowrap;-webkit-border-radius:10px;}#doaction,#doaction2,#post-query-submit{margin-right:8px;}.tablenav select[name="action"],.tablenav select[name="action2"]{width:130px;}.tablenav select[name="m"]{width:155px;}.tablenav select#cat{width:170px;}#wpcontent select{padding:2px;height:2em;font-size:11px;}#wpcontent option{padding:2px;}#timezone_string option{margin-left:1em;}.approve{display:none;}.unapproved .approve,.spam .approve,.trash .approve{display:inline;}.unapproved .unapprove{display:none;}.narrow{width:70%;margin-bottom:40px;}.narrow p{line-height:150%;}textarea.all-options,input.all-options{width:250px;}#namediv table{width:100%;}#namediv td.first{width:10px;white-space:nowrap;}#namediv input{width:98%;}#namediv p{margin:10px 0;}#wpbody-content .metabox-holder{padding-top:10px;}#content{margin:0;width:100%;}#editorcontainer #content{padding:6px;line-height:150%;border:0 none;outline:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-khtml-box-sizing:border-box;box-sizing:border-box;}#editorcontainer,#quicktags{border-style:solid;border-width:1px;border-collapse:separate;-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}#quicktags{padding:0;margin-bottom:-3px;border-bottom-width:3px;background-image:url("images/ed-bg.gif");background-position:left top;background-repeat:repeat-x;}#quicktags #ed_toolbar{padding:2px 4px 0;}#ed_toolbar input,#ed_reply_toolbar input{margin:3px 1px 4px;line-height:18px;display:inline-block;min-width:26px;padding:2px 4px;font-size:12px;}#ed_reply_toolbar input{margin:1px 2px 1px 1px;}#quicktags #ed_link,#ed_reply_toolbar #ed_reply_link{text-decoration:underline;}#quicktags #ed_del,#ed_reply_toolbar #ed_reply_del{text-decoration:line-through;}#quicktags #ed_em,#ed_reply_toolbar #ed_reply_em{font-style:italic;}#excerpt,.attachmentlinks{margin:0;height:4em;width:98%;}#postcustomstuff table,#postcustomstuff input,#postcustomstuff textarea{border-width:1px;border-style:solid;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#postcustomstuff .updatemeta,#postcustomstuff .deletemeta{margin:auto;}#postcustomstuff thead th{padding:5px 8px 8px;}#postcustom #postcustomstuff .submit{border:0 none;float:none;padding:5px 8px;}#side-sortables #postcustom #postcustomstuff .submit{padding:0 5px;}#side-sortables #postcustom #postcustomstuff td.left input{margin:3px 3px 0;}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px;margin:3px;}#postcustomstuff table{margin:0;width:100%;border-width:1px;border-style:solid;border-spacing:0;}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:95%;margin:8px 0 8px 8px;}#postcustomstuff th.left,#postcustomstuff td.left{width:38%;}#postcustomstuff .submit input{width:auto;}#postcustomstuff #newmeta .submit{padding:0 8px;}#postcustomstuff table #addmetasub{width:auto;}#postcustomstuff #newmetaleft{vertical-align:top;}#postcustomstuff #newmetaleft a{padding:0 10px;text-decoration:none;}#save{width:15em;}#template div{margin-right:190px;}* html #template div{margin-right:0;}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute;}* html #themeselect{padding:0 3px;height:22px;}#your-profile legend{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:22px;}#your-profile #rich_editing{border:none;}#howto{font-size:11px;margin:0 5px;display:block;}#ajax-response.alignleft{margin-left:2em;}div.nav{height:2em;padding:7px 10px;vertical-align:text-top;margin:5px 0;}.nav .button-secondary{padding:2px 4px;}a.page-numbers{border-bottom-style:solid;border-bottom-width:2px;font-weight:bold;margin-right:1px;padding:0 2px;}p.pagenav{margin:0;display:inline;}.pagenav span{font-weight:bold;margin:0 6px;}.row-title{font-size:12px!important;font-weight:bold;}.widefat .column-comment p{margin:.6em 0;}.column-author img,.column-username img{float:left;margin-right:10px;margin-top:3px;}.tablenav a.button-secondary{display:block;margin:3px 8px 0 0;}.tablenav{clear:both;height:30px;margin:6px 0 4px;vertical-align:middle;}.tablenav .tablenav-pages{float:right;display:block;cursor:default;height:30px;line-height:30px;font-size:11px;}.tablenav .tablenav-pages a,.tablenav-pages span.current{text-decoration:none;border:none;padding:3px 6px;border-width:1px;border-style:solid;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.tablenav .displaying-num{margin-right:10px;font-size:12px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;}.tablenav .actions{padding:2px 8px 0 0;}td.media-icon{text-align:center;width:80px;padding-top:8px;}td.media-icon img{max-width:80px;max-height:60px;}#update-nag{line-height:29px;font-size:12px;text-align:center;}#update-nag{border-width:1px 0;border-style:solid none;}.plugins .plugin-update{padding:0;}.plugin-update .update-message{margin:0 10px 8px 31px;font-weight:bold;}#pass-strength-result{border-style:solid;border-width:1px;float:left;margin:12px 5px 5px 1px;padding:3px 5px;text-align:center;width:200px;}.row-actions{visibility:hidden;padding:2px 0 0;}tr:hover .row-actions,div.comment-item:hover .row-actions{visibility:visible;}.row-actions-visible{padding:2px 0 0;cursor:pointer;}#wphead-info{margin:0 0 0 15px;padding-right:15px;}#user_info{float:right;font-size:12px;line-height:46px;height:46px;}#user_info p{margin:0;padding:0;line-height:46px;}#wphead{height:46px;}#wphead a,#adminmenu a,#sidemenu a,#taglist a,#catlist a,#show-settings a{text-decoration:none;}#header-logo{float:left;margin:7px 0 0 15px;}#wphead h1{font:normal 22px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:10px 8px 5px;margin:0;float:left;}#wphead h1.long-title{font:normal 18px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:12px 10px 5px;}#wphead #site-visit-button{background-repeat:repeat-x;background-position:0 0;-moz-border-radius:3px;-webkit-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;cursor:pointer;display:-moz-inline-stack;display:inline-block;font-size:50%;font-style:normal;line-height:17px;margin-left:5px;padding:0 6px;vertical-align:middle;}#wphead h1 a:hover{text-decoration:none;}#wphead h1 a:hover #site-title{text-decoration:underline;}#adminmenu *{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}#adminmenu .wp-submenu{display:none;list-style:none;padding:0;margin:0;position:relative;z-index:2;border-width:1px 0 0;border-style:solid none none;}#adminmenu .wp-submenu a{font:normal 11px/18px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{font-weight:bold;}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font:normal 13px/18px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}#adminmenu div.wp-submenu-head{display:none;}.folded #adminmenu div.wp-submenu-head,.folded #adminmenu li.wp-has-submenu div.sub-open{display:block;}.folded #adminmenu a.menu-top,.folded #adminmenu .wp-submenu,.folded #adminmenu li.wp-menu-open .wp-submenu,.folded #adminmenu div.wp-menu-toggle{display:none;}#adminmenu li.wp-menu-open .wp-submenu,.no-js #adminmenu .open-if-no-js .wp-submenu{display:block;}#adminmenu div.wp-menu-image{float:left;width:28px;height:28px;}#adminmenu li{margin:0;padding:0;cursor:pointer;}#adminmenu a{display:block;line-height:18px;padding:1px 5px 3px;}#adminmenu li.menu-top{min-height:26px;}#adminmenu a.menu-top{line-height:18px;min-width:10em;padding:5px 5px;border-width:1px 1px 0;border-style:solid solid none;}#adminmenu .wp-submenu a{margin:0;padding-left:12px;border-width:0 1px 0 0;border-style:none solid none none;}#adminmenu .menu-top-last ul.wp-submenu{border-width:0 0 1px;border-style:none none solid;}#adminmenu .wp-submenu li{padding:0;margin:0;}.folded #adminmenu li.menu-top{width:28px;height:30px;overflow:hidden;border-width:1px 1px 0;border-style:solid solid none;}#adminmenu .menu-top-first a.menu-top,.folded #adminmenu li.menu-top-first,#adminmenu .wp-submenu .wp-submenu-head{border-width:1px 1px 0;border-style:solid solid none;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}#adminmenu .menu-top-last a.menu-top,.folded #adminmenu li.menu-top-last{border-width:1px;border-style:solid;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-bottom-left-radius:6px;}#adminmenu li.wp-menu-open a.menu-top-last{border-bottom:0 none;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}#adminmenu .wp-menu-image img{float:left;padding:8px 6px 0;opacity:.6;filter:alpha(opacity=60);}#adminmenu li.menu-top:hover .wp-menu-image img,#adminmenu li.wp-has-current-submenu .wp-menu-image img{opacity:1;filter:alpha(opacity=100);}#adminmenu li.wp-menu-separator{height:21px;padding:0;margin:0;}#adminmenu a.separator{cursor:w-resize;height:20px;padding:0;}.folded #adminmenu a.separator{cursor:e-resize;}#adminmenu .wp-menu-separator-last{height:10px;width:1px;}#adminmenu .wp-submenu .wp-submenu-head{border-width:1px;border-style:solid;padding:6px 4px 6px 10px;cursor:default;}.folded #adminmenu .wp-submenu{position:absolute;margin:-1px 0 0 28px;padding:0 8px 8px;z-index:999;border:0 none;}.folded #adminmenu .wp-submenu ul{width:140px;border-width:0 0 1px;border-style:none none solid;}.folded #adminmenu .wp-submenu li.wp-first-item{border-top:0 none;}.folded #adminmenu .wp-submenu a{padding-left:10px;}.folded #adminmenu a.wp-has-submenu{margin-left:40px;}#adminmenu li.menu-top-last .wp-submenu ul{border-width:0 0 1px;border-style:none none solid;}#adminmenu .wp-menu-toggle{width:22px;clear:right;float:right;margin:1px 0 0;height:27px;padding:1px 2px 0 0;cursor:default;}#adminmenu li.wp-has-current-submenu ul{border-bottom-width:1px;border-bottom-style:solid;}#adminmenu .wp-menu-image a{height:24px;}#adminmenu .wp-menu-image img{padding:6px 0 0 1px;}#adminmenu #awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{position:absolute;font-family:Helvetica,Arial,sans-serif;font-size:7pt;font-weight:bold;margin-top:2px;margin-left:2px;-moz-border-radius:7px;-khtml-border-radius:7px;-webkit-border-radius:7px;border-radius:7px;}#adminmenu li #awaiting-mod span,#adminmenu li span.update-plugins span,#sidemenu li a span.update-plugins span{float:left;display:block;height:1.6em;line-height:1.6em;padding:0 6px;}#adminmenu li span.count-0,#sidemenu li a .count-0{display:none;}.post-com-count-wrapper{min-width:22px;font-family:Helvetica,Arial,sans-serif;}.post-com-count{height:1.3em;line-height:1.1em;display:block;text-decoration:none;padding:0 0 6px;cursor:pointer;background-position:center -80px;background-repeat:no-repeat;}.post-com-count span{font-size:9px;font-weight:bold;height:1.7em;line-height:1.70em;min-width:.7em;padding:0 6px;display:inline-block;cursor:pointer;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}strong .post-com-count{background-position:center -55px;}.post-com-count:hover{background-position:center -3px;}.column-response .post-com-count{float:left;margin-right:5px;text-align:center;}.response-links{float:left;}#the-comment-list .attachment-80x60{padding:4px 8px;}#footer{margin-top:-45px;}#footer,#footer a{font-size:12px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;}#footer p{margin:0;padding:15px;line-height:15px;}#footer a{text-decoration:none;}#footer a:hover{text-decoration:underline;}.form-table{border-collapse:collapse;margin-top:.5em;width:100%;margin-bottom:-8px;clear:both;}.form-table td{margin-bottom:9px;padding:8px 10px;line-height:20px;font-size:11px;}.form-table th,.form-wrap label{font-weight:normal;text-shadow:rgba(255,255,255,1) 0 1px 0;}.form-table th{vertical-align:top;text-align:left;padding:10px;width:200px;}.form-table th.th-full{width:auto;}.form-table div.color-option{display:block;clear:both;margin-top:12px;}.form-table input.tog{margin-top:2px;margin-right:2px;float:left;}.form-table table.color-palette{vertical-align:bottom;float:left;margin:-12px 3px 11px;}.form-table .color-palette td{border-width:1px 1px 0;border-style:solid solid none;height:10px;line-height:20px;width:10px;}textarea.large-text{width:99%;}.form-table input.regular-text,#adduser .form-field input{width:25em;}.form-table input.small-text{width:50px;}#profile-page .form-table textarea{width:500px;margin-bottom:6px;}#profile-page .form-table #rich_editing{margin-right:5px;}.form-table .pre{padding:8px;margin:0;}.pre{white-space:pre-wrap;white-space:-moz-pre-wrap!important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}table.form-table td .updated{font-size:13px;}.form-wrap{margin:10px 0;width:97%;}.form-wrap p,.form-wrap label{font-size:11px;}.form-wrap label{display:block;padding:2px;font-size:12px;}.form-field input,.form-field textarea{border-style:solid;border-width:1px;width:95%;}p.description,.form-wrap p{margin:2px 0 5px;}p.help,p.description,span.description,.form-wrap p{font-size:12px;font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}.form-wrap .form-field{margin:0 0 10px;padding:8px;}.col-wrap h3{margin:12px 0;font-size:1.1em;}.col-wrap p.submit{margin-top:-10px;}.tagcloud{width:97%;margin:0 0 40px;text-align:justify;}.tagcloud h3{margin:2px 0 12px;}#post-body #normal-sortables{min-height:50px;}#post-body #advanced-sortables{min-height:20px;}.postbox{position:relative;min-width:255px;width:99.5%;}#trackback_url{width:99%;}#normal-sortables .postbox .submit{background:transparent none;border:0 none;float:right;padding:0 12px;margin:0;}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:3px 7px;}#side-sortables .submitbox .submit input,#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover{border:0 none;}#side-sortables .inside-submitbox .insidebox,.stuffbox .insidebox{margin:11px 0;}#side-sortables .comments-box,#normal-sortables .comments-box{border:0 none;}#side-sortables .comments-box thead th,#normal-sortables .comments-box thead th{background:transparent;padding:0 7px 4px;font-style:italic;}#commentsdiv img.waiting{padding-left:5px;vertical-align:middle;}#post-body .tagsdiv #newtag{margin-right:5px;width:16em;}#side-sortables input#post_password{width:94%;}#side-sortables .tagsdiv #newtag{width:68%;}#post-status-info{border-width:0 1px 1px;border-style:none solid solid;width:100%;-moz-border-radius:0 0 6px 6px;-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;}#post-status-info td{font-size:11px;}.autosave-info{padding:2px 15px 2px 2px;text-align:right;}#editorcontent #post-status-info{border:none;}#post-body .wp_themeSkin .mceStatusbar a.mceResize{display:block;background:transparent url(images/resize.gif) no-repeat scroll right bottom;width:12px;cursor:se-resize;margin:0 2px;position:relative;top:22px;}#linksubmitdiv div.inside,div.inside{padding:0;margin:0;}#comment-status-radio p{margin:3px 0 5px;}#comment-status-radio input{margin:2px 3px 5px 0;vertical-align:middle;}#comment-status-radio label{padding:5px 0;}.tagchecklist{margin-left:14px;font-size:12px;overflow:auto;}.tagchecklist strong{margin-left:-8px;position:absolute;}.tagchecklist span{margin-right:25px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}.howto{font-style:italic;display:block;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid;}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left;}.ac_over{cursor:pointer;}.ac_match{text-decoration:underline;}#poststuff h2{margin-top:20px;font-size:1.5em;margin-bottom:15px;padding:0 0 3px;clear:left;}.widget .widget-top,.postbox h3{cursor:move;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}.postbox .hndle span{padding:6px 0;}.postbox .hndle{cursor:move;}.hndle a{font-size:11px;font-weight:normal;}#dashboard-widgets .meta-box-sortables{margin:0 5px;}.postbox .handlediv{float:right;width:23px;height:26px;}.sortable-placeholder{border-width:1px;border-style:dashed;margin-bottom:20px;}#poststuff h3,.metabox-holder h3{font-size:12px;font-weight:bold;padding:7px 9px;margin:0;line-height:1;}.widget,.postbox,.stuffbox{margin-bottom:20px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget .widget-top,.postbox h3,.postbox h3,.stuffbox h3{-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}.postbox.closed h3{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px;}.postbox table.form-table{margin-bottom:0;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}#poststuff .inside,#poststuff .inside p{font-size:11px;margin:6px 6px 8px;}#poststuff .inside .submitbox p{margin:1em 0;}#post-visibility-select{line-height:1.5em;margin-top:3px;}#poststuff #submitdiv .inside{margin:0;}#titlediv,#poststuff .postarea{margin-bottom:20px;}#titlediv{margin-bottom:20px;}#titlediv label{cursor:text;}#titlediv div.inside{margin:0;}#poststuff #titlewrap{border:0;padding:0;}#titlediv #title{padding:3px 4px;border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;font-size:1.7em;width:100%;outline:none;}#poststuff .inside-submitbox,#side-sortables .inside-submitbox{margin:0 3px;font-size:11px;}input#link_description,input#link_url{width:98%;}#pending{background:0 none;border:0 none;padding:0;font-size:11px;margin-top:-1px;}#edit-slug-box{height:1em;margin-top:8px;padding:0 7px;}#editable-post-name-full{display:none;}#editable-post-name input{width:16em;}.postarea h3 label{float:left;}.postarea #add-media-button{float:right;margin:7px 0 0;position:relative;right:10px;}#poststuff #editor-toolbar{height:30px;}.wp_themeSkin tr.mceFirst td.mceToolbar{border-width:0 0 1px;border-style:none none solid;}#edButtonPreview,#edButtonHTML{height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;}.js .theEditor{color:white;}#poststuff #edButtonHTML{margin-right:15px;}#media-buttons{cursor:default;padding:8px 8px 0;}#media-buttons a{cursor:pointer;padding:0 0 5px 10px;}#media-buttons img,#submitpost #ajax-loading{vertical-align:middle;}.submitbox .submit{text-align:left;padding:12px 10px 10px;font-size:11px;}.submitbox .submitdelete{border-bottom-width:1px;border-bottom-style:solid;text-decoration:none;padding:1px 2px;}.inside-submitbox #post_status{margin:2px 0 2px -2px;}.submitbox .submit a:hover{border-bottom-width:1px;border-bottom-style:solid;}.submitbox .submit input{margin-bottom:8px;margin-right:4px;padding:6px;}#post-status-select{line-height:2.5em;margin-top:3px;}#category-adder{margin-left:120px;padding:4px 0;}#category-adder h4{margin:0 0 8px;}#side-sortables #category-adder{margin:0;}#post-body #category-add input,#category-add select{width:30%;}#side-sortables #category-add input{width:94%;}#side-sortables #category-add select{width:100%;}#category-add input#category-add-sumbit{width:auto;}#post-body ul#category-tabs{float:left;width:120px;text-align:right;margin:0 -120px 0 5px;padding:0;}#post-body ul#category-tabs li{padding:8px;}#post-body ul#category-tabs li.tabs{-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px;}#post-body ul#category-tabs li.tabs a{font-weight:bold;text-decoration:none;}#categorydiv div.tabs-panel,#linkcategorydiv div.tabs-panel{height:200px;overflow:auto;padding:.5em .9em;border-style:solid;border-width:1px;}#post-body #categorydiv div.tabs-panel,#post-body #linkcategorydiv div.tabs-panel{margin:0 5px 0 125px;}#side-sortables #category-tabs li{display:inline;padding-right:8px;}#side-sortables #category-tabs a{text-decoration:none;}#side-sortables #category-tabs{margin-bottom:3px;}#categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}#categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:18px;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}#category-adder h4{margin-top:4px;margin-bottom:0;}#categorydiv .tabs-panel{border-width:3px;border-style:solid;}ul#category-tabs{margin-top:12px;}ul#category-tabs li.tabs{border-style:solid solid none;border-width:1px 1px 0;}#post-body #category-tabs li.tabs{border-style:solid none solid solid;border-width:1px 0 1px 1px;margin-right:-1px;}ul#category-tabs li{padding:5px 8px;-moz-border-radius:3px 3px 0 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;}form#tags-filter{position:relative;}p.search-box{float:right;margin:-5px 0 0;}.screen-per-page{width:3em;}#posts-filter fieldset{float:left;margin:0 1.5ex 1em 0;padding:0;}#posts-filter fieldset legend{padding:0 0 .2em 1px;}td.post-title strong,td.plugin-title strong{display:block;margin-bottom:.2em;}td.post-title p,td.plugin-title p{margin:6px 0;}td.plugin-title{white-space:nowrap;}.wp-hidden-children .wp-hidden-child,.ui-tabs-hide,#codepress-off{display:none;}.commentlist .avatar{vertical-align:text-top;}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle;}body.wp-admin{min-width:785px;}.view-switch{float:right;margin:6px 8px 0;}.view-switch a{text-decoration:none;}.filter{float:left;margin:-5px 0 0 10px;}.filter .subsubsub{margin-left:-10px;margin-top:13px;}#the-comment-list td.comment p.comment-author{margin-top:0;margin-left:0;}#the-comment-list p.comment-author img{float:left;margin-right:8px;}#the-comment-list p.comment-author strong a{border:none;}#the-comment-list td{vertical-align:top;}#the-comment-list td.comment{word-wrap:break-word;}#the-comment-list .check-column{padding-top:8px;}#templateside ul li a{text-decoration:none;}.indicator-hint{padding-top:8px;}#display_name{width:15em;}.tablenav .delete{margin-right:20px;}td.action-links,th.action-links{text-align:right;}table.diff{width:100%;}table.diff col.content{width:50%;}table.diff tr{background-color:transparent;}table.diff td,table.diff th{padding:.5em;font-family:Consolas,Monaco,Courier,monospace;border:none;}table.diff .diff-deletedline del,table.diff .diff-addedline ins{text-decoration:none;}#wp-word-count{display:block;padding:2px 7px;}fieldset{border:0;padding:0;margin:0;}.tool-box{margin:15px 0 35px;}.tool-box .buttons{margin:15px 0;}.tool-box .title{margin:8px 0;font:18px/24px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}.pressthis a{font-size:1.2em;}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:999998;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{margin:2px;padding:2px;border-width:1px;border-style:solid;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.settings-toggle{text-align:right;margin:5px 7px 15px 0;font-size:12px;}.settings-toggle h3{margin:0;}#timestampdiv select{height:20px;line-height:14px;padding:0;vertical-align:top;}#jj,#hh,#mn{width:2em;padding:1px;font-size:12px;}#aa{width:3.4em;padding:1px;font-size:12px;}.curtime #timestamp{background-repeat:no-repeat;background-position:left top;padding-left:18px;}#timestampdiv{padding-top:5px;line-height:23px;}#timestampdiv p{margin:8px 0 6px;}#timestampdiv input{border-width:1px;border-style:solid;}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px;}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid;}#sidemenu li{display:inline;line-height:200%;list-style:none;text-align:center;white-space:nowrap;margin:0;padding:0;}#sidemenu a.current{font-weight:normal;padding-left:6px;padding-right:6px;-moz-border-radius:4px 4px 0 0;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-left-radius:4px;-khtml-border-top-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;border-width:1px;border-style:solid;}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px;}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid;}#sidemenu li a .count-0{display:none;}#replyrow{font-size:11px;}#replyrow input{border-width:1px;border-style:solid;}#replyrow td{padding:2px;}#replyrow #editorcontainer{border:0 none;}#replysubmit{margin:0;padding:3px 7px;}#replysubmit img.waiting,.inline-edit-save img.waiting{padding:2px 10px 0;vertical-align:top;}#replysubmit .button{margin-right:5px;}#replyrow #editor-toolbar{display:none;}#replyhead{font-size:12px;font-weight:bold;padding:2px 10px 4px;}#edithead .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:center;font-size:11px;}#edithead .inside input{width:180px;font-size:11px;}#edithead label{padding:2px 0;}#replycontainer{padding:5px;border:0 none;height:120px;overflow:hidden;position:relative;}#replycontent{resize:none;margin:0;width:100%;height:100%;padding:0;line-height:150%;border:0 none;outline:none;font-size:12px;}#replyrow #ed_reply_toolbar{margin:0;padding:2px 3px;}#screen-meta{position:relative;clear:both;}#screen-meta-links{margin:0 9px 0 0;}#screen-meta .screen-reader-text{visibility:hidden;}#screen-options-link-wrap,#contextual-help-link-wrap{float:right;background:transparent url(images/screen-options-left.gif) no-repeat 0 0;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;height:22px;padding:0;margin:0 6px 0 0;}#screen-meta a.show-settings{text-decoration:none;z-index:1;padding:0 16px 0 6px;height:22px;line-height:22px;font-size:10px;display:block;background-repeat:no-repeat;background-position:right bottom;}#screen-meta a.show-settings{background-image:url(images/screen-options-right.gif);}#screen-meta a.show-settings:hover{text-decoration:none;}#screen-options-wrap h5,#contextual-help-wrap h5{margin:8px 0;font-size:13px;}#screen-options-wrap,#contextual-help-wrap{border-style:none solid solid;border-top:0 none;border-width:0 1px 1px;margin:0 15px;padding:8px 12px 12px;-moz-border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px;}.metabox-prefs label{padding-right:15px;white-space:nowrap;line-height:30px;}.metabox-prefs label input{margin:0 5px 0 2px;}.metabox-prefs label a{display:none;}tr.inline-edit-row td{padding:0 .5em;}#wpbody-content .inline-edit-row fieldset{font-size:12px;float:left;margin:0;padding:0;width:100%;}#wpbody-content .inline-edit-row fieldset .inline-edit-col{padding:0 .5em;}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-width:0 0 0 1px;border-style:none none none solid;}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:40%;}#wpbody-content .quick-edit-row-post .inline-edit-col-right{width:39%;}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:20%;}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:50%;}#wpbody-content .quick-edit-row-page .inline-edit-col-right,#wpbody-content .bulk-edit-row-post .inline-edit-col-right{width:49%;}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:30%;}#wpbody-content .bulk-edit-row-page .inline-edit-col-right{width:69%;}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:right;width:69%;}#wpbody-content .inline-edit-row-page .inline-edit-col-right,#owpbody-content .bulk-edit-row-post .inline-edit-col-right{margin-top:27px;}.inline-edit-row fieldset .inline-edit-group{clear:both;}.inline-edit-row fieldset .inline-edit-group:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.inline-edit-row p.submit{clear:both;padding:.5em;margin:.5em 0 0;}.inline-edit-row span.error{line-height:22px;margin:0 15px;padding:3px 5px;}.inline-edit-row h4{margin:.2em 0;padding:0;line-height:23px;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{margin:0;padding:0;line-height:27px;}.inline-edit-row fieldset label,.inline-edit-row fieldset span.inline-edit-categories-label{display:block;margin:.2em 0;}.inline-edit-row fieldset label.inline-edit-tags{margin-top:0;}.inline-edit-row fieldset label.inline-edit-tags span.title{margin:.2em 0;}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em;}.inline-edit-row fieldset label span.input-text-wrap{display:block;margin-left:5em;}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{width:auto;padding-right:.5em;}.inline-edit-row .input-text-wrap input[type=text]{width:100%;}.inline-edit-row fieldset label input[type=checkbox]{vertical-align:text-bottom;}.inline-edit-row fieldset label textarea{width:100%;height:4em;}#wpbody-content .bulk-edit-row fieldset .inline-edit-group label{max-width:50%;}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:.5em;}.inline-edit-row h4{text-transform:uppercase;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;line-height:1.8em;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea{border-style:solid;border-width:1px;}.inline-edit-row fieldset .inline-edit-date{float:left;}.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=mn]{font-size:12px;width:2.1em;}.inline-edit-row fieldset input[name=aa]{font-size:12px;width:3.5em;}.inline-edit-row fieldset label input.inline-edit-password-input{width:8em;}.inline-edit-row .catshow,.inline-edit-row .cathide{cursor:pointer;}ul.cat-checklist{height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0;}#bulk-titles{display:block;height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0 0 5px;}.inline-edit-row fieldset ul.cat-checklist li,.inline-edit-row fieldset ul.cat-checklist input{margin:0;}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-style:normal;font-size:11px;}table .inline-edit-row fieldset ul.cat-hover{height:auto;max-height:30em;overflow-y:auto;position:absolute;}.inline-edit-row fieldset label input.inline-edit-menu-order-input{width:3em;}.inline-edit-row fieldset label input.inline-edit-slug-input{width:75%;}.quick-edit-row-post fieldset label.inline-edit-status{float:left;}#bulk-titles{line-height:140%;}#bulk-titles div{margin:.2em .3em;}#bulk-titles div a{cursor:pointer;display:block;float:left;height:10px;margin:3px 3px 0 -2px;overflow:hidden;position:relative;text-indent:-9999px;width:10px;}#wpbody-content #media-items .describe{border-collapse:collapse;width:100%;border-top-style:solid;border-top-width:1px;clear:both;cursor:default;padding:5px;}#wpbody-content .describe th{vertical-align:top;text-align:left;padding:10px;width:140px;}#wpbody-content .describe .media-item-info tr{background-color:transparent;}#wpbody-content .describe .media-item-info td{padding:4px 10px 0;}.describe .media-item-info .A1B1{padding:0 15px 8px 0;}#wpbody-content .filename{padding:0 10px;}#wpbody-content .media-item .thumbnail{max-height:128px;max-width:128px;}#wpbody-content #async-upload-wrap a{display:none;}.media-upload-form td label{margin-right:6px;margin-left:2px;}.media-upload-form .align .field label{display:inline;padding:0 0 0 22px;margin:0 1em 0 0;font-weight:bold;}.media-upload-form tr.image-size label{margin:0 0 0 3px;font-weight:bold;}.media-upload-form th.label label{font-weight:bold;margin:.5em;font-size:13px;}.media-upload-form th.label label span{padding:0 5px;}abbr.required{border:medium none;text-decoration:none;}#wpbody-content .describe input[type="text"],#wpbody-content .describe textarea{width:460px;}#wpbody-content .describe p.help{margin:0;padding:0 0 0 5px;}.describe-toggle-on,.describe-toggle-off{display:block;line-height:36px;float:right;margin-right:20px;}.describe-toggle-off{display:none;}#wpbody-content .media-item{border-bottom-style:solid;border-bottom-width:1px;min-height:36px;position:relative;width:100%;}#wpbody-content .media-single .media-item{border-bottom-style:none;border-bottom-width:0;}#wpbody-content #media-items{border-style:solid solid none;border-width:1px;width:670px;}#wpbody-content #media-items .filename{line-height:36px;overflow:hidden;}.media-item .pinkynail{float:left;margin:2px;max-width:40px;max-height:32px;}.media-item .startopen,.media-item .startclosed{display:none;}.media-item .original{position:relative;height:34px;text-align:center;}.media-item .percent{font-weight:bold;}.crunching{display:block;line-height:32px;text-align:right;margin-right:5px;}button.dismiss{position:absolute;top:7px;right:5px;z-index:4;width:8em;}.file-error{float:left;font-weight:bold;padding:10px;}.progress{position:relative;margin-bottom:-36px;height:36px;}.bar{width:0;height:100%;border-right-width:3px;border-right-style:solid;}.upload-php .fixed .column-parent{width:25%;}.find-box{width:500px;height:300px;overflow:hidden;padding:33px 5px 40px;position:absolute;z-index:1000;}.find-box-head{cursor:move;font-weight:bold;height:2em;line-height:2em;padding:1px 12px;position:absolute;top:5px;width:100%;}.find-box-inside{overflow:auto;width:100%;height:100%;}.find-box-search{padding:12px;border-width:1px;border-style:none none solid;}#find-posts-response{margin:8px 0;padding:0 1px;}#find-posts-response table{width:100%;}#find-posts-response .found-radio{padding:5px 0 0 8px;width:15px;}.find-box-buttons{width:480px;margin:8px;}.find-box-search label{padding-right:6px;}.find-box #resize-se{position:absolute;right:1px;bottom:1px;}#favorite-actions{float:right;margin:11px 12px 0;min-width:130px;position:relative;}#favorite-first{-moz-border-radius:12px;-khtml-border-radius:12px;-webkit-border-radius:12px;border-radius:12px;line-height:15px;padding:3px 30px 4px 12px;border-width:1px;border-style:solid;}#favorite-inside{margin:0;padding:0 1px 6px 1px;border-width:1px;border-style:solid;position:absolute;z-index:11;display:none;-moz-border-radius:0 0 12px 12px;-webkit-border-bottom-right-radius:12px;-webkit-border-bottom-left-radius:12px;-khtml-border-bottom-right-radius:12px;-khtml-border-bottom-left-radius:12px;border-bottom-right-radius:12px;border-bottom-left-radius:12px;}#favorite-actions a{display:block;text-decoration:none;font-size:11px;}#favorite-inside a{padding:3px 5px 3px 10px;}#favorite-toggle{height:22px;position:absolute;right:0;top:1px;width:28px;}#favorite-actions .slide-down{-moz-border-radius:12px 12px 0 0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-width:1px;border-bottom-style:solid;}#utc-time,#local-time{padding-left:25px;font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}ul#dismissed-updates{display:none;}form.upgrade{margin-top:8px;}form.upgrade .hint{font-style:italic;font-size:85%;margin:-0.5em 0 2em 0;}#poststuff .inside .the-tagcloud{margin:5px 0 10px;padding:8px;border-width:1px;border-style:solid;line-height:1.8em;word-spacing:3px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}br.clear{height:2px;line-height:2px;}.swfupload{margin:5px 10px;vertical-align:middle;}table.fixed{table-layout:fixed;}.fixed .column-rating,.fixed .column-visible{width:8%;}.fixed .column-date,.fixed .column-parent,.fixed .column-links{width:10%;}.fixed .column-response,.fixed .column-author,.fixed .column-categories,.fixed .column-tags,.fixed .column-rel,.fixed .column-role{width:15%;}.fixed .column-comments{width:4em;padding-top:8px;}.fixed .column-slug{width:25%;}.fixed .column-posts{width:10%;}.fixed .column-icon{width:80px;}#commentsdiv .fixed .column-author,#comments-form .fixed .column-author{width:20%;}.widefat th,.widefat td{overflow:hidden;}.widefat td p{margin:2px 0 .8em;}table .vers,table .column-visible,table .column-rating{text-align:center;}.icon32{float:left;height:36px;margin:14px 6px 0 0;width:36px;}.key-labels label{line-height:24px;}.subtitle{font-size:.75em;line-height:1;padding-left:25px;}ol{list-style-type:decimal;margin-left:2em;}.postbox-container{float:left;padding-right:.5%;}.postbox-container .meta-box-sortables{min-height:300px;}.temp-border{border:1px dotted #ccc;}.columns-prefs label{padding:0 5px;}.theme-install-php h4,.plugin-install-php h4{margin:2.5em 0 8px;}p.install-help{margin:8px 0;font-style:italic;}p.popular-tags{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;line-height:2em;padding:8px 12px 12px;text-align:justify;}p.popular-tags a{padding:0 3px;}.stuffbox .editcomment{clear:none;}.ajax-feedback{visibility:hidden;vertical-align:bottom;}.tagsdiv .newtag{width:180px;}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px;}#post-body-content .tagsdiv .the-tags{margin:0 5px;}label,#your-profile label+a{vertical-align:middle;}#misc-publishing-actions label{vertical-align:baseline;}.plugin-update-tr .update-message{margin:5px;padding:3px 5px;border-width:1px;border-style:solid;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.add-new-h2{font-style:normal;margin:0 6px;position:relative;top:-3px;}.describe .image-editor{vertical-align:top;}.imgedit-wrap{position:relative;}.imgedit-settings p{margin:8px 0;}.describe .imgedit-wrap table td{vertical-align:top;padding-top:0;}.imgedit-wrap p,.describe .imgedit-wrap table td{font-size:11px;line-height:18px;}.describe .imgedit-wrap table td.imgedit-settings{padding:0 5px;}td.imgedit-settings input{vertical-align:middle;}.imgedit-wait{position:absolute;top:0;background:#FFF url(images/wpspin_light.gif) no-repeat scroll 22px 10px;opacity:.7;filter:alpha(opacity=70);width:100%;height:500px;display:none;}.media-disabled,.imgedit-settings .disabled{color:grey;}.imgedit-wait-spin{padding:0 4px 4px;vertical-align:bottom;visibility:hidden;}.imgedit-menu{margin:0 0 12px;min-width:300px;}.imgedit-menu div{float:left;width:32px;height:32px;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;border-width:1px;border-style:solid;}.imgedit-crop-wrap{position:relative;}.imgedit-crop{background:transparent url(images/imgedit-icons.png) no-repeat scroll -9px -31px;margin:0 8px 0 0;}.imgedit-crop.disabled:hover{background-position:-9px -31px;}.imgedit-crop:hover{background-position:-9px -1px;}.imgedit-rleft{background:transparent url(images/imgedit-icons.png) no-repeat scroll -46px -31px;margin:0 3px;}.imgedit-rleft.disabled:hover{background-position:-46px -31px;}.imgedit-rleft:hover{background-position:-46px -1px;}.imgedit-rright{background:transparent url(images/imgedit-icons.png) no-repeat scroll -77px -31px;margin:0 8px 0 3px;}.imgedit-rright.disabled:hover{background-position:-77px -31px;}.imgedit-rright:hover{background-position:-77px -1px;}.imgedit-flipv{background:transparent url(images/imgedit-icons.png) no-repeat scroll -115px -31px;margin:0 3px;}.imgedit-flipv.disabled:hover{background-position:-115px -31px;}.imgedit-flipv:hover{background-position:-115px -1px;}.imgedit-fliph{background:transparent url(images/imgedit-icons.png) no-repeat scroll -147px -31px;margin:0 8px 0 3px;}.imgedit-fliph.disabled:hover{background-position:-147px -31px;}.imgedit-fliph:hover{background-position:-147px -1px;}.imgedit-undo{background:transparent url(images/imgedit-icons.png) no-repeat scroll -184px -31px;margin:0 3px;}.imgedit-undo.disabled:hover{background-position:-184px -31px;}.imgedit-undo:hover{background-position:-184px -1px;}.imgedit-redo{background:transparent url(images/imgedit-icons.png) no-repeat scroll -215px -31px;margin:0 8px 0 3px;}.imgedit-redo.disabled:hover{background-position:-215px -31px;}.imgedit-redo:hover{background-position:-215px -1px;}.imgedit-applyto img{margin:0 8px 0 0;}.imgedit-group-top{margin:5px 0;}.imgedit-applyto .imgedit-label{padding:2px 0 0;display:block;}.imgedit-help{display:none;font-style:italic;margin-bottom:8px;}.imgedit-help ul li{font-size:11px;}a.imgedit-help-toggle{text-decoration:none;}#wpbody-content .imgedit-response div{width:600px;margin:8px;}.form-table td.imgedit-response{padding:0;}.imgedit-submit{margin:8px 0;}.imgedit-submit-btn{margin-left:20px;}.imgedit-wrap .nowrap{white-space:nowrap;}span.imgedit-scale-warn{color:red;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle;}.imgedit-group{border-width:1px;border-style:solid;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;margin-bottom:8px;padding:2px 10px;}#dashboard_recent_comments div.undo{border-top-style:solid;border-top-width:1px;margin:0 -10px;padding:3px 8px;font-size:11px;}.trash-undo-inside,.spam-undo-inside{margin:1px 8px 1px 0;line-height:16px;}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-right:8px;vertical-align:middle;}.taghint{color:#aaa;margin:14px 0 -17px 8px;}#poststuff .tagsdiv .howto{margin:0 0 6px 8px;}.ajaxtag .newtag{background:transparent;position:relative;}#broken-themes{text-align:left;width:50%;border-spacing:3px;padding:3px;}.describe .del-link{padding-left:5px;}.comment-ays{margin-bottom:0;border-style:solid;border-width:1px;}.comment-ays th{border-right-style:solid;border-right-width:1px;} \ No newline at end of file diff --git a/wp-admin/wp-admin.dev.css b/wp-admin/wp-admin.dev.css new file mode 100644 index 00000000..b19dfc57 --- /dev/null +++ b/wp-admin/wp-admin.dev.css @@ -0,0 +1,3627 @@ +textarea, +input[type="text"], +input[type="password"], +input[type="file"], +input[type="button"], +input[type="submit"], +input[type="reset"], +select { + border-width: 1px; + border-style: solid; + -moz-border-radius: 4px; + -khtml-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} + +p, +ul, +ol, +blockquote, +input, +select { + font-size: 12px; +} + +select option { + padding: 2px; +} + +.plugins .name, +#pass-strength-result.strong, +#pass-strength-result.short, +.button-highlighted, +#quicktags #ed_strong, +#ed_reply_toolbar #ed_reply_strong { + font-weight: bold; +} + +.plugins p { + margin: 0 4px; + padding: 0; +} + +.plugins .desc p { + margin: 0 0 8px; +} + +.plugins td.desc { + line-height: 1.5em; +} + +.plugins .desc ul, +.plugins .desc ol { + margin: 0 0 0 2em; +} + +.plugins .desc ul { + list-style-type: disc; +} + +.plugins .action-links { + white-space: nowrap; +} + +.plugins .row-actions-visible { + padding: 0; +} + +.widefat tbody.plugins th.check-column { + padding: 7px 0; +} + +.widefat .plugins td, +.widefat .plugins th { + border-bottom: 0 none; +} + +#install-plugins .plugins td, +#install-plugins .plugins th { + border-bottom-style: solid; + border-bottom-width: 1px; +} + +.plugins .inactive td, +.plugins .inactive th, +.plugins .active td, +.plugins .active th { + border-top-style: solid; + border-top-width: 1px; + padding: 5px 7px 0; +} + +#wpbody-content .plugins .plugin-title { + padding-right: 12px; +} + +.plugins .second td, +.plugins .second th { + border-top: 0 none; + padding: 0 7px 5px; +} + +.plugins-php .widefat tfoot th, +.plugins-php .widefat tfoot td { + border-top-style: solid; + border-top-width: 1px; +} + +.import-system { + font-size: 16px; +} + +.anchors { + margin: 10px 20px 10px 20px; +} + +table#availablethemes { + border-spacing: 0; + border-width: 1px 0; + border-style: solid none; + margin: 10px auto; + width: 100%; +} + +td.available-theme { + vertical-align: top; + width: 240px; + margin: 0; + padding: 20px; + text-align: left; +} + +table#availablethemes td { + border-width: 0 1px 1px; + border-style: none solid solid; +} + +table#availablethemes td.right, +table#availablethemes td.left { + border-right: 0 none; + border-left: 0 none; +} + +table#availablethemes td.bottom { + border-bottom: 0 none; +} + +.available-theme a.screenshot { + width: 240px; + height: 180px; + display: block; + border-width: 1px; + border-style: solid; + margin-bottom: 10px; + overflow: hidden; +} + +.available-theme img { + width: 240px; +} + +.available-theme h3 { + margin: 15px 0 5px; +} + +#current-theme { + margin: 1em 0 1.5em; +} + +#current-theme a { + border-bottom: none; +} + +#current-theme h3 { + font-size: 17px; + font-weight: normal; + margin: 0; +} + +#current-theme .theme-description { + margin-top: 5px; +} + +#current-theme img { + float: left; + border-width: 1px; + border-style: solid; + margin-right: 1em; + margin-bottom: 1.5em; + width: 150px; +} + +#TB_window #TB_title a.tb-theme-preview-link, +#TB_window #TB_title a.tb-theme-preview-link:visited { + font-weight: bold; + text-decoration: none; +} + +#TB_window #TB_title { + background-color: #222; + color: #cfcfcf; +} + +.checkbox { + border: none; + margin: 0; + padding: 0; +} + +.code, code { + font-family: Consolas, Monaco, Courier, monospace; +} + +kbd, code { + padding: 1px 3px; + margin: 0 1px; + font-size: 11px; +} + +.commentlist li { + padding: 1em 1em .2em; + margin: 0; + border-bottom-width: 1px; + border-bottom-style: solid; +} + +.commentlist li li { + border-bottom: 0; + padding: 0; +} + +.commentlist p { + padding: 0; + margin: 0 0 .8em; +} + +.post-categories { + display: inline; + margin: 0; + padding: 0; +} + +.post-categories li { + display: inline; +} + +.quicktags, .search { + font: 12px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; +} + +.submit { + padding: 1.5em 0; + margin: 5px 0; + -moz-border-radius: 0 0 3px 3px; + -webkit-border-bottom-left-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + -khtml-border-bottom-left-radius: 3px; + -khtml-border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} + +form p.submit a.cancel:hover { + text-decoration: none; +} + +#submitdiv h3 { + margin-bottom: 0 !important; +} + +#misc-publishing-actions { + padding: 6px 0 16px 0; +} + +.misc-pub-section { + padding: 6px; + border-bottom-width: 1px; + border-bottom-style: solid; +} + +.misc-pub-section-last { + border-bottom: 0 none; +} + +#minor-publishing-actions { + padding: 6px; + text-align: right; +} + +#minor-publishing { + border-bottom-width: 1px; + border-bottom-style: solid; +} + +#save-post { + float: left; +} + +.preview { + float: right; +} + +#major-publishing-actions { + padding: 6px; + clear: both; + border-top: none; +} + +#minor-publishing-actions input, +#major-publishing-actions input, +#minor-publishing-actions .preview { + min-width: 80px; + text-align: center; +} + +#delete-action { + line-height: 25px; + vertical-align: middle; + text-align: left; + float: left; +} + +#publishing-action { + text-align: right; + float: right; + line-height: 23px; +} + +#post-body #minor-publishing { + padding-bottom: 10px; +} + +#post-body #misc-publishing-actions { + padding: 0; +} + +#post-body .misc-pub-section { + border-right-width: 1px; + border-right-style: solid; + border-bottom: 0 none; + min-height: 30px; + float: left; + max-width: 32%; +} + +#post-body .misc-pub-section-last { + border-right: 0; +} + +#sticky-span { + margin-left: 18px; +} + +#post-status-display, +#post-visibility-display { + font-weight: bold; +} + +.side-info { + margin: 0; + padding: 4px; + font-size: 11px; +} + +.side-info h5 { + padding-bottom: 7px; + font-size: 14px; + margin: 12px 2px 5px; + border-bottom-width: 1px; + border-bottom-style: solid; +} + +.side-info ul { + margin: 0; + padding-left: 18px; + list-style: square; +} + +.submit input, +.button, +.button-primary, +.button-secondary, +.button-highlighted, +#postcustomstuff .submit input { + text-decoration: none; + font-size: 11px !important; + line-height: 14px; + padding: 2px 8px; + cursor: pointer; + border-width: 1px; + border-style: solid; + -moz-border-radius: 11px; + -khtml-border-radius: 11px; + -webkit-border-radius: 11px; + border-radius: 11px; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + -khtml-box-sizing: content-box; + box-sizing: content-box; +} + +a.button, +a.button-primary, +a.button-secondary { + line-height: 15px; + padding: 3px 10px; + white-space: nowrap; + -webkit-border-radius: 10px; +} + +#doaction, +#doaction2, +#post-query-submit { + margin-right: 8px; +} + +.tablenav select[name="action"], +.tablenav select[name="action2"] { + width: 130px; +} + +.tablenav select[name="m"] { + width: 155px; +} + +.tablenav select#cat { + width: 170px; +} + +#wpcontent select { + padding: 2px; + height: 2em; + font-size: 11px; +} + +#wpcontent option { + padding: 2px; +} + +#timezone_string option { + margin-left: 1em; +} + +.approve { + display: none; +} + +.unapproved .approve, +.spam .approve, +.trash .approve { + display: inline; +} + +.unapproved .unapprove { + display: none; +} + +.narrow { + width: 70%; + margin-bottom: 40px; +} + +.narrow p { + line-height: 150%; +} + +textarea.all-options, input.all-options { + width: 250px; +} + +#namediv table { + width: 100%; +} + +#namediv td.first { + width: 10px; + white-space: nowrap; +} + +#namediv input { + width: 98%; +} + +#namediv p { + margin: 10px 0; +} + +#wpbody-content .metabox-holder { + padding-top: 10px; +} + +#content { + margin: 0; + width: 100%; +} + +#editorcontainer #content { + padding: 6px; + line-height: 150%; + border: 0 none; + outline: none; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -khtml-box-sizing: border-box; + box-sizing: border-box; +} + +#editorcontainer, +#quicktags { + border-style: solid; + border-width: 1px; + border-collapse: separate; + -moz-border-radius: 6px 6px 0 0; + -webkit-border-top-right-radius: 6px; + -webkit-border-top-left-radius: 6px; + -khtml-border-top-right-radius: 6px; + -khtml-border-top-left-radius: 6px; + border-top-right-radius: 6px; + border-top-left-radius: 6px; +} + +#quicktags { + padding: 0; + margin-bottom: -3px; + border-bottom-width: 3px; + background-image: url("images/ed-bg.gif"); + background-position: left top; + background-repeat: repeat-x; +} + +#quicktags #ed_toolbar { + padding: 2px 4px 0; +} + +#ed_toolbar input, +#ed_reply_toolbar input { + margin: 3px 1px 4px; + line-height: 18px; + display: inline-block; + min-width: 26px; + padding: 2px 4px; + font-size: 12px; +} + +#ed_reply_toolbar input { + margin: 1px 2px 1px 1px; +} + +#quicktags #ed_link, +#ed_reply_toolbar #ed_reply_link { + text-decoration: underline; +} + +#quicktags #ed_del, +#ed_reply_toolbar #ed_reply_del { + text-decoration: line-through; +} + +#quicktags #ed_em, +#ed_reply_toolbar #ed_reply_em { + font-style: italic; +} + +#excerpt, .attachmentlinks { + margin: 0; + height: 4em; + width: 98%; +} + +/* post meta postbox */ +#postcustomstuff table, +#postcustomstuff input, +#postcustomstuff textarea { + border-width: 1px; + border-style: solid; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +#postcustomstuff .updatemeta, +#postcustomstuff .deletemeta { + margin: auto; +} + +#postcustomstuff thead th { + padding: 5px 8px 8px; +} + +#postcustom #postcustomstuff .submit { + border: 0 none; + float: none; + padding: 5px 8px; +} + +#side-sortables #postcustom #postcustomstuff .submit { + padding: 0 5px; +} + +#side-sortables #postcustom #postcustomstuff td.left input { + margin: 3px 3px 0; +} + +#side-sortables #postcustom #postcustomstuff #the-list textarea { + height: 85px; + margin: 3px; +} + +#postcustomstuff table { + margin: 0; + width: 100%; + border-width: 1px; + border-style: solid; + border-spacing: 0; +} + +#postcustomstuff table input, +#postcustomstuff table select, +#postcustomstuff table textarea { + width: 95%; + margin: 8px 0 8px 8px; +} + +#postcustomstuff th.left, +#postcustomstuff td.left { + width: 38%; +} + +#postcustomstuff .submit input { + width: auto; +} + +#postcustomstuff #newmeta .submit { + padding: 0 8px; +} + +#postcustomstuff table #addmetasub { + width: auto; +} + +#postcustomstuff #newmetaleft { + vertical-align: top; +} + +#postcustomstuff #newmetaleft a { + padding: 0 10px; + text-decoration: none; +} + +#save { + width: 15em; +} + +#template div { + margin-right: 190px; +} + +* html #template div { + margin-right: 0; +} + +/* A handy div class for hiding controls. +Some browsers will disable them when you +set display: none; */ +.zerosize { + height: 0; + width: 0; + margin: 0; + border: 0; + padding: 0; + overflow: hidden; + position: absolute; +} + +* html #themeselect { + padding: 0 3px; + height: 22px; +} + +#your-profile legend { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-size: 22px; +} + +#your-profile #rich_editing { + border: none; +} + +#howto { + font-size: 11px; + margin: 0 5px; + display: block; +} + +#ajax-response.alignleft { + margin-left: 2em; +} + +div.nav { + height: 2em; + padding: 7px 10px; + vertical-align: text-top; + margin: 5px 0; +} + +.nav .button-secondary { + padding: 2px 4px; +} + +a.page-numbers { + border-bottom-style: solid; + border-bottom-width: 2px; + font-weight: bold; + margin-right: 1px; + padding: 0 2px; +} + +p.pagenav { + margin: 0; + display: inline; +} + +.pagenav span { + font-weight: bold; + margin: 0 6px; +} + +.row-title { + font-size: 12px !important; + font-weight: bold; +} + +.widefat .column-comment p { + margin: 0.6em 0; +} + +.column-author img, .column-username img { + float: left; + margin-right: 10px; + margin-top: 3px; +} + +.tablenav a.button-secondary { + display: block; + margin: 3px 8px 0 0; +} + +.tablenav { + clear: both; + height: 30px; + margin: 6px 0 4px; + vertical-align: middle; +} + +.tablenav .tablenav-pages { + float: right; + display: block; + cursor: default; + height: 30px; + line-height: 30px; + font-size: 11px; +} + +.tablenav .tablenav-pages a, +.tablenav-pages span.current { + text-decoration: none; + border: none; + padding: 3px 6px; + border-width: 1px; + border-style: solid; + -moz-border-radius: 5px; + -khtml-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +.tablenav .displaying-num { + margin-right: 10px; + font-size: 12px; + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-style: italic; +} + +.tablenav .actions { + padding: 2px 8px 0 0; +} + +td.media-icon { + text-align: center; + width: 80px; + padding-top: 8px; +} + +td.media-icon img { + max-width: 80px; + max-height: 60px; +} + +#update-nag { + line-height: 29px; + font-size: 12px; + text-align: center; +} + +#update-nag { + border-width: 1px 0; + border-style: solid none; +} + +.plugins .plugin-update { + padding: 0; +} + +.plugin-update .update-message { + margin: 0 10px 8px 31px; + font-weight: bold; +} + +#pass-strength-result { + border-style: solid; + border-width: 1px; + float: left; + margin: 12px 5px 5px 1px; + padding: 3px 5px; + text-align: center; + width: 200px; +} + +.row-actions { + visibility: hidden; + padding: 2px 0 0; +} + +tr:hover .row-actions, +div.comment-item:hover .row-actions { + visibility: visible; +} + +.row-actions-visible { + padding: 2px 0 0; + cursor: pointer; +} + +/* Admin Header */ +#wphead-info { + margin: 0 0 0 15px; + padding-right: 15px; +} + +#user_info { + float: right; + font-size: 12px; + line-height: 46px; + height: 46px; +} + +#user_info p { + margin: 0; + padding: 0; + line-height: 46px; +} + +#wphead { + height: 46px; +} + +#wphead a, +#adminmenu a, +#sidemenu a, +#taglist a, +#catlist a, +#show-settings a { + text-decoration: none; +} + +#header-logo { + float: left; + margin: 7px 0 0 15px; +} + +#wphead h1 { + font: normal 22px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + padding: 10px 8px 5px; + margin: 0; + float: left; +} + +#wphead h1.long-title { + font: normal 18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + padding: 12px 10px 5px; +} + +#wphead #site-visit-button { + background-repeat:repeat-x; + background-position:0 0; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + border-radius:3px; + cursor:pointer; /* to keep IE happy */ + display:-moz-inline-stack; /* to keep FF2 happy */ + display:inline-block; + font-size: 50%; + font-style:normal; + line-height:17px; + margin-left:5px; + padding:0 6px; + vertical-align:middle; +} + +#wphead h1 a:hover { + text-decoration:none; +} +#wphead h1 a:hover #site-title { + text-decoration:underline; +} + +/* side admin menu */ +#adminmenu * { + -webkit-user-select: none; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; +} + +#adminmenu .wp-submenu { + display: none; + list-style: none; + padding: 0; + margin: 0; + position: relative; + z-index: 2; + border-width: 1px 0 0; + border-style: solid none none; +} + +#adminmenu .wp-submenu a { + font: normal 11px/18px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; +} + +#adminmenu .wp-submenu li.current, +#adminmenu .wp-submenu li.current a, +#adminmenu .wp-submenu li.current a:hover { + font-weight: bold; +} + +#adminmenu a.menu-top, +#adminmenu .wp-submenu-head { + font: normal 13px/18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; +} + +#adminmenu div.wp-submenu-head { + display: none; +} + +.folded #adminmenu div.wp-submenu-head, +.folded #adminmenu li.wp-has-submenu div.sub-open { + display: block; +} + +.folded #adminmenu a.menu-top, +.folded #adminmenu .wp-submenu, +.folded #adminmenu li.wp-menu-open .wp-submenu, +.folded #adminmenu div.wp-menu-toggle { + display: none; +} + +#adminmenu li.wp-menu-open .wp-submenu, +.no-js #adminmenu .open-if-no-js .wp-submenu { + display: block; +} + +#adminmenu div.wp-menu-image { + float: left; + width: 28px; + height: 28px; +} + +#adminmenu li { + margin: 0; + padding: 0; + cursor: pointer; +} + +#adminmenu a { + display: block; + line-height: 18px; + padding: 1px 5px 3px; +} + +#adminmenu li.menu-top { + min-height: 26px; +} + +#adminmenu a.menu-top { + line-height: 18px; + min-width: 10em; + padding: 5px 5px; + border-width: 1px 1px 0; + border-style: solid solid none; +} + +#adminmenu .wp-submenu a { + margin: 0; + padding-left: 12px; + border-width: 0 1px 0 0; + border-style: none solid none none; +} + +#adminmenu .menu-top-last ul.wp-submenu { + border-width: 0 0 1px; + border-style: none none solid; +} + +#adminmenu .wp-submenu li { + padding: 0; + margin: 0; +} + +.folded #adminmenu li.menu-top { + width: 28px; + height: 30px; + overflow: hidden; + border-width: 1px 1px 0; + border-style: solid solid none; +} + +#adminmenu .menu-top-first a.menu-top, +.folded #adminmenu li.menu-top-first, +#adminmenu .wp-submenu .wp-submenu-head { + border-width: 1px 1px 0; + border-style: solid solid none; + -moz-border-radius-topleft :6px; + -moz-border-radius-topright: 6px; + -webkit-border-top-right-radius: 6px; + -webkit-border-top-left-radius: 6px; + -khtml-border-top-right-radius: 6px; + -khtml-border-top-left-radius: 6px; + border-top-right-radius: 6px; + border-top-left-radius: 6px; +} + +#adminmenu .menu-top-last a.menu-top, +.folded #adminmenu li.menu-top-last { + border-width: 1px; + border-style: solid; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; +} + +#adminmenu li.wp-menu-open a.menu-top-last { + border-bottom: 0 none; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -khtml-border-bottom-right-radius: 0; + -khtml-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +#adminmenu .wp-menu-image img { + float: left; + padding: 8px 6px 0; + opacity: 0.6; + filter: alpha(opacity=60); +} + +#adminmenu li.menu-top:hover .wp-menu-image img, +#adminmenu li.wp-has-current-submenu .wp-menu-image img { + opacity: 1; + filter: alpha(opacity=100); +} + +#adminmenu li.wp-menu-separator { + height: 21px; + padding: 0; + margin: 0; +} + +#adminmenu a.separator { + cursor: w-resize; + height: 20px; + padding: 0; +} + +.folded #adminmenu a.separator { + cursor: e-resize; +} + +#adminmenu .wp-menu-separator-last { + height: 10px; + width: 1px; +} + +#adminmenu .wp-submenu .wp-submenu-head { + border-width: 1px; + border-style: solid; + padding: 6px 4px 6px 10px; + cursor: default; +} + +.folded #adminmenu .wp-submenu { + position: absolute; + margin: -1px 0 0 28px; + padding: 0 8px 8px; + z-index: 999; + border: 0 none; +} + +.folded #adminmenu .wp-submenu ul { + width: 140px; + border-width: 0 0 1px; + border-style: none none solid; +} + +.folded #adminmenu .wp-submenu li.wp-first-item { + border-top: 0 none; +} + +.folded #adminmenu .wp-submenu a { + padding-left: 10px; +} + +.folded #adminmenu a.wp-has-submenu { + margin-left: 40px; +} + +#adminmenu li.menu-top-last .wp-submenu ul { + border-width: 0 0 1px; + border-style: none none solid; +} + +#adminmenu .wp-menu-toggle { + width: 22px; + clear: right; + float: right; + margin: 1px 0 0; + height: 27px; + padding: 1px 2px 0 0; + cursor: default; +} + +#adminmenu li.wp-has-current-submenu ul { + border-bottom-width: 1px; + border-bottom-style: solid; +} + +#adminmenu .wp-menu-image a { + height: 24px; +} + +#adminmenu .wp-menu-image img { + padding: 6px 0 0 1px; +} + +/* end side admin menu */ + +/* comments/plugins bubble in menu */ +#adminmenu #awaiting-mod, +#adminmenu span.update-plugins, +#sidemenu li a span.update-plugins { + position: absolute; + font-family: Helvetica, Arial, sans-serif; + font-size: 7pt; + font-weight: bold; + margin-top: 2px; + margin-left: 2px; + -moz-border-radius: 7px; + -khtml-border-radius: 7px; + -webkit-border-radius: 7px; + border-radius: 7px; +} + +#adminmenu li #awaiting-mod span, +#adminmenu li span.update-plugins span, +#sidemenu li a span.update-plugins span { + float: left; + display: block; + height: 1.6em; + line-height: 1.6em; + padding: 0 6px; +} + +#adminmenu li span.count-0, +#sidemenu li a .count-0 { + display: none; +} +/* end menu stuff */ + +/* comments bubble */ +.post-com-count-wrapper { + min-width: 22px; + font-family: Helvetica, Arial, sans-serif; +} + +.post-com-count { + height: 1.3em; + line-height: 1.1em; + display: block; + text-decoration: none; + padding: 0 0 6px; + cursor: pointer; + background-position: center -80px; + background-repeat: no-repeat; +} + +.post-com-count span { + font-size: 9px; + font-weight: bold; + height: 1.7em; + line-height: 1.70em; + min-width: 0.7em; + padding: 0 6px; + display: inline-block; + cursor: pointer; + -moz-border-radius: 5px; + -khtml-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +strong .post-com-count { + background-position: center -55px; +} + +.post-com-count:hover { + background-position: center -3px; +} + +.column-response .post-com-count { + float: left; + margin-right: 5px; + text-align: center; +} + +.response-links { + float: left; +} + +#the-comment-list .attachment-80x60 { + padding: 4px 8px; +} + +/* Admin Footer */ +#footer { + margin-top: -45px; +} + +#footer, +#footer a { + font-size: 12px; + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-style: italic; +} + +#footer p { + margin: 0; + padding: 15px; + line-height: 15px; +} + +#footer a { + text-decoration: none; +} + +#footer a:hover { + text-decoration: underline; +} + +/* Tables used on comment.php and option/setting pages */ + +.form-table { + border-collapse: collapse; + margin-top: 0.5em; + width: 100%; + margin-bottom: -8px; + clear: both; +} + +.form-table td { + margin-bottom: 9px; + padding: 8px 10px; + line-height: 20px; + font-size: 11px; +} + +.form-table th, +.form-wrap label { + font-weight: normal; + text-shadow: rgba(255,255,255,1) 0 1px 0; +} + +.form-table th { + vertical-align: top; + text-align: left; + padding: 10px; + width: 200px; +} + +.form-table th.th-full { + width: auto; +} + +.form-table div.color-option { + display: block; + clear: both; + margin-top: 12px; +} + +.form-table input.tog { + margin-top: 2px; + margin-right: 2px; + float: left; +} + +.form-table table.color-palette { + vertical-align: bottom; + float: left; + margin: -12px 3px 11px; +} + +.form-table .color-palette td { + border-width: 1px 1px 0; + border-style: solid solid none; + height: 10px; + line-height: 20px; + width: 10px; +} + +textarea.large-text { + width: 99%; +} + +.form-table input.regular-text, +#adduser .form-field input { + width: 25em; +} + +.form-table input.small-text { + width: 50px; +} + +#profile-page .form-table textarea { + width: 500px; + margin-bottom: 6px; +} + +#profile-page .form-table #rich_editing { + margin-right: 5px +} + +.form-table .pre { + padding: 8px; + margin: 0; +} + +.pre { + /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */ + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ +} + +table.form-table td .updated { + font-size: 13px; +} + +/* divs for cats and tags pages */ + +.form-wrap { + margin: 10px 0; + width: 97%; +} + +.form-wrap p, +.form-wrap label { + font-size: 11px; +} + +.form-wrap label { + display: block; + padding: 2px; + font-size: 12px; +} + +.form-field input, +.form-field textarea { + border-style: solid; + border-width: 1px; + width: 95%; +} + +p.description, +.form-wrap p { + margin: 2px 0 5px; +} + +p.help, +p.description, +span.description, +.form-wrap p { + font-size: 12px; + font-style: italic; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; +} + +.form-wrap .form-field { + margin: 0 0 10px; + padding: 8px; +} + +.col-wrap h3 { + margin: 12px 0; + font-size: 1.1em; +} + +.col-wrap p.submit { + margin-top: -10px; +} + +.tagcloud { + width: 97%; + margin: 0 0 40px; + text-align: justify; +} + +.tagcloud h3 { + margin: 2px 0 12px; +} + +/* Post Screen */ +#post-body #normal-sortables { + min-height: 50px; +} + +#post-body #advanced-sortables { + min-height: 20px; +} + +.postbox { + position: relative; + min-width: 255px; + width: 99.5%; +} + +#trackback_url { + width: 99%; +} + +#normal-sortables .postbox .submit { + background: transparent none; + border: 0 none; + float: right; + padding: 0 12px; + margin: 0; +} + +#normal-sortables .postbox #replyrow .submit { + float: none; + margin: 0; + padding: 3px 7px; +} + +#side-sortables .submitbox .submit input, +#side-sortables .submitbox .submit .preview, +#side-sortables .submitbox .submit a.preview:hover { + border: 0 none; +} + +#side-sortables .inside-submitbox .insidebox, +.stuffbox .insidebox { + margin: 11px 0; +} + +#side-sortables .comments-box, +#normal-sortables .comments-box { + border: 0 none; +} + +#side-sortables .comments-box thead th, +#normal-sortables .comments-box thead th { + background: transparent; + padding: 0 7px 4px; + font-style: italic; +} + +#commentsdiv img.waiting { + padding-left: 5px; + vertical-align: middle; +} + +#post-body .tagsdiv #newtag { + margin-right: 5px; + width: 16em; +} + +#side-sortables input#post_password { + width: 94% +} + +#side-sortables .tagsdiv #newtag { + width: 68%; +} + +#post-status-info { + border-width: 0 1px 1px; + border-style: none solid solid; + width: 100%; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-bottom-left-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; +} + +#post-status-info td { + font-size: 11px; +} + +.autosave-info { + padding: 2px 15px 2px 2px; + text-align: right; +} + +#editorcontent #post-status-info { + border: none; +} + +#post-body .wp_themeSkin .mceStatusbar a.mceResize { + display: block; + background: transparent url(images/resize.gif) no-repeat scroll right bottom; + width: 12px; + cursor: se-resize; + margin: 0 2px; + position: relative; + top: 22px; +} + +#linksubmitdiv div.inside, +div.inside { + padding: 0; + margin: 0; +} + +#comment-status-radio p { + margin: 3px 0 5px; +} + +#comment-status-radio input { + margin: 2px 3px 5px 0; + vertical-align: middle; +} + +#comment-status-radio label { + padding: 5px 0; +} + +.tagchecklist { + margin-left: 14px; + font-size: 12px; + overflow: auto; +} + +.tagchecklist strong { + margin-left: -8px; + position: absolute; +} + +.tagchecklist span { + margin-right: 25px; + display: block; + float: left; + font-size: 11px; + line-height: 1.8em; + white-space: nowrap; + cursor: default; +} + +.tagchecklist span a { + margin: 6px 0pt 0pt -9px; + cursor: pointer; + width: 10px; + height: 10px; + display: block; + float: left; + text-indent: -9999px; + overflow: hidden; + position: absolute; +} + +.howto { + font-style: italic; + display: block; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; +} + +.ac_results { + padding: 0; + margin: 0; + list-style: none; + position: absolute; + z-index: 10000; + display: none; + border-width: 1px; + border-style: solid; +} + +.ac_results li { + padding: 2px 5px; + white-space: nowrap; + text-align: left; +} + +.ac_over { + cursor: pointer; +} + +.ac_match { + text-decoration: underline; +} + +#poststuff h2 { + margin-top: 20px; + font-size: 1.5em; + margin-bottom: 15px; + padding: 0 0 3px; + clear: left; +} + +.widget .widget-top, +.postbox h3 { + cursor: move; + -webkit-user-select: none; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; +} + +.postbox .hndle span { + padding: 6px 0; +} + +.postbox .hndle { + cursor: move; +} + +.hndle a { + font-size: 11px; + font-weight: normal; +} + +#dashboard-widgets .meta-box-sortables { + margin: 0 5px; +} + +.postbox .handlediv { + float: right; + width: 23px; + height: 26px; +} + +.sortable-placeholder { + border-width: 1px; + border-style: dashed; + margin-bottom: 20px; +} + +#poststuff h3, +.metabox-holder h3 { + font-size: 12px; + font-weight: bold; + padding: 7px 9px; + margin: 0; + line-height: 1; +} + +.widget, +.postbox, +.stuffbox { + margin-bottom: 20px; + border-width: 1px; + border-style: solid; + line-height: 1; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} + +.widget .widget-top, +.postbox h3, +.postbox h3, +.stuffbox h3 { + -moz-border-radius: 6px 6px 0 0; + -webkit-border-top-right-radius: 6px; + -webkit-border-top-left-radius: 6px; + -khtml-border-top-right-radius: 6px; + -khtml-border-top-left-radius: 6px; + border-top-right-radius: 6px; + border-top-left-radius: 6px; +} + +.postbox.closed h3 { + -moz-border-radius-bottomleft:4px; + -webkit-border-bottom-left-radius: 4px; + -khtml-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright:4px; + -webkit-border-bottom-right-radius: 4px; + -khtml-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; +} + +.postbox table.form-table { + margin-bottom: 0; +} + +.postbox input[type="text"], +.postbox textarea, +.stuffbox input[type="text"], +.stuffbox textarea { + border-width: 1px; + border-style: solid; +} + +#poststuff .inside, +#poststuff .inside p { + font-size: 11px; + margin: 6px 6px 8px; +} + +#poststuff .inside .submitbox p { + margin: 1em 0; +} + +#post-visibility-select { + line-height: 1.5em; + margin-top: 3px; +} + +#poststuff #submitdiv .inside { + margin: 0; +} + +#titlediv, #poststuff .postarea { + margin-bottom: 20px; +} + +#titlediv { + margin-bottom: 20px; +} +#titlediv label { cursor: text; } + +#titlediv div.inside { + margin: 0; +} + +#poststuff #titlewrap { + border: 0; + padding: 0; + +} + +#titlediv #title { + padding: 3px 4px; + border-width: 1px; + border-style: solid; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + font-size: 1.7em; + width: 100%; + outline: none; +} + +#poststuff .inside-submitbox, +#side-sortables .inside-submitbox { + margin: 0 3px; + font-size: 11px; +} + +input#link_description, +input#link_url { + width: 98%; +} + +#pending { + background: 0 none; + border: 0 none; + padding: 0; + font-size: 11px; + margin-top: -1px; +} + +#edit-slug-box { + height: 1em; + margin-top: 8px; + padding: 0 7px; +} + +#editable-post-name-full { + display: none; +} + +#editable-post-name input { + width: 16em; +} + +.postarea h3 label { + float: left; +} + +.postarea #add-media-button { + float: right; + margin: 7px 0pt 0pt; + position: relative; + right: 10px; +} + +#poststuff #editor-toolbar { + height: 30px; +} + +.wp_themeSkin tr.mceFirst td.mceToolbar { + border-width: 0 0 1px; + border-style: none none solid; +} + +#edButtonPreview, +#edButtonHTML { + height: 18px; + margin: 5px 5px 0 0; + padding: 4px 5px 2px; + float: right; + cursor: pointer; + border-width: 1px; + border-style: solid; + -moz-border-radius: 3px 3px 0 0; + -webkit-border-top-right-radius: 3px; + -webkit-border-top-left-radius: 3px; + -khtml-border-top-right-radius: 3px; + -khtml-border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} + +.js .theEditor { + color: white; +} + +#poststuff #edButtonHTML { + margin-right: 15px; +} + +#media-buttons { + cursor: default; + padding: 8px 8px 0; +} + +#media-buttons a { + cursor: pointer; + padding: 0 0 5px 10px; +} + +#media-buttons img, +#submitpost #ajax-loading { + vertical-align: middle; +} + +.submitbox .submit { + text-align: left; + padding: 12px 10px 10px; + font-size: 11px; +} + +.submitbox .submitdelete { + border-bottom-width: 1px; + border-bottom-style: solid; + text-decoration: none; + padding: 1px 2px; +} + +.inside-submitbox #post_status { + margin: 2px 0 2px -2px; +} + +.submitbox .submit a:hover { + border-bottom-width: 1px; + border-bottom-style: solid; +} + +.submitbox .submit input { + margin-bottom: 8px; + margin-right: 4px; + padding: 6px; +} + +#post-status-select { + line-height: 2.5em; + margin-top: 3px; +} + +/* Categories */ + +#category-adder { + margin-left: 120px; + padding: 4px 0; +} + +#category-adder h4 { + margin: 0 0 8px; +} + +#side-sortables #category-adder { + margin: 0; +} + +#post-body #category-add input, #category-add select { + width: 30%; +} + +#side-sortables #category-add input { + width: 94%; +} + +#side-sortables #category-add select { + width: 100%; +} + +#category-add input#category-add-sumbit { + width: auto; +} + +#post-body ul#category-tabs { + float: left; + width: 120px; + text-align: right; + /* Negative margin for the sake of those without JS: all tabs display */ + margin: 0 -120px 0 5px; + padding: 0; +} + +#post-body ul#category-tabs li { + padding: 8px; +} + +#post-body ul#category-tabs li.tabs { + -moz-border-radius: 3px 0 0 3px; + -webkit-border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + -khtml-border-top-left-radius: 3px; + -khtml-border-bottom-left-radius: 3px; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} + +#post-body ul#category-tabs li.tabs a { + font-weight: bold; + text-decoration: none; +} + +#categorydiv div.tabs-panel, +#linkcategorydiv div.tabs-panel { + height: 200px; + overflow: auto; + padding: 0.5em 0.9em; + border-style: solid; + border-width: 1px; +} + +#post-body #categorydiv div.tabs-panel, +#post-body #linkcategorydiv div.tabs-panel { + margin: 0 5px 0 125px; +} + +#side-sortables #category-tabs li { + display: inline; + padding-right: 8px; +} + +#side-sortables #category-tabs a { + text-decoration: none; +} + +#side-sortables #category-tabs { + margin-bottom: 3px; +} + +#categorydiv ul, +#linkcategorydiv ul { + list-style: none; + padding: 0; + margin: 0; +} + +#categorydiv ul.categorychecklist ul, +#linkcategorydiv ul.categorychecklist ul { + margin-left: 18px; +} + +ul.categorychecklist li { + margin: 0; + padding: 0; + line-height: 19px; +} + +#category-adder h4 { + margin-top: 4px; + margin-bottom: 0px; +} + +#categorydiv .tabs-panel { + border-width: 3px; + border-style: solid; +} + +ul#category-tabs { + margin-top: 12px; +} + +ul#category-tabs li.tabs { + border-style: solid solid none; + border-width: 1px 1px 0; +} + +#post-body #category-tabs li.tabs { + border-style: solid none solid solid; + border-width: 1px 0 1px 1px; + margin-right: -1px; +} + +ul#category-tabs li { + padding: 5px 8px; + -moz-border-radius: 3px 3px 0 0; + -webkit-border-top-left-radius: 3px; + -webkit-border-top-right-radius: 3px; + -khtml-border-top-left-radius: 3px; + -khtml-border-top-right-radius: 3px; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} + +/* positioning etc. */ + +form#tags-filter { + position: relative; +} + +p.search-box { + float: right; + margin: -5px 0 0; +} + +.screen-per-page { + width: 3em; +} + +#posts-filter fieldset { + float: left; + margin: 0 1.5ex 1em 0; + padding: 0; +} + +#posts-filter fieldset legend { + padding: 0 0 .2em 1px; +} + +/* Edit posts */ + +td.post-title strong, td.plugin-title strong { + display: block; + margin-bottom: .2em; +} + +td.post-title p, td.plugin-title p { + margin: 6px 0; +} + +td.plugin-title { + white-space: nowrap; +} + +/* Global classes */ + +.wp-hidden-children .wp-hidden-child, +.ui-tabs-hide, +#codepress-off { + display: none; +} + +.commentlist .avatar { + vertical-align: text-top; +} + +.defaultavatarpicker .avatar { + margin: 2px 0; + vertical-align: middle; +} + +body.wp-admin { + min-width: 785px; +} + +.view-switch { + float: right; + margin: 6px 8px 0; +} + +.view-switch a { + text-decoration: none; +} + +.filter { + float: left; + margin: -5px 0 0 10px; +} + +.filter .subsubsub { + margin-left: -10px; + margin-top: 13px; +} + +#the-comment-list td.comment p.comment-author { + margin-top: 0; + margin-left: 0; +} + +#the-comment-list p.comment-author img { + float: left; + margin-right: 8px; +} + +#the-comment-list p.comment-author strong a { + border: none; +} + +#the-comment-list td { + vertical-align: top; +} + +#the-comment-list td.comment { + word-wrap: break-word; +} + +#the-comment-list .check-column { + padding-top: 8px; +} + +#templateside ul li a { + text-decoration: none; +} + +.indicator-hint { + padding-top: 8px; +} + +#display_name { + width: 15em; +} + +.tablenav .delete { + margin-right: 20px; +} + +td.action-links, +th.action-links { + text-align: right; +} + +/* Diff */ + +table.diff { + width: 100%; +} + +table.diff col.content { + width: 50%; +} + +table.diff tr { + background-color: transparent; +} + +table.diff td, table.diff th { + padding: .5em; + font-family: Consolas, Monaco, Courier, monospace; + border: none; +} + +table.diff .diff-deletedline del, table.diff .diff-addedline ins { + text-decoration: none; +} + +#wp-word-count { + display: block; + padding: 2px 7px; +} + +fieldset { + border: 0; + padding: 0; + margin: 0; +} + +.tool-box { + margin: 15px 0 35px; +} + +.tool-box .buttons { + margin: 15px 0; +} + +.tool-box .title { + margin: 8px 0; + font: 18px/24px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; +} + +.pressthis a { + font-size: 1.2em; +} + +#wp_editbtns, +#wp_gallerybtns { + padding: 2px; + position: absolute; + display: none; + z-index: 999998; +} + +#wp_editimgbtn, +#wp_delimgbtn, +#wp_editgallery, +#wp_delgallery { + margin: 2px; + padding: 2px; + border-width: 1px; + border-style: solid; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.settings-toggle { + text-align: right; + margin: 5px 7px 15px 0; + font-size: 12px; +} + +.settings-toggle h3 { + margin: 0; +} + +#timestampdiv select { + height: 20px; + line-height: 14px; + padding: 0; + vertical-align: top; +} + +#jj, #hh, #mn { + width: 2em; + padding: 1px; + font-size: 12px; +} + +#aa { + width: 3.4em; + padding: 1px; + font-size: 12px; +} + +.curtime #timestamp { + background-repeat: no-repeat; + background-position: left top; + padding-left: 18px; +} + +#timestampdiv { + padding-top: 5px; + line-height: 23px; +} + +#timestampdiv p { + margin: 8px 0 6px; +} + +#timestampdiv input { + border-width: 1px; + border-style: solid; +} + +/* media popup 0819 */ +#sidemenu { + margin: -30px 15px 0 315px; + list-style: none; + position: relative; + float: right; + padding-left: 10px; + font-size: 12px; +} + +#sidemenu a { + padding: 0 7px; + display: block; + float: left; + line-height: 28px; + border-top-width: 1px; + border-top-style: solid; + border-bottom-width: 1px; + border-bottom-style: solid; +} + +#sidemenu li { + display: inline; + line-height: 200%; + list-style: none; + text-align: center; + white-space: nowrap; + margin: 0; + padding: 0; +} + +#sidemenu a.current { + font-weight: normal; + padding-left: 6px; + padding-right: 6px; + -moz-border-radius: 4px 4px 0 0; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -khtml-border-top-left-radius: 4px; + -khtml-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-width: 1px; + border-style: solid; +} + +#sidemenu { + margin: -30px 15px 0 315px; + list-style: none; + position: relative; + float: right; + padding-left: 10px; + font-size: 12px; +} + +#sidemenu a { + padding: 0 7px; + display: block; + float: left; + line-height: 28px; + border-top-width: 1px; + border-top-style: solid; + border-bottom-width: 1px; + border-bottom-style: solid; +} + +#sidemenu li a .count-0 { + display: none; +} + +/* reply to comments */ +#replyrow { + font-size: 11px; +} + +#replyrow input { + border-width: 1px; + border-style: solid; +} + +#replyrow td { + padding: 2px; +} + +#replyrow #editorcontainer { + border: 0 none; +} + +#replysubmit { + margin: 0; + padding: 3px 7px; +} + +#replysubmit img.waiting, +.inline-edit-save img.waiting { + padding: 2px 10px 0; + vertical-align: top; +} + +#replysubmit .button { + margin-right: 5px; +} + +#replyrow #editor-toolbar { + display: none; +} + +#replyhead { + font-size: 12px; + font-weight: bold; + padding: 2px 10px 4px; +} + +#edithead .inside { + float: left; + padding: 3px 0 2px 5px; + margin: 0; + text-align: center; + font-size: 11px; +} + +#edithead .inside input { + width: 180px; + font-size: 11px; +} + +#edithead label { + padding: 2px 0; +} + +#replycontainer { + padding: 5px; + border: 0 none; + height: 120px; + overflow: hidden; + position: relative; +} + +#replycontent { + resize: none; + margin: 0; + width: 100%; + height: 100%; + padding: 0; + line-height: 150%; + border: 0 none; + outline: none; + font-size: 12px; +} + +#replyrow #ed_reply_toolbar { + margin: 0; + padding: 2px 3px; +} + +/* show/hide settings */ +#screen-meta { + position: relative; + clear: both; +} + +#screen-meta-links { + margin: 0 9px 0 0; +} + +#screen-meta .screen-reader-text { + visibility: hidden; +} + +#screen-options-link-wrap, +#contextual-help-link-wrap { + float: right; + background: transparent url( images/screen-options-left.gif ) no-repeat 0 0; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + height: 22px; + padding: 0; + margin: 0 6px 0 0; +} + +#screen-meta a.show-settings { + text-decoration: none; + z-index: 1; + padding: 0 16px 0 6px; + height: 22px; + line-height: 22px; + font-size: 10px; + display: block; + background-repeat: no-repeat; + background-position: right bottom; +} + +#screen-meta a.show-settings { + background-image: url( images/screen-options-right.gif ); +} + +#screen-meta a.show-settings:hover { + text-decoration: none; +} + +#screen-options-wrap h5, +#contextual-help-wrap h5 { + margin: 8px 0; + font-size: 13px; +} + +#screen-options-wrap, +#contextual-help-wrap { + border-style: none solid solid; + border-top: 0 none; + border-width: 0 1px 1px; + margin: 0 15px; + padding: 8px 12px 12px; + -moz-border-radius: 0 0 0 4px; + -webkit-border-bottom-left-radius: 4px; + -khtml-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; +} + +.metabox-prefs label { + padding-right: 15px; + white-space: nowrap; + line-height: 30px; +} + +.metabox-prefs label input { + margin: 0 5px 0 2px; +} + +.metabox-prefs label a { + display: none; +} + +/* Inline Editor + .quick-edit* is for Quick Edit + .bulk-edit* is for Bulk Edit + .inline-edit* is for everything +*/ +/* Layout */ +tr.inline-edit-row td { + padding: 0 0.5em; +} + +#wpbody-content .inline-edit-row fieldset { + font-size: 12px; + float: left; + margin: 0; + padding: 0; + width: 100%; +} + +#wpbody-content .inline-edit-row fieldset .inline-edit-col { + padding: 0 0.5em; +} + +#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col { + border-width: 0 0 0 1px; + border-style: none none none solid; +} + +#wpbody-content .quick-edit-row-post .inline-edit-col-left { + width: 40%; +} + +#wpbody-content .quick-edit-row-post .inline-edit-col-right { + width: 39%; +} + +#wpbody-content .inline-edit-row-post .inline-edit-col-center { + width: 20%; +} + +#wpbody-content .quick-edit-row-page .inline-edit-col-left { + width: 50%; +} + +#wpbody-content .quick-edit-row-page .inline-edit-col-right, +#wpbody-content .bulk-edit-row-post .inline-edit-col-right { + width: 49%; +} + +#wpbody-content .bulk-edit-row .inline-edit-col-left { + width: 30%; +} + +#wpbody-content .bulk-edit-row-page .inline-edit-col-right { + width: 69%; +} + +#wpbody-content .bulk-edit-row .inline-edit-col-bottom { + float: right; + width: 69%; +} + +#wpbody-content .inline-edit-row-page .inline-edit-col-right, +#owpbody-content .bulk-edit-row-post .inline-edit-col-right { + margin-top: 27px; +} + +.inline-edit-row fieldset .inline-edit-group { + clear: both; +} + +.inline-edit-row fieldset .inline-edit-group:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.inline-edit-row p.submit { + clear: both; + padding: 0.5em; + margin: 0.5em 0 0; +} + +.inline-edit-row span.error { + line-height: 22px; + margin: 0 15px; + padding: 3px 5px; +} + +/* Positioning */ +.inline-edit-row h4 { + margin: .2em 0; + padding: 0; + line-height: 23px; +} +.inline-edit-row fieldset span.title, +.inline-edit-row fieldset span.checkbox-title { + margin: 0; + padding: 0; + line-height: 27px; +} + +.inline-edit-row fieldset label, +.inline-edit-row fieldset span.inline-edit-categories-label { + display: block; + margin: .2em 0; +} + +.inline-edit-row fieldset label.inline-edit-tags { + margin-top: 0; +} + +.inline-edit-row fieldset label.inline-edit-tags span.title { + margin: .2em 0; +} + +.inline-edit-row fieldset label span.title { + display: block; + float: left; + width: 5em; +} + +.inline-edit-row fieldset label span.input-text-wrap { + display: block; + margin-left: 5em; +} + +.quick-edit-row-post fieldset.inline-edit-col-right label span.title { + width: auto; + padding-right: 0.5em; +} + +.inline-edit-row .input-text-wrap input[type=text] { + width: 100%; +} + +.inline-edit-row fieldset label input[type=checkbox] { + vertical-align: text-bottom; +} + +.inline-edit-row fieldset label textarea { + width: 100%; + height: 4em; +} + +#wpbody-content .bulk-edit-row fieldset .inline-edit-group label { + max-width: 50%; +} + +#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child { + margin-right: 0.5em +} + +/* Styling */ +.inline-edit-row h4 { + text-transform: uppercase; +} + +.inline-edit-row fieldset span.title, +.inline-edit-row fieldset span.checkbox-title { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-style: italic; + line-height: 1.8em; +} + +/* Specific Elements */ +.inline-edit-row fieldset input[type="text"], +.inline-edit-row fieldset textarea { + border-style: solid; + border-width: 1px; +} + +.inline-edit-row fieldset .inline-edit-date { + float: left; +} + +.inline-edit-row fieldset input[name=jj], +.inline-edit-row fieldset input[name=hh], +.inline-edit-row fieldset input[name=mn] { + font-size: 12px; + width: 2.1em; +} + +.inline-edit-row fieldset input[name=aa] { + font-size: 12px; + width: 3.5em; +} + +.inline-edit-row fieldset label input.inline-edit-password-input { + width: 8em; +} + +.inline-edit-row .catshow, +.inline-edit-row .cathide { + cursor: pointer; +} + +ul.cat-checklist { + height: 12em; + border-style: solid; + border-width: 1px; + overflow-y: scroll; + padding: 0 5px; + margin: 0; +} + +#bulk-titles { + display: block; + height: 12em; + border-style: solid; + border-width: 1px; + overflow-y: scroll; + padding: 0 5px; + margin: 0 0 5px; +} + +.inline-edit-row fieldset ul.cat-checklist li, +.inline-edit-row fieldset ul.cat-checklist input { + margin: 0; +} + +.inline-edit-row fieldset ul.cat-checklist label, +.inline-edit-row .catshow, +.inline-edit-row .cathide, +.inline-edit-row #bulk-titles div { + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + font-style: normal; + font-size: 11px; +} + +table .inline-edit-row fieldset ul.cat-hover { + height: auto; + max-height: 30em; + overflow-y: auto; + position: absolute; +} + +.inline-edit-row fieldset label input.inline-edit-menu-order-input { + width: 3em; +} + +.inline-edit-row fieldset label input.inline-edit-slug-input { + width: 75%; +} + +.quick-edit-row-post fieldset label.inline-edit-status { + float: left; +} + +#bulk-titles { + line-height: 140%; +} +#bulk-titles div { + margin: 0.2em 0.3em; +} + +#bulk-titles div a { + cursor: pointer; + display: block; + float: left; + height: 10px; + margin: 3px 3px 0 -2px; + overflow: hidden; + position: relative; + text-indent: -9999px; + width: 10px; +} + +/* Media library */ +#wpbody-content #media-items .describe { + border-collapse: collapse; + width: 100%; + border-top-style: solid; + border-top-width: 1px; + clear: both; + cursor: default; + padding: 5px; +} + +#wpbody-content .describe th { + vertical-align: top; + text-align: left; + padding: 10px; + width: 140px; +} + +#wpbody-content .describe .media-item-info tr { + background-color: transparent; +} + +#wpbody-content .describe .media-item-info td { + padding: 4px 10px 0; +} + +.describe .media-item-info .A1B1 { + padding: 0 15px 8px 0; +} + +#wpbody-content .filename { + padding: 0 10px; +} + +#wpbody-content .media-item .thumbnail { + max-height: 128px; + max-width: 128px; +} + +#wpbody-content #async-upload-wrap a { + display: none; +} + +.media-upload-form td label { + margin-right: 6px; + margin-left: 2px; +} + +.media-upload-form .align .field label { + display: inline; + padding: 0 0 0 22px; + margin: 0 1em 0 0; + font-weight: bold; +} + +.media-upload-form tr.image-size label { + margin: 0 0 0 3px; + font-weight: bold; +} + +.media-upload-form th.label label { + font-weight: bold; + margin: 0.5em; + font-size: 13px; +} + +.media-upload-form th.label label span { + padding: 0 5px; +} + +abbr.required { + border: medium none; + text-decoration: none; +} + +#wpbody-content .describe input[type="text"], +#wpbody-content .describe textarea { + width: 460px; +} + +#wpbody-content .describe p.help { + margin: 0; + padding: 0 0 0 5px; +} + +.describe-toggle-on, +.describe-toggle-off { + display: block; + line-height: 36px; + float: right; + margin-right: 20px; +} + +.describe-toggle-off { + display: none; +} + +#wpbody-content .media-item { + border-bottom-style: solid; + border-bottom-width: 1px; + min-height: 36px; + position: relative; + width: 100%; +} + +#wpbody-content .media-single .media-item { + border-bottom-style: none; + border-bottom-width: 0; +} + +#wpbody-content #media-items { + border-style: solid solid none; + border-width: 1px; + width: 670px; +} + +#wpbody-content #media-items .filename { + line-height: 36px; + overflow: hidden; +} + +.media-item .pinkynail { + float: left; + margin: 2px; + max-width: 40px; + max-height: 32px; +} + +.media-item .startopen, +.media-item .startclosed { + display: none; +} + +.media-item .original { + position: relative; + height: 34px; + text-align: center; +} + +.media-item .percent { + font-weight: bold; +} + +.crunching { + display: block; + line-height: 32px; + text-align: right; + margin-right: 5px; +} + +button.dismiss { + position: absolute; + top: 7px; + right: 5px; + z-index: 4; + width: 8em; +} + +.file-error { + float: left; + font-weight: bold; + padding: 10px; +} + +.progress { + position: relative; + margin-bottom: -36px; + height: 36px; +} + +.bar { + width: 0; + height: 100%; + border-right-width: 3px; + border-right-style: solid; +} + +.upload-php .fixed .column-parent { + width: 25%; +} + +/* find posts */ +.find-box { + width: 500px; + height: 300px; + overflow: hidden; + padding: 33px 5px 40px; + position: absolute; + z-index: 1000; +} + +.find-box-head { + cursor: move; + font-weight: bold; + height: 2em; + line-height: 2em; + padding: 1px 12px; + position: absolute; + top: 5px; + width: 100%; +} + +.find-box-inside { + overflow: auto; + width: 100%; + height: 100%; +} + +.find-box-search { + padding: 12px; + border-width: 1px; + border-style: none none solid; +} + +#find-posts-response { + margin: 8px 0; + padding: 0 1px; +} + +#find-posts-response table { + width: 100%; +} + +#find-posts-response .found-radio { + padding: 5px 0 0 8px; + width: 15px; +} + +.find-box-buttons { + width: 480px; + margin: 8px; +} + +.find-box-search label { + padding-right: 6px; +} + +.find-box #resize-se { + position: absolute; + right: 1px; + bottom: 1px; +} + +/* favorite-actions */ +#favorite-actions { + float: right; + margin: 11px 12px 0; + min-width: 130px; + position: relative; +} + +#favorite-first { + -moz-border-radius: 12px; + -khtml-border-radius: 12px; + -webkit-border-radius: 12px; + border-radius: 12px; + line-height: 15px; + padding: 3px 30px 4px 12px; + border-width: 1px; + border-style: solid; +} + +#favorite-inside { + margin: 0 0 0 0px; + padding: 0 1px 6px 1px; + border-width: 1px; + border-style: solid; + position: absolute; + z-index: 11; + display: none; + -moz-border-radius: 0 0 12px 12px; + -webkit-border-bottom-right-radius: 12px; + -webkit-border-bottom-left-radius: 12px; + -khtml-border-bottom-right-radius: 12px; + -khtml-border-bottom-left-radius: 12px; + border-bottom-right-radius: 12px; + border-bottom-left-radius: 12px; +} + +#favorite-actions a { + display: block; + text-decoration: none; + font-size: 11px; +} + +#favorite-inside a { + padding: 3px 5px 3px 10px; +} + +#favorite-toggle { + height: 22px; + position: absolute; + right: 0; + top: 1px; + width: 28px; +} + +#favorite-actions .slide-down { + -moz-border-radius: 12px 12px 0 0; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -khtml-border-bottom-right-radius: 0; + -khtml-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-bottom-width: 1px; + border-bottom-style: solid; +} + +#utc-time, #local-time { + padding-left: 25px; + font-style: italic; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; +} + +ul#dismissed-updates { + display: none; +} +form.upgrade { + margin-top: 8px; +} + +form.upgrade .hint { + font-style: italic; + font-size: 85%; + margin: -0.5em 0 2em 0; +} + +#poststuff .inside .the-tagcloud { + margin: 5px 0 10px; + padding: 8px; + border-width: 1px; + border-style: solid; + line-height: 1.8em; + word-spacing: 3px; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; +} + +br.clear { + height: 2px; + line-height: 2px; +} + +.swfupload { + margin: 5px 10px; + vertical-align: middle; +} + +/* table.fixed column width */ +table.fixed { + table-layout: fixed; +} + +.fixed .column-rating, +.fixed .column-visible { + width: 8%; +} + +.fixed .column-date, +.fixed .column-parent, +.fixed .column-links { + width: 10%; +} + +.fixed .column-response, +.fixed .column-author, +.fixed .column-categories, +.fixed .column-tags, +.fixed .column-rel, +.fixed .column-role { + width: 15%; +} + +.fixed .column-comments { + width: 4em; + padding-top: 8px; +} + +.fixed .column-slug { + width: 25%; +} + +.fixed .column-posts { + width: 10%; +} + +.fixed .column-icon { + width: 80px; +} + +#commentsdiv .fixed .column-author, +#comments-form .fixed .column-author { + width: 20%; +} + +.widefat th, +.widefat td { + overflow: hidden; +} + +.widefat td p { + margin: 2px 0 0.8em; +} + +table .vers, +table .column-visible, +table .column-rating { + text-align: center; +} + +.icon32 { + float: left; + height: 36px; + margin: 14px 6px 0 0; + width: 36px; +} + +.key-labels label { + line-height: 24px; +} + +.subtitle { + font-size: 0.75em; + line-height: 1; + padding-left: 25px; +} + +ol { + list-style-type: decimal; + margin-left: 2em; +} + +.postbox-container { + float: left; + padding-right: 0.5%; +} + +.postbox-container .meta-box-sortables { + min-height: 300px; +} + +.temp-border { + border: 1px dotted #ccc; +} + +.columns-prefs label { + padding: 0 5px; +} + +.theme-install-php h4, +.plugin-install-php h4 { + margin: 2.5em 0 8px; +} + +p.install-help { + margin: 8px 0; + font-style: italic; +} + +p.popular-tags { + -moz-border-radius: 8px; + -khtml-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + border-width: 1px; + border-style: solid; + line-height: 2em; + padding: 8px 12px 12px; + text-align: justify; +} + +p.popular-tags a { + padding: 0 3px; +} + +.stuffbox .editcomment { + clear: none; +} + +.ajax-feedback { + visibility: hidden; + vertical-align: bottom; +} + +.tagsdiv .newtag { + width: 180px; +} + +.tagsdiv .the-tags { + display: block; + height: 60px; + margin: 0 auto; + overflow: auto; + width: 260px; +} + +#post-body-content .tagsdiv .the-tags { + margin: 0 5px; +} + +label, +#your-profile label + a { + vertical-align: middle; +} + +#misc-publishing-actions label { + vertical-align: baseline; +} + +.plugin-update-tr .update-message { + margin: 5px; + padding: 3px 5px; + border-width: 1px; + border-style: solid; + -moz-border-radius: 5px; + -khtml-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +.add-new-h2 { + font-style: normal; + margin: 0 6px; + position: relative; + top: -3px; +} + +.describe .image-editor { + vertical-align: top; +} + +.imgedit-wrap { + position: relative; +} + +.imgedit-settings p { + margin: 8px 0; +} + +.describe .imgedit-wrap table td { + vertical-align: top; + padding-top: 0; +} + +.imgedit-wrap p, +.describe .imgedit-wrap table td { + font-size: 11px; + line-height: 18px; +} + +.describe .imgedit-wrap table td.imgedit-settings { + padding: 0 5px; +} + +td.imgedit-settings input { + vertical-align: middle; +} + +.imgedit-wait { + position: absolute; + top: 0; + background: #FFFFFF url(images/wpspin_light.gif) no-repeat scroll 22px 10px; + opacity: 0.7; + filter: alpha(opacity=70); + width: 100%; + height: 500px; + display: none; +} + +.media-disabled, +.imgedit-settings .disabled { + color: grey; +} + +.imgedit-wait-spin { + padding: 0 4px 4px; + vertical-align: bottom; + visibility: hidden; +} + +.imgedit-menu { + margin: 0 0 12px; + min-width: 300px; +} + +.imgedit-menu div { + float: left; + width: 32px; + height: 32px; + -moz-border-radius: 4px; + -khtml-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + border-width: 1px; + border-style: solid; +} + +.imgedit-crop-wrap { + position: relative; +} + +.imgedit-crop { + background: transparent url(images/imgedit-icons.png) no-repeat scroll -9px -31px; + margin: 0 8px 0 0; +} + +.imgedit-crop.disabled:hover { + background-position: -9px -31px; +} + +.imgedit-crop:hover { + background-position: -9px -1px; +} + +.imgedit-rleft { + background: transparent url(images/imgedit-icons.png) no-repeat scroll -46px -31px; + margin: 0 3px; +} + +.imgedit-rleft.disabled:hover { + background-position: -46px -31px; +} + +.imgedit-rleft:hover { + background-position: -46px -1px; +} + +.imgedit-rright { + background: transparent url(images/imgedit-icons.png) no-repeat scroll -77px -31px; + margin: 0 8px 0 3px; +} + +.imgedit-rright.disabled:hover { + background-position: -77px -31px; +} + +.imgedit-rright:hover { + background-position: -77px -1px; +} + +.imgedit-flipv { + background: transparent url(images/imgedit-icons.png) no-repeat scroll -115px -31px; + margin: 0 3px; +} + +.imgedit-flipv.disabled:hover { + background-position: -115px -31px; +} + +.imgedit-flipv:hover { + background-position: -115px -1px; +} + +.imgedit-fliph { + background: transparent url(images/imgedit-icons.png) no-repeat scroll -147px -31px; + margin: 0 8px 0 3px; +} + +.imgedit-fliph.disabled:hover { + background-position: -147px -31px; +} + +.imgedit-fliph:hover { + background-position: -147px -1px; +} + +.imgedit-undo { + background: transparent url(images/imgedit-icons.png) no-repeat scroll -184px -31px; + margin: 0 3px; +} + +.imgedit-undo.disabled:hover { + background-position: -184px -31px; +} + +.imgedit-undo:hover { + background-position: -184px -1px; +} + +.imgedit-redo { + background: transparent url(images/imgedit-icons.png) no-repeat scroll -215px -31px; + margin: 0 8px 0 3px; +} + +.imgedit-redo.disabled:hover { + background-position: -215px -31px; +} + +.imgedit-redo:hover { + background-position: -215px -1px; +} + +.imgedit-applyto img { + margin: 0 8px 0 0; +} + +.imgedit-group-top { + margin: 5px 0; +} + +.imgedit-applyto .imgedit-label { + padding: 2px 0 0; + display: block; +} + +.imgedit-help { + display: none; + font-style: italic; + margin-bottom: 8px; +} + +.imgedit-help ul li { + font-size: 11px; +} + +a.imgedit-help-toggle { + text-decoration: none; +} + +#wpbody-content .imgedit-response div { + width: 600px; + margin: 8px; +} + +.form-table td.imgedit-response { + padding: 0; +} + +.imgedit-submit { + margin: 8px 0; +} + +.imgedit-submit-btn { + margin-left: 20px; +} + +.imgedit-wrap .nowrap { + white-space: nowrap; +} + +span.imgedit-scale-warn { + color: red; + font-size: 20px; + font-style: normal; + visibility: hidden; + vertical-align: middle; +} + +.imgedit-group { + border-width: 1px; + border-style: solid; + -moz-border-radius: 8px; + -khtml-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + margin-bottom: 8px; + padding: 2px 10px; +} + +#dashboard_recent_comments div.undo { + border-top-style: solid; + border-top-width: 1px; + margin: 0 -10px; + padding: 3px 8px; + font-size: 11px; +} + +.trash-undo-inside, +.spam-undo-inside { + margin: 1px 8px 1px 0; + line-height: 16px; +} + +.spam-undo-inside .avatar, +.trash-undo-inside .avatar { + height: 20px; + width: 20px; + margin-right: 8px; + vertical-align: middle; +} + +/* tag hints */ +.taghint { + color: #aaa; + margin: 14px 0 -17px 8px; +} + +#poststuff .tagsdiv .howto { + margin: 0 0 6px 8px; +} + +.ajaxtag .newtag { + background: transparent; + position: relative; +} + +#broken-themes { + text-align: left; + width: 50%; + border-spacing: 3px; + padding: 3px; +} + +.describe .del-link { + padding-left: 5px; +} + +.comment-ays { + margin-bottom: 0; + border-style: solid; + border-width: 1px; +} + +.comment-ays th { + border-right-style: solid; + border-right-width: 1px; +} diff --git a/wp-app.php b/wp-app.php index 11f4ec77..a7495f43 100644 --- a/wp-app.php +++ b/wp-app.php @@ -17,15 +17,9 @@ define('APP_REQUEST', true); /** Set up WordPress environment */ require_once('./wp-load.php'); -/** Post Template API */ -require_once(ABSPATH . WPINC . '/post-template.php'); - /** Atom Publishing Protocol Class */ require_once(ABSPATH . WPINC . '/atomlib.php'); -/** Feed Handling API */ -require_once(ABSPATH . WPINC . '/feed.php'); - /** Admin Image API for metadata updating */ require_once(ABSPATH . '/wp-admin/includes/image.php'); @@ -69,22 +63,6 @@ function log_app($label,$msg) { } } -if ( !function_exists('wp_set_current_user') ) : -/** - * @ignore - */ -function wp_set_current_user($id, $name = '') { - global $current_user; - - if ( isset($current_user) && ($id == $current_user->ID) ) - return $current_user; - - $current_user = new WP_User($id, $name); - - return $current_user; -} -endif; - /** * Filter to add more post statuses. * @@ -355,6 +333,7 @@ class AtomServer { $entries_url = esc_attr($this->get_entries_url()); $categories_url = esc_attr($this->get_categories_url()); $media_url = esc_attr($this->get_attachments_url()); + $accepted_media_types = ''; foreach ($this->media_content_types as $med) { $accepted_media_types = $accepted_media_types . "" . $med . ""; } @@ -780,7 +759,7 @@ EOD; } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); - $location = get_option ('upload_path') . '/' . $location; + $location = get_option ('upload_path') . '/' . $location; $filetype = wp_check_filetype($location); if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) @@ -790,9 +769,9 @@ EOD; header('Content-Type: ' . $entry['post_mime_type']); header('Connection: close'); - if ($fp = fopen($location, "rb")) { - status_header('200'); - header('Content-Type: ' . $entry['post_mime_type']); + if ($fp = fopen($location, "rb")) { + status_header('200'); + header('Content-Type: ' . $entry['post_mime_type']); header('Connection: close'); while(!feof($fp)) { @@ -877,7 +856,7 @@ EOD; * @return string */ function get_entries_url($page = null) { - if($GLOBALS['post_type'] == 'attachment') { + if ( isset($GLOBALS['post_type']) && ( $GLOBALS['post_type'] == 'attachment' ) ) { $path = $this->MEDIA_PATH; } else { $path = $this->ENTRIES_PATH; @@ -1240,7 +1219,7 @@ list($content_type, $content) = prep_atom_text_construct(get_the_content()); ?> log_app('Status','204: No Content'); header('Content-Type: text/plain'); status_header('204'); - echo "Deleted."; + echo "Moved to Trash."; exit; } @@ -1501,13 +1480,13 @@ EOD; // If Basic Auth is working... if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']); - } - $user = wp_authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); - if ( $user && !is_wp_error($user) ) { - wp_set_current_user($user->ID); - log_app("authenticate()", $user->user_login); - return true; + $user = wp_authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); + if ( $user && !is_wp_error($user) ) { + wp_set_current_user($user->ID); + log_app("authenticate()", $user->user_login); + return true; + } } return false; diff --git a/wp-comments-post.php b/wp-comments-post.php index 8289bb44..923b03b9 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -17,7 +17,7 @@ require( dirname(__FILE__) . '/wp-load.php' ); nocache_headers(); -$comment_post_ID = (int) $_POST['comment_post_ID']; +$comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0; $status = $wpdb->get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); @@ -30,6 +30,9 @@ if ( empty($status->comment_status) ) { } elseif ( in_array($status->post_status, array('draft', 'pending') ) ) { do_action('comment_on_draft', $comment_post_ID); exit; +} elseif ( 'trash' == $status->post_status ) { + do_action('comment_on_trash', $comment_post_ID); + exit; } else { do_action('pre_comment_on_post', $comment_post_ID); } diff --git a/wp-config-sample.php b/wp-config-sample.php index 2e316c77..c884ff0c 100644 --- a/wp-config-sample.php +++ b/wp-config-sample.php @@ -68,7 +68,7 @@ define ('WPLANG', ''); /* That's all, stop editing! Happy blogging. */ -/** WordPress absolute path to the Wordpress directory. */ +/** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); diff --git a/wp-content/plugins/akismet/akismet.php b/wp-content/plugins/akismet/akismet.php index a2402a10..2460b707 100644 --- a/wp-content/plugins/akismet/akismet.php +++ b/wp-content/plugins/akismet/akismet.php @@ -3,12 +3,12 @@ Plugin Name: Akismet Plugin URI: http://akismet.com/ Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a WordPress.com API key to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <?php akismet_counter(); ?> in your template. See also: WP Stats plugin. -Version: 2.2.6 +Version: 2.2.7 Author: Matt Mullenweg Author URI: http://ma.tt/ */ -define('AKISMET_VERSION', '2.2.6'); +define('AKISMET_VERSION', '2.2.7'); // If you hardcode a WP.com API key here, all key config screens will be hidden if ( defined('WPCOM_API_KEY') ) @@ -315,6 +315,10 @@ function akismet_get_server_connectivity( $cache_timeout = 86400 ) { // Returns true if server connectivity was OK at the last check, false if there was a problem that needs to be fixed. function akismet_server_connectivity_ok() { + // skip the check on WPMU because the status page is hidden + global $wpcom_api_key; + if ( $wpcom_api_key ) + return true; $servers = akismet_get_server_connectivity(); return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) ); } @@ -403,7 +407,8 @@ function akismet_http_post($request, $host, $path, $port = 80, $ip=null) { // filter handler used to return a spam result to pre_comment_approved function akismet_result_spam( $approved ) { // bump the counter here instead of when the filter is added to reduce the possibility of overcounting - update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 ); + if ( $incr = apply_filters('akismet_spam_count_incr', 1) ) + update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr ); return 'spam'; } @@ -442,7 +447,8 @@ function akismet_auto_check_comment( $comment ) { if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' ) { // akismet_result_spam() won't be called so bump the counter here - update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 ); + if ( $incr = apply_filters('akismet_spam_count_incr', 1) ) + update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr ); die; } } diff --git a/wp-content/plugins/akismet/readme.txt b/wp-content/plugins/akismet/readme.txt index 9b2241d8..c3b11769 100644 --- a/wp-content/plugins/akismet/readme.txt +++ b/wp-content/plugins/akismet/readme.txt @@ -1,8 +1,8 @@ === Akismet === -Contributors: matt, ryan, andy, mdawaffe, tellyworth +Contributors: matt, ryan, andy, mdawaffe, tellyworth, automattic Tags: akismet, comments, spam Requires at least: 2.0 -Tested up to: 2.8.4 +Tested up to: 2.9 Akismet checks your comments against the Akismet web service to see if they look like spam or not. @@ -28,6 +28,8 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [WordPress. = 2.2.7 = * Add a new AKISMET_VERSION constant +* Reduce the possibility of over-counting spam when another spam filter plugin is in use +* Disable the connectivity check when the API key is hard-coded for WPMU = 2.2.6 = diff --git a/wp-content/themes/classic/comments.php b/wp-content/themes/classic/comments.php index 57d6cf3c..3ccd0740 100644 --- a/wp-content/themes/classic/comments.php +++ b/wp-content/themes/classic/comments.php @@ -66,7 +66,7 @@ if ( post_password_required() ) : ?> -

      +

      diff --git a/wp-content/themes/default/comments.php b/wp-content/themes/default/comments.php index 7e81cdb3..186a73ca 100644 --- a/wp-content/themes/default/comments.php +++ b/wp-content/themes/default/comments.php @@ -81,7 +81,7 @@ -

      +

      diff --git a/wp-content/themes/default/functions.php b/wp-content/themes/default/functions.php index 9ad4ef23..072ab662 100644 --- a/wp-content/themes/default/functions.php +++ b/wp-content/themes/default/functions.php @@ -4,6 +4,8 @@ * @subpackage Default_Theme */ +$content_width = 450; + automatic_feed_links(); if ( function_exists('register_sidebar') ) { @@ -311,6 +313,12 @@ function kubrick_theme_page_head() { width: 100%; display: ; } + + .description { + margin-top: 16px; + color: #fff; + } + #jsForm { display: none; text-align: center; diff --git a/wp-content/themes/default/page.php b/wp-content/themes/default/page.php index 660e4774..87b3dd52 100644 --- a/wp-content/themes/default/page.php +++ b/wp-content/themes/default/page.php @@ -20,6 +20,9 @@ get_header(); ?> ', '

      '); ?> + + + diff --git a/wp-content/themes/default/rtl.css b/wp-content/themes/default/rtl.css index ba2361b1..0583b52f 100644 --- a/wp-content/themes/default/rtl.css +++ b/wp-content/themes/default/rtl.css @@ -1,7 +1,7 @@ /* Theme name: WordPress Default - kubrick - Editors: Navid Kashani -Persian Wordpress Project : wp-persian.com +Persian WordPress Project : wp-persian.com */ body, .commentlist li, #commentform input, #commentform textarea, #commentform p, #sidebar, #wp-calendar caption { font-family:tahoma, arial; diff --git a/wp-content/themes/default/sidebar.php b/wp-content/themes/default/sidebar.php index d73b6323..e38b0be0 100644 --- a/wp-content/themes/default/sidebar.php +++ b/wp-content/themes/default/sidebar.php @@ -26,24 +26,24 @@

      You are currently browsing the archives for the category.

      - -

      You are currently browsing the blog archives + +

      You are currently browsing the blog archives for the day .

      -

      You are currently browsing the blog archives +

      You are currently browsing the blog archives for .

      -

      You are currently browsing the blog archives +

      You are currently browsing the blog archives for the year .

      - -

      You have searched the blog archives + +

      You have searched the blog archives for ''. If you are unable to find anything in these search results, you can try one of these links.

      - -

      You are currently browsing the blog archives.

      + +

      You are currently browsing the blog archives.

      diff --git a/wp-cron.php b/wp-cron.php index b7fd6f53..4f3335b4 100644 --- a/wp-cron.php +++ b/wp-cron.php @@ -35,7 +35,7 @@ $local_time = time(); if ( isset($keys[0]) && $keys[0] > $local_time ) die(); -foreach ($crons as $timestamp => $cronhooks) { +foreach ($crons as $timestamp => $cronhooks) { if ( $timestamp > $local_time ) break; diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index 908e2335..51ff8a97 100644 --- a/wp-includes/author-template.php +++ b/wp-includes/author-template.php @@ -22,7 +22,7 @@ */ function get_the_author($deprecated = '') { global $authordata; - return apply_filters('the_author', $authordata->display_name); + return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null); } /** @@ -104,7 +104,7 @@ function get_the_author_meta($field = '', $user_id = false) { else $value = isset($authordata->$field) ? $authordata->$field : ''; - return apply_filters('get_the_author_' . $field, $value); + return apply_filters('get_the_author_' . $field, $value, $user_id); } /** @@ -116,7 +116,7 @@ function get_the_author_meta($field = '', $user_id = false) { * @echo string The author's field from the current author's DB object. */ function the_author_meta($field = '', $user_id = false) { - echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id)); + echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id), $user_id); } /** @@ -178,12 +178,13 @@ function the_author_posts() { */ function the_author_posts_link($deprecated = '') { global $authordata; - printf( + $link = sprintf( '%3$s', get_author_posts_url( $authordata->ID, $authordata->user_nicename ), esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ), get_the_author() ); + echo apply_filters( 'the_author_posts_link', $link ); } /** diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index 81df5a79..c406fcaf 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -218,7 +218,7 @@ function get_bookmarks($args = '') { $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; } - if (get_option('links_recently_updated_time')) { + if ( $show_updated && get_option('links_recently_updated_time') ) { $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated "; } else { $recently_updated_test = ''; diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index c17e2f13..010e1c5e 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -84,13 +84,19 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect_url = redirect_guess_404_permalink(); } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) { // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101 - if ( is_single() && !empty($_GET['p']) && ! $redirect_url ) { + if ( is_attachment() && !empty($_GET['attachment_id']) && ! $redirect_url ) { + if ( $redirect_url = get_attachment_link(get_query_var('attachment_id')) ) + $redirect['query'] = remove_query_arg('attachment_id', $redirect['query']); + } elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) { if ( $redirect_url = get_permalink(get_query_var('p')) ) $redirect['query'] = remove_query_arg('p', $redirect['query']); if ( get_query_var( 'page' ) ) { $redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); } + } elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) { + if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) + $redirect['query'] = remove_query_arg('name', $redirect['query']); } elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) { if ( $redirect_url = get_permalink(get_query_var('page_id')) ) $redirect['query'] = remove_query_arg('page_id', $redirect['query']); @@ -122,7 +128,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { } elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) { if ( $redirect_url = get_category_link(get_query_var('cat')) ) $redirect['query'] = remove_query_arg('cat', $redirect['query']); - } elseif ( is_author() && !empty($_GET['author']) ) { + } elseif ( is_author() && !empty($_GET['author']) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) { $author = get_userdata(get_query_var('author')); if ( false !== $author && $redirect_url = get_author_posts_url($author->ID, $author->user_nicename) ) $redirect['query'] = remove_query_arg('author', $redirect['author']); diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 2b4fd79c..4a5ccec0 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -123,12 +123,15 @@ class WP_Roles { * * Updates the list of roles, if the role doesn't already exist. * + * The capabilities are defined in the following format `array( 'read' => true );` + * To explicitly deny a role a capability you set the value for that capability to false. + * * @since 2.0.0 * @access public * * @param string $role Role name. * @param string $display_name Role display name. - * @param array $capabilities List of role capabilities. + * @param array $capabilities List of role capabilities in the above format. * @return null|WP_Role WP_Role object if role is added, null if already exists. */ function add_role( $role, $display_name, $capabilities = array() ) { @@ -174,7 +177,7 @@ class WP_Roles { * * @param string $role Role name. * @param string $cap Capability name. - * @param bool $grant Optional, default is true. Whether role is capable of preforming capability. + * @param bool $grant Optional, default is true. Whether role is capable of performing capability. */ function add_cap( $role, $cap, $grant = true ) { $this->roles[$role]['capabilities'][$cap] = $grant; @@ -448,6 +451,15 @@ class WP_User { */ var $last_name = ''; + /** + * The filter context applied to user data fields. + * + * @since 2.9.0 + * @access private + * @var string + */ + var $filter = null; + /** * PHP4 Constructor - Sets up the object properties. * @@ -596,6 +608,7 @@ class WP_User { update_usermeta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); + do_action( 'set_user_role', $this->ID, $role ); } /** @@ -768,16 +781,26 @@ function map_meta_cap( $cap, $user_id ) { $args = array_merge( array( 'delete_page', $user_id ), $args ); return call_user_func_array( 'map_meta_cap', $args ); } - $post_author_data = get_userdata( $post->post_author ); - //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
      "; + + if ('' != $post->post_author) { + $post_author_data = get_userdata( $post->post_author ); + } else { + //No author set yet so default to current user for cap checks + $post_author_data = $author_data; + } + // If the user is the author... if ( $user_id == $post_author_data->ID ) { // If the post is published... - if ( 'publish' == $post->post_status ) + if ( 'publish' == $post->post_status ) { $caps[] = 'delete_published_posts'; - else + } elseif ( 'trash' == $post->post_status ) { + if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) ) + $caps[] = 'delete_published_posts'; + } else { // If the post is draft... $caps[] = 'delete_posts'; + } } else { // The user is trying to edit someone else's post. $caps[] = 'delete_others_posts'; @@ -795,13 +818,25 @@ function map_meta_cap( $cap, $user_id ) { $page_author_data = get_userdata( $page->post_author ); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
      "; // If the user is the author... + + if ('' != $page->post_author) { + $page_author_data = get_userdata( $page->post_author ); + } else { + //No author set yet so default to current user for cap checks + $page_author_data = $author_data; + } + if ( $user_id == $page_author_data->ID ) { // If the page is published... - if ( $page->post_status == 'publish' ) + if ( $page->post_status == 'publish' ) { $caps[] = 'delete_published_pages'; - else + } elseif ( 'trash' == $page->post_status ) { + if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) ) + $caps[] = 'delete_published_pages'; + } else { // If the page is draft... $caps[] = 'delete_pages'; + } } else { // The user is trying to edit someone else's page. $caps[] = 'delete_others_pages'; @@ -827,11 +862,15 @@ function map_meta_cap( $cap, $user_id ) { // If the user is the author... if ( $user_id == $post_author_data->ID ) { // If the post is published... - if ( 'publish' == $post->post_status ) + if ( 'publish' == $post->post_status ) { $caps[] = 'edit_published_posts'; - else + } elseif ( 'trash' == $post->post_status ) { + if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) ) + $caps[] = 'edit_published_posts'; + } else { // If the post is draft... $caps[] = 'edit_posts'; + } } else { // The user is trying to edit someone else's post. $caps[] = 'edit_others_posts'; @@ -851,11 +890,15 @@ function map_meta_cap( $cap, $user_id ) { // If the user is the author... if ( $user_id == $page_author_data->ID ) { // If the page is published... - if ( 'publish' == $page->post_status ) + if ( 'publish' == $page->post_status ) { $caps[] = 'edit_published_pages'; - else + } elseif ( 'trash' == $page->post_status ) { + if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) ) + $caps[] = 'edit_published_pages'; + } else { // If the page is draft... $caps[] = 'edit_pages'; + } } else { // The user is trying to edit someone else's page. $caps[] = 'edit_others_pages'; @@ -934,6 +977,30 @@ function current_user_can( $capability ) { return call_user_func_array( array( &$current_user, 'has_cap' ), $args ); } +/** + * Whether author of supplied post has capability or role. + * + * @since 2.9.0 + * + * @param int|object $post Post ID or post object. + * @param string $capability Capability or role name. + * @return bool + */ +function author_can( $post, $capability ) { + if ( !$post = get_post($post) ) + return false; + + $author = new WP_User( $post->post_author ); + + if ( empty( $author ) ) + return false; + + $args = array_slice( func_get_args(), 2 ); + $args = array_merge( array( $capability ), $args ); + + return call_user_func_array( array( &$author, 'has_cap' ), $args ); +} + /** * Retrieve role object. * diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 52b42baf..7e378b44 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -344,6 +344,11 @@ function wp_dropdown_categories( $args = '' ) { $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0; $r = wp_parse_args( $args, $defaults ); + + if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { + $r['pad_counts'] = true; + } + $r['include_last_update_time'] = $r['show_last_update']; extract( $r ); @@ -523,7 +528,7 @@ function wp_list_categories( $args = '' ) { function wp_tag_cloud( $args = '' ) { $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, - 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', + 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true ); $args = wp_parse_args( $args, $defaults ); @@ -565,6 +570,17 @@ function default_topic_count_text( $count ) { return sprintf( _n('%s topic', '%s topics', $count), number_format_i18n( $count ) ); } +/** + * Default topic count scaling for tag links + * + * @param integer $count number of posts with that tag + * @return integer scaled count + */ +function default_topic_count_scale( $count ) { + return round(log10($count + 1) * 100); +} + + /** * Generates a tag cloud (heatmap) from provided data. * @@ -575,8 +591,9 @@ function default_topic_count_text( $count ) { * 'format' argument will format the tags in a UL HTML list. The array value for * the 'format' argument will return in PHP array type format. * - * The 'tag_cloud_sort' filter allows you to override the sorting done - * by the 'orderby' argument; passed to the filter: $tags array and $args array. + * The 'tag_cloud_sort' filter allows you to override the sorting. + * Passed to the filter: $tags array and $args array, has to return the $tags array + * after sorting it. * * The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'. * The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC' or @@ -599,52 +616,52 @@ function wp_generate_tag_cloud( $tags, $args = '' ) { global $wp_rewrite; $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 0, - 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', + 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC', 'topic_count_text_callback' => 'default_topic_count_text', - 'filter' => 1, + 'topic_count_scale_callback' => 'default_topic_count_scale', 'filter' => 1, ); if ( !isset( $args['topic_count_text_callback'] ) && isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) { $body = 'return sprintf ( - _n('.var_export($args['single_text'], true).', '.var_export($args['multiple_text'], true).', $count), + _n(' . var_export($args['single_text'], true) . ', ' . var_export($args['multiple_text'], true) . ', $count), number_format_i18n( $count ));'; $args['topic_count_text_callback'] = create_function('$count', $body); } $args = wp_parse_args( $args, $defaults ); - extract( $args ); if ( empty( $tags ) ) return; - // SQL cannot save you; this is a second (potentially different) sort on a subset of data. - if ( 'name' == $orderby ) - uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') ); - else - uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') ); - - $tags = apply_filters( 'tag_cloud_sort', $tags, $args ); - - if ( 'DESC' == $order ) - $tags = array_reverse( $tags, true ); - elseif ( 'RAND' == $order ) { - $keys = (array) array_rand( $tags, count( $tags ) ); - $temp = array(); - foreach ( $keys as $key ) - $temp[$key] = $tags[$key]; + $tags_sorted = apply_filters( 'tag_cloud_sort', $tags, $args ); + if ( $tags_sorted != $tags ) { // the tags have been sorted by a plugin + $tags = $tags_sorted; + unset($tags_sorted); + } else { + if ( 'RAND' == $order ) { + shuffle($tags); + } else { + // SQL cannot save you; this is a second (potentially different) sort on a subset of data. + if ( 'name' == $orderby ) + uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') ); + else + uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') ); - $tags = $temp; - $temp = null; - unset( $temp ); + if ( 'DESC' == $order ) + $tags = array_reverse( $tags, true ); + } } if ( $number > 0 ) $tags = array_slice($tags, 0, $number); $counts = array(); - foreach ( (array) $tags as $key => $tag ) - $counts[ $key ] = $tag->count; + $real_counts = array(); // For the alt tag + foreach ( (array) $tags as $key => $tag ) { + $real_counts[ $key ] = $tag->count; + $counts[ $key ] = $topic_count_scale_callback($tag->count); + } $min_count = min( $counts ); $spread = max( $counts ) - $min_count; @@ -657,14 +674,13 @@ function wp_generate_tag_cloud( $tags, $args = '' ) { $a = array(); - $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : ''; - foreach ( $tags as $key => $tag ) { $count = $counts[ $key ]; + $real_count = $real_counts[ $key ]; $tag_link = '#' != $tag->link ? esc_url( $tag->link ) : '#'; $tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key; $tag_name = $tags[ $key ]->name; - $a[] = "$tag_name"; } @@ -679,7 +695,7 @@ function wp_generate_tag_cloud( $tags, $args = '' ) { $return .= "\n\n"; break; default : - $return = join( "\n", $a ); + $return = join( $separator, $a ); break; endswitch; @@ -851,11 +867,12 @@ function get_the_terms( $id = 0, $taxonomy ) { $id = (int) $id; - if ( ! $id && ! in_the_loop() ) - return false; // in-the-loop function - - if ( !$id ) - $id = (int) $post->ID; + if ( !$id ) { + if ( !$post->ID ) + return false; + else + $id = (int) $post->ID; + } $terms = get_object_term_cache( $id, $taxonomy ); if ( false === $terms ) @@ -868,11 +885,11 @@ function get_the_terms( $id = 0, $taxonomy ) { } /** - * Retrieve terms as a list with specified format. + * Retrieve a post's terms as a list with specified format. * * @since 2.5.0 * - * @param int $id Term ID. + * @param int $id Post ID. * @param string $taxonomy Taxonomy name. * @param string $before Optional. Before list. * @param string $sep Optional. Separate items using this. @@ -912,12 +929,13 @@ function get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after * @param string $after Optional. After list. * @return null|bool False on WordPress error. Returns null when displaying. */ -function the_terms( $id, $taxonomy, $before = '', $sep = '', $after = '' ) { - $return = get_the_term_list( $id, $taxonomy, $before, $sep, $after ); - if ( is_wp_error( $return ) ) +function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) { + $term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after ); + + if ( is_wp_error( $term_list ) ) return false; - else - echo $return; + + echo apply_filters('the_terms', $term_list, $taxonomy, $before, $sep, $after); } /** diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index a4bcfbd5..f8d61fe8 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -153,34 +153,41 @@ class IXR_Message { var $_currentTagContents; // The XML parser var $_parser; - function IXR_Message ($message) { - $this->message = $message; + function IXR_Message (&$message) { + $this->message = &$message; } function parse() { - // first remove the XML declaration - $this->message = preg_replace('/<\?xml.*?\?'.'>/', '', $this->message); + // first remove the XML declaration + // this method avoids the RAM usage of preg_replace on very large messages + $header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr( $this->message, 0, 100 ), 1 ); + $this->message = substr_replace($this->message, $header, 0, 100); if (trim($this->message) == '') { return false; - } + } $this->_parser = xml_parser_create(); // Set XML parser to take the case of tags in to account xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false); // Set XML parser callback functions xml_set_object($this->_parser, $this); xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); - xml_set_character_data_handler($this->_parser, 'cdata'); - if (!xml_parse($this->_parser, $this->message)) { - /* die(sprintf('XML error: %s at line %d', - xml_error_string(xml_get_error_code($this->_parser)), - xml_get_current_line_number($this->_parser))); */ - return false; - } - xml_parser_free($this->_parser); + xml_set_character_data_handler($this->_parser, 'cdata'); + $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages + do { + if ( strlen($this->message) <= $chunk_size ) + $final=true; + $part = substr( $this->message, 0, $chunk_size ); + $this->message = substr( $this->message, $chunk_size ); + if ( !xml_parse( $this->_parser, $part, $final ) ) + return false; + if ( $final ) + break; + } while ( true ); + xml_parser_free($this->_parser); // Grab the error messages, if any if ($this->messageType == 'fault') { $this->faultCode = $this->params[0]['faultCode']; $this->faultString = $this->params[0]['faultString']; - } + } return true; } function tag_open($parser, $tag, $attr) { @@ -304,7 +311,7 @@ class IXR_Server { header( 'Content-Type: text/plain' ); die('XML-RPC server accepts POST requests only.'); } - $data = $HTTP_RAW_POST_DATA; + $data = &$HTTP_RAW_POST_DATA; } $this->message = new IXR_Message($data); if (!$this->message->parse()) { diff --git a/wp-includes/class-feed.php b/wp-includes/class-feed.php index 70124395..cff43a17 100644 --- a/wp-includes/class-feed.php +++ b/wp-includes/class-feed.php @@ -32,7 +32,7 @@ class WP_Feed_Cache_Transient { function WP_Feed_Cache_Transient($location, $filename, $extension) { $this->name = 'feed_' . $filename; $this->mod_name = 'feed_mod_' . $filename; - $this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime); + $this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime, $filename); } function save($data) { diff --git a/wp-includes/class-json.php b/wp-includes/class-json.php new file mode 100644 index 00000000..c84815c5 --- /dev/null +++ b/wp-includes/class-json.php @@ -0,0 +1,860 @@ + + * @author Matt Knapp + * @author Brett Stimmerman + * @copyright 2005 Michal Migurski + * @version CVS: $Id: JSON.php,v 1.3 2009/05/22 23:51:00 alan_k Exp $ + * @license http://www.opensource.org/licenses/bsd-license.php + * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 + */ + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_SLICE', 1); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_STR', 2); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_ARR', 3); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_OBJ', 4); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_CMT', 5); + +/** + * Behavior switch for Services_JSON::decode() + */ +define('SERVICES_JSON_LOOSE_TYPE', 16); + +/** + * Behavior switch for Services_JSON::decode() + */ +define('SERVICES_JSON_SUPPRESS_ERRORS', 32); + +/** + * Converts to and from JSON format. + * + * Brief example of use: + * + * + * // create a new instance of Services_JSON + * $json = new Services_JSON(); + * + * // convert a complexe value to JSON notation, and send it to the browser + * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); + * $output = $json->encode($value); + * + * print($output); + * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] + * + * // accept incoming POST data, assumed to be in JSON notation + * $input = file_get_contents('php://input', 1000000); + * $value = $json->decode($input); + * + */ +class Services_JSON +{ + /** + * constructs a new JSON instance + * + * @param int $use object behavior flags; combine with boolean-OR + * + * possible values: + * - SERVICES_JSON_LOOSE_TYPE: loose typing. + * "{...}" syntax creates associative arrays + * instead of objects in decode(). + * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression. + * Values which can't be encoded (e.g. resources) + * appear as NULL instead of throwing errors. + * By default, a deeply-nested resource will + * bubble up with an error, so all return values + * from encode() should be checked with isError() + */ + function Services_JSON($use = 0) + { + $this->use = $use; + } + + /** + * convert a string from one UTF-16 char to one UTF-8 char + * + * Normally should be handled by mb_convert_encoding, but + * provides a slower PHP-only method for installations + * that lack the multibye string extension. + * + * @param string $utf16 UTF-16 character + * @return string UTF-8 character + * @access private + */ + function utf162utf8($utf16) + { + // oh please oh please oh please oh please oh please + if(function_exists('mb_convert_encoding')) { + return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); + } + + $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); + + switch(true) { + case ((0x7F & $bytes) == $bytes): + // this case should never be reached, because we are in ASCII range + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0x7F & $bytes); + + case (0x07FF & $bytes) == $bytes: + // return a 2-byte UTF-8 character + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0xC0 | (($bytes >> 6) & 0x1F)) + . chr(0x80 | ($bytes & 0x3F)); + + case (0xFFFF & $bytes) == $bytes: + // return a 3-byte UTF-8 character + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0xE0 | (($bytes >> 12) & 0x0F)) + . chr(0x80 | (($bytes >> 6) & 0x3F)) + . chr(0x80 | ($bytes & 0x3F)); + } + + // ignoring UTF-32 for now, sorry + return ''; + } + + /** + * convert a string from one UTF-8 char to one UTF-16 char + * + * Normally should be handled by mb_convert_encoding, but + * provides a slower PHP-only method for installations + * that lack the multibye string extension. + * + * @param string $utf8 UTF-8 character + * @return string UTF-16 character + * @access private + */ + function utf82utf16($utf8) + { + // oh please oh please oh please oh please oh please + if(function_exists('mb_convert_encoding')) { + return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); + } + + switch(strlen($utf8)) { + case 1: + // this case should never be reached, because we are in ASCII range + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return $utf8; + + case 2: + // return a UTF-16 character from a 2-byte UTF-8 char + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0x07 & (ord($utf8{0}) >> 2)) + . chr((0xC0 & (ord($utf8{0}) << 6)) + | (0x3F & ord($utf8{1}))); + + case 3: + // return a UTF-16 character from a 3-byte UTF-8 char + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr((0xF0 & (ord($utf8{0}) << 4)) + | (0x0F & (ord($utf8{1}) >> 2))) + . chr((0xC0 & (ord($utf8{1}) << 6)) + | (0x7F & ord($utf8{2}))); + } + + // ignoring UTF-32 for now, sorry + return ''; + } + + /** + * encodes an arbitrary variable into JSON format (and sends JSON Header) + * + * @param mixed $var any number, boolean, string, array, or object to be encoded. + * see argument 1 to Services_JSON() above for array-parsing behavior. + * if var is a strng, note that encode() always expects it + * to be in ASCII or UTF-8 format! + * + * @return mixed JSON string representation of input var or an error if a problem occurs + * @access public + */ + function encode($var) + { + header('Content-type: application/x-javascript'); + return $this->_encode($var); + } + /** + * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow CSS!!!!) + * + * @param mixed $var any number, boolean, string, array, or object to be encoded. + * see argument 1 to Services_JSON() above for array-parsing behavior. + * if var is a strng, note that encode() always expects it + * to be in ASCII or UTF-8 format! + * + * @return mixed JSON string representation of input var or an error if a problem occurs + * @access public + */ + function encodeUnsafe($var) + { + return $this->_encode($var); + } + /** + * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format + * + * @param mixed $var any number, boolean, string, array, or object to be encoded. + * see argument 1 to Services_JSON() above for array-parsing behavior. + * if var is a strng, note that encode() always expects it + * to be in ASCII or UTF-8 format! + * + * @return mixed JSON string representation of input var or an error if a problem occurs + * @access public + */ + function _encode($var) + { + + switch (gettype($var)) { + case 'boolean': + return $var ? 'true' : 'false'; + + case 'NULL': + return 'null'; + + case 'integer': + return (int) $var; + + case 'double': + case 'float': + return (float) $var; + + case 'string': + // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT + $ascii = ''; + $strlen_var = strlen($var); + + /* + * Iterate over every character in the string, + * escaping with a slash or encoding to UTF-8 where necessary + */ + for ($c = 0; $c < $strlen_var; ++$c) { + + $ord_var_c = ord($var{$c}); + + switch (true) { + case $ord_var_c == 0x08: + $ascii .= '\b'; + break; + case $ord_var_c == 0x09: + $ascii .= '\t'; + break; + case $ord_var_c == 0x0A: + $ascii .= '\n'; + break; + case $ord_var_c == 0x0C: + $ascii .= '\f'; + break; + case $ord_var_c == 0x0D: + $ascii .= '\r'; + break; + + case $ord_var_c == 0x22: + case $ord_var_c == 0x2F: + case $ord_var_c == 0x5C: + // double quote, slash, slosh + $ascii .= '\\'.$var{$c}; + break; + + case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): + // characters U-00000000 - U-0000007F (same as ASCII) + $ascii .= $var{$c}; + break; + + case (($ord_var_c & 0xE0) == 0xC0): + // characters U-00000080 - U-000007FF, mask 110XXXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + if ($c+1 >= $strlen_var) { + $c += 1; + $ascii .= '?'; + break; + } + + $char = pack('C*', $ord_var_c, ord($var{$c + 1})); + $c += 1; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF0) == 0xE0): + if ($c+2 >= $strlen_var) { + $c += 2; + $ascii .= '?'; + break; + } + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + @ord($var{$c + 1}), + @ord($var{$c + 2})); + $c += 2; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF8) == 0xF0): + if ($c+3 >= $strlen_var) { + $c += 3; + $ascii .= '?'; + break; + } + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var{$c + 1}), + ord($var{$c + 2}), + ord($var{$c + 3})); + $c += 3; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFC) == 0xF8): + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + if ($c+4 >= $strlen_var) { + $c += 4; + $ascii .= '?'; + break; + } + $char = pack('C*', $ord_var_c, + ord($var{$c + 1}), + ord($var{$c + 2}), + ord($var{$c + 3}), + ord($var{$c + 4})); + $c += 4; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFE) == 0xFC): + if ($c+5 >= $strlen_var) { + $c += 5; + $ascii .= '?'; + break; + } + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var{$c + 1}), + ord($var{$c + 2}), + ord($var{$c + 3}), + ord($var{$c + 4}), + ord($var{$c + 5})); + $c += 5; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + } + } + return '"'.$ascii.'"'; + + case 'array': + /* + * As per JSON spec if any array key is not an integer + * we must treat the the whole array as an object. We + * also try to catch a sparsely populated associative + * array with numeric keys here because some JS engines + * will create an array with empty indexes up to + * max_index which can cause memory issues and because + * the keys, which may be relevant, will be remapped + * otherwise. + * + * As per the ECMA and JSON specification an object may + * have any string as a property. Unfortunately due to + * a hole in the ECMA specification if the key is a + * ECMA reserved word or starts with a digit the + * parameter is only accessible using ECMAScript's + * bracket notation. + */ + + // treat as a JSON object + if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { + $properties = array_map(array($this, 'name_value'), + array_keys($var), + array_values($var)); + + foreach($properties as $property) { + if(Services_JSON::isError($property)) { + return $property; + } + } + + return '{' . join(',', $properties) . '}'; + } + + // treat it like a regular array + $elements = array_map(array($this, '_encode'), $var); + + foreach($elements as $element) { + if(Services_JSON::isError($element)) { + return $element; + } + } + + return '[' . join(',', $elements) . ']'; + + case 'object': + $vars = get_object_vars($var); + + $properties = array_map(array($this, 'name_value'), + array_keys($vars), + array_values($vars)); + + foreach($properties as $property) { + if(Services_JSON::isError($property)) { + return $property; + } + } + + return '{' . join(',', $properties) . '}'; + + default: + return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) + ? 'null' + : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); + } + } + + /** + * array-walking function for use in generating JSON-formatted name-value pairs + * + * @param string $name name of key to use + * @param mixed $value reference to an array element to be encoded + * + * @return string JSON-formatted name-value pair, like '"name":value' + * @access private + */ + function name_value($name, $value) + { + $encoded_value = $this->_encode($value); + + if(Services_JSON::isError($encoded_value)) { + return $encoded_value; + } + + return $this->_encode(strval($name)) . ':' . $encoded_value; + } + + /** + * reduce a string by removing leading and trailing comments and whitespace + * + * @param $str string string value to strip of comments and whitespace + * + * @return string string value stripped of comments and whitespace + * @access private + */ + function reduce_string($str) + { + $str = preg_replace(array( + + // eliminate single line comments in '// ...' form + '#^\s*//(.+)$#m', + + // eliminate multi-line comments in '/* ... */' form, at start of string + '#^\s*/\*(.+)\*/#Us', + + // eliminate multi-line comments in '/* ... */' form, at end of string + '#/\*(.+)\*/\s*$#Us' + + ), '', $str); + + // eliminate extraneous space + return trim($str); + } + + /** + * decodes a JSON string into appropriate variable + * + * @param string $str JSON-formatted string + * + * @return mixed number, boolean, string, array, or object + * corresponding to given JSON input string. + * See argument 1 to Services_JSON() above for object-output behavior. + * Note that decode() always returns strings + * in ASCII or UTF-8 format! + * @access public + */ + function decode($str) + { + $str = $this->reduce_string($str); + + switch (strtolower($str)) { + case 'true': + return true; + + case 'false': + return false; + + case 'null': + return null; + + default: + $m = array(); + + if (is_numeric($str)) { + // Lookie-loo, it's a number + + // This would work on its own, but I'm trying to be + // good about returning integers where appropriate: + // return (float)$str; + + // Return float or int, as appropriate + return ((float)$str == (integer)$str) + ? (integer)$str + : (float)$str; + + } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { + // STRINGS RETURNED IN UTF-8 FORMAT + $delim = substr($str, 0, 1); + $chrs = substr($str, 1, -1); + $utf8 = ''; + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c < $strlen_chrs; ++$c) { + + $substr_chrs_c_2 = substr($chrs, $c, 2); + $ord_chrs_c = ord($chrs{$c}); + + switch (true) { + case $substr_chrs_c_2 == '\b': + $utf8 .= chr(0x08); + ++$c; + break; + case $substr_chrs_c_2 == '\t': + $utf8 .= chr(0x09); + ++$c; + break; + case $substr_chrs_c_2 == '\n': + $utf8 .= chr(0x0A); + ++$c; + break; + case $substr_chrs_c_2 == '\f': + $utf8 .= chr(0x0C); + ++$c; + break; + case $substr_chrs_c_2 == '\r': + $utf8 .= chr(0x0D); + ++$c; + break; + + case $substr_chrs_c_2 == '\\"': + case $substr_chrs_c_2 == '\\\'': + case $substr_chrs_c_2 == '\\\\': + case $substr_chrs_c_2 == '\\/': + if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || + ($delim == "'" && $substr_chrs_c_2 != '\\"')) { + $utf8 .= $chrs{++$c}; + } + break; + + case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): + // single, escaped unicode character + $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) + . chr(hexdec(substr($chrs, ($c + 4), 2))); + $utf8 .= $this->utf162utf8($utf16); + $c += 5; + break; + + case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): + $utf8 .= $chrs{$c}; + break; + + case ($ord_chrs_c & 0xE0) == 0xC0: + // characters U-00000080 - U-000007FF, mask 110XXXXX + //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 2); + ++$c; + break; + + case ($ord_chrs_c & 0xF0) == 0xE0: + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 3); + $c += 2; + break; + + case ($ord_chrs_c & 0xF8) == 0xF0: + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 4); + $c += 3; + break; + + case ($ord_chrs_c & 0xFC) == 0xF8: + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 5); + $c += 4; + break; + + case ($ord_chrs_c & 0xFE) == 0xFC: + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 6); + $c += 5; + break; + + } + + } + + return $utf8; + + } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { + // array, or object notation + + if ($str{0} == '[') { + $stk = array(SERVICES_JSON_IN_ARR); + $arr = array(); + } else { + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $stk = array(SERVICES_JSON_IN_OBJ); + $obj = array(); + } else { + $stk = array(SERVICES_JSON_IN_OBJ); + $obj = new stdClass(); + } + } + + array_push($stk, array('what' => SERVICES_JSON_SLICE, + 'where' => 0, + 'delim' => false)); + + $chrs = substr($str, 1, -1); + $chrs = $this->reduce_string($chrs); + + if ($chrs == '') { + if (reset($stk) == SERVICES_JSON_IN_ARR) { + return $arr; + + } else { + return $obj; + + } + } + + //print("\nparsing {$chrs}\n"); + + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c <= $strlen_chrs; ++$c) { + + $top = end($stk); + $substr_chrs_c_2 = substr($chrs, $c, 2); + + if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { + // found a comma that is not inside a string, array, etc., + // OR we've reached the end of the character list + $slice = substr($chrs, $top['where'], ($c - $top['where'])); + array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); + //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + if (reset($stk) == SERVICES_JSON_IN_ARR) { + // we are in an array, so just push an element onto the stack + array_push($arr, $this->decode($slice)); + + } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { + // we are in an object, so figure + // out the property name and set an + // element in an associative array, + // for now + $parts = array(); + + if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + // "name":value pair + $key = $this->decode($parts[1]); + $val = $this->decode($parts[2]); + + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + // name:value pair, where name is unquoted + $key = $parts[1]; + $val = $this->decode($parts[2]); + + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } + + } + + } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { + // found a quote, and we are not inside a string + array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); + //print("Found start of string at {$c}\n"); + + } elseif (($chrs{$c} == $top['delim']) && + ($top['what'] == SERVICES_JSON_IN_STR) && + ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { + // found a quote, we're in a string, and it's not escaped + // we know that it's not escaped becase there is _not_ an + // odd number of backslashes at the end of the string so far + array_pop($stk); + //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); + + } elseif (($chrs{$c} == '[') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a left-bracket, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); + //print("Found start of array at {$c}\n"); + + } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { + // found a right-bracket, and we're in an array + array_pop($stk); + //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + } elseif (($chrs{$c} == '{') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a left-brace, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); + //print("Found start of object at {$c}\n"); + + } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { + // found a right-brace, and we're in an object + array_pop($stk); + //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + } elseif (($substr_chrs_c_2 == '/*') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a comment start, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); + $c++; + //print("Found start of comment at {$c}\n"); + + } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { + // found a comment end, and we're in one now + array_pop($stk); + $c++; + + for ($i = $top['where']; $i <= $c; ++$i) + $chrs = substr_replace($chrs, ' ', $i, 1); + + //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + } + + } + + if (reset($stk) == SERVICES_JSON_IN_ARR) { + return $arr; + + } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { + return $obj; + + } + + } + } + } + + /** + * @todo Ultimately, this should just call PEAR::isError() + */ + function isError($data, $code = null) + { + if (class_exists('pear')) { + return PEAR::isError($data, $code); + } elseif (is_object($data) && (get_class($data) == 'services_json_error' || + is_subclass_of($data, 'services_json_error'))) { + return true; + } + + return false; + } +} + +if (class_exists('PEAR_Error')) { + + class Services_JSON_Error extends PEAR_Error + { + function Services_JSON_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + parent::PEAR_Error($message, $code, $mode, $options, $userinfo); + } + } + +} else { + + /** + * @todo Ultimately, this class shall be descended from PEAR_Error + */ + class Services_JSON_Error + { + function Services_JSON_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + + } + } + +} diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php new file mode 100644 index 00000000..41794e02 --- /dev/null +++ b/wp-includes/class-oembed.php @@ -0,0 +1,270 @@ +__construct(); + } + + /** + * PHP5 constructor + * + * @uses apply_filters() Filters a list of pre-defined oEmbed providers. + */ + function __construct() { + // List out some popular sites that support oEmbed. + // The WP_Embed class disables discovery for non-unfiltered_html users, so only providers in this array will be used for them. + // Add to this list using the wp_oembed_add_provider() function (see it's PHPDoc for details). + $this->providers = apply_filters( 'oembed_providers', array( + '#http://(www\.)?youtube.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ), + 'http://blip.tv/file/*' => array( 'http://blip.tv/oembed/', false ), + '#http://(www\.)?vimeo\.com/.*#i' => array( 'http://www.vimeo.com/api/oembed.{format}', true ), + '#http://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/api/oembed', true ), + '#http://(www\.)?flickr\.com/.*#i' => array( 'http://www.flickr.com/services/oembed/', true ), + '#http://(www\.)?hulu\.com/watch/.*#i' => array( 'http://www.hulu.com/api/oembed.{format}', true ), + '#http://(www\.)?viddler\.com/.*#i' => array( 'http://lab.viddler.com/services/oembed/', true ), + 'http://qik.com/*' => array( 'http://qik.com/api/oembed.{format}', false ), + 'http://revision3.com/*' => array( 'http://revision3.com/api/oembed/', false ), + 'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ), + 'http://gi*.photobucket.com/groups/*' => array( 'http://photobucket.com/oembed', false ), + '#http://(www\.)?scribd\.com/.*#i' => array( 'http://www.scribd.com/services/oembed', true ), + 'http://wordpress.tv/*' => array( 'http://wordpress.tv/oembed/', false ), + ) ); + + // Fix Scribd embeds. They contain new lines in the middle of the HTML which breaks wpautop(). + add_filter( 'oembed_dataparse', array(&$this, 'strip_scribd_newlines'), 10, 3 ); + } + + /** + * The do-it-all function that takes a URL and attempts to return the HTML. + * + * @see WP_oEmbed::discover() + * @see WP_oEmbed::fetch() + * @see WP_oEmbed::data2html() + * + * @param string $url The URL to the content that should be attempted to be embedded. + * @param array $args Optional arguments. Usually passed from a shortcode. + * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed. + */ + function get_html( $url, $args = '' ) { + $provider = false; + + if ( !isset($args['discover']) ) + $args['discover'] = true; + + foreach ( $this->providers as $matchmask => $data ) { + list( $providerurl, $regex ) = $data; + + // Turn the asterisk-type provider URLs into regex + if ( !$regex ) + $matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i'; + + if ( preg_match( $matchmask, $url ) ) { + $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML + break; + } + } + + if ( !$provider && $args['discover'] ) + $provider = $this->discover( $url ); + + if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) ) + return false; + + return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args ); + } + + /** + * Attempts to find oEmbed provider discovery tags at the given URL. + * + * @param string $url The URL that should be inspected for discovery tags. + * @return bool|string False on failure, otherwise the oEmbed provider URL. + */ + function discover( $url ) { + $providers = array(); + + // Fetch URL content + if ( $html = wp_remote_retrieve_body( wp_remote_get( $url ) ) ) { + + // types that contain oEmbed provider URLs + $linktypes = apply_filters( 'oembed_linktypes', array( + 'application/json+oembed' => 'json', + 'text/xml+oembed' => 'xml', + 'application/xml+oembed' => 'xml', // Incorrect, but used by at least Vimeo + ) ); + + // Strip + $html = substr( $html, 0, stripos( $html, '' ) ); + + // Do a quick check + $tagfound = false; + foreach ( $linktypes as $linktype => $format ) { + if ( stripos($html, $linktype) ) { + $tagfound = true; + break; + } + } + + if ( $tagfound && preg_match_all( '/]+)>/i', $html, $links ) ) { + foreach ( $links[1] as $link ) { + $atts = shortcode_parse_atts( $link ); + + if ( !empty($atts['type']) && !empty($linktypes[$atts['type']]) && !empty($atts['href']) ) { + $providers[$linktypes[$atts['type']]] = $atts['href']; + + // Stop here if it's JSON (that's all we need) + if ( 'json' == $linktypes[$atts['type']] ) + break; + } + } + } + } + + // JSON is preferred to XML + if ( !empty($providers['json']) ) + return $providers['json']; + elseif ( !empty($providers['xml']) ) + return $providers['xml']; + else + return false; + } + + /** + * Connects to a oEmbed provider and returns the result. + * + * @param string $provider The URL to the oEmbed provider. + * @param string $url The URL to the content that is desired to be embedded. + * @param array $args Optional arguments. Usually passed from a shortcode. + * @return bool|object False on failure, otherwise the result in the form of an object. + */ + function fetch( $provider, $url, $args = '' ) { + $args = wp_parse_args( $args, wp_embed_defaults() ); + + $provider = add_query_arg( 'format', 'json', $provider ); // JSON is easier to deal with than XML + + $provider = add_query_arg( 'maxwidth', $args['width'], $provider ); + $provider = add_query_arg( 'maxheight', $args['height'], $provider ); + $provider = add_query_arg( 'url', urlencode($url), $provider ); + + if ( !$result = wp_remote_retrieve_body( wp_remote_get( $provider ) ) ) + return false; + + $result = trim( $result ); + + // JSON? + // Example content: http://vimeo.com/api/oembed.json?url=http%3A%2F%2Fvimeo.com%2F240975 + if ( $data = json_decode($result) ) { + return $data; + } + + // Must be XML. Only parse it if PHP5 is installed. (PHP4 isn't worth the trouble.) + // Example content: http://vimeo.com/api/oembed.xml?url=http%3A%2F%2Fvimeo.com%2F240975 + elseif ( function_exists('simplexml_load_string') ) { + $errors = libxml_use_internal_errors( 'true' ); + + $data = simplexml_load_string( $result ); + + libxml_use_internal_errors( $errors ); + + if ( is_object($data) ) + return $data; + } + + return false; + } + + /** + * Converts a data object from {@link WP_oEmbed::fetch()} and returns the HTML. + * + * @param object $data A data object result from an oEmbed provider. + * @param string $url The URL to the content that is desired to be embedded. + * @return bool|string False on error, otherwise the HTML needed to embed. + */ + function data2html( $data, $url ) { + if ( !is_object($data) || empty($data->type) ) + return false; + + switch ( $data->type ) { + case 'photo': + if ( empty($data->url) || empty($data->width) || empty($data->height) ) + return false; + + $title = ( !empty($data->title) ) ? $data->title : ''; + $return = '' . esc_attr($title) . ''; + break; + + case 'video': + case 'rich': + $return = ( !empty($data->html) ) ? $data->html : false; + break; + + case 'link': + $return = ( !empty($data->title) ) ? '' . esc_html($data->title) . '' : false; + break; + + default; + $return = false; + } + + // You can use this filter to add support for custom data types or to filter the result + return apply_filters( 'oembed_dataparse', $return, $data, $url ); + } + + /** + * Strip new lines from the HTML if it's a Scribd embed. + * + * @param string $html Existing HTML. + * @param object $data Data object from WP_oEmbed::data2html() + * @param string $url The original URL passed to oEmbed. + * @return string Possibly modified $html + */ + function strip_scribd_newlines( $html, $data, $url ) { + if ( preg_match( '#http://(www\.)?scribd.com/.*#i', $url ) ) + $html = str_replace( array( "\r\n", "\n" ), '', $html ); + + return $html; + } +} + +/** + * Returns the initialized {@link WP_oEmbed} object + * + * @since 2.9.0 + * @access private + * + * @see WP_oEmbed + * @uses WP_oEmbed + * + * @return WP_oEmbed object. + */ +function &_wp_oembed_get_object() { + static $wp_oembed; + + if ( is_null($wp_oembed) ) + $wp_oembed = new WP_oEmbed(); + + return $wp_oembed; +} + +?> \ No newline at end of file diff --git a/wp-includes/class-simplepie.php b/wp-includes/class-simplepie.php index 88050b39..45c33c86 100644 --- a/wp-includes/class-simplepie.php +++ b/wp-includes/class-simplepie.php @@ -5,7 +5,7 @@ * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * - * Copyright (c) 2004-2008, Ryan Parman and Geoffrey Sneddon + * Copyright (c) 2004-2009, Ryan Parman and Geoffrey Sneddon * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -33,8 +33,8 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.1.3 - * @copyright 2004-2008 Ryan Parman, Geoffrey Sneddon + * @version 1.2 + * @copyright 2004-2009 Ryan Parman, Geoffrey Sneddon * @author Ryan Parman * @author Geoffrey Sneddon * @link http://simplepie.org/ SimplePie @@ -51,12 +51,12 @@ define('SIMPLEPIE_NAME', 'SimplePie'); /** * SimplePie Version */ -define('SIMPLEPIE_VERSION', '1.1.3'); +define('SIMPLEPIE_VERSION', '1.2'); /** * SimplePie Build */ -define('SIMPLEPIE_BUILD', 20081219); +define('SIMPLEPIE_BUILD', '20090627192103'); /** * SimplePie Website URL @@ -241,6 +241,21 @@ define('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32); */ define('SIMPLEPIE_CONSTRUCT_ALL', 63); +/** + * Don't change case + */ +define('SIMPLEPIE_SAME_CASE', 1); + +/** + * Change to lowercase + */ +define('SIMPLEPIE_LOWERCASE', 2); + +/** + * Change to uppercase + */ +define('SIMPLEPIE_UPPERCASE', 4); + /** * PCRE for HTML attributes */ @@ -376,11 +391,6 @@ define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16); * SimplePie * * @package SimplePie - * @version "Razzleberry" - * @copyright 2004-2007 Ryan Parman, Geoffrey Sneddon - * @author Ryan Parman - * @author Geoffrey Sneddon - * @todo Option for type of fetching (cache, not modified header, fetch, etc.) */ class SimplePie { @@ -638,6 +648,13 @@ class SimplePie */ var $max_checked_feeds = 10; + /** + * @var array All the feeds found during the autodiscovery process + * @see SimplePie::get_all_discovered_feeds() + * @access private + */ + var $all_discovered_feeds = array(); + /** * @var string Web-accessible path to the handler_favicon.php file. * @see SimplePie::set_favicon_handler() @@ -1440,7 +1457,7 @@ class SimplePie */ function set_favicon_handler($page = false, $qs = 'i') { - if ($page != false) + if ($page !== false) { $this->favicon_handler = $page . '?' . $qs . '='; } @@ -1459,7 +1476,7 @@ class SimplePie */ function set_image_handler($page = false, $qs = 'i') { - if ($page != false) + if ($page !== false) { $this->sanitize->set_image_handler($page . '?' . $qs . '='); } @@ -1482,45 +1499,31 @@ class SimplePie function init() { + // Check absolute bare minimum requirements. if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.3.0', '<')) || !extension_loaded('xml') || !extension_loaded('pcre')) { return false; } - if (isset($_GET[$this->javascript])) + // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader. + elseif (!extension_loaded('xmlreader')) { - if (function_exists('ob_gzhandler')) + static $xml_is_sane = null; + if ($xml_is_sane === null) { - ob_start('ob_gzhandler'); + $parser_check = xml_parser_create(); + xml_parse_into_struct($parser_check, '&', $values); + xml_parser_free($parser_check); + $xml_is_sane = isset($values[0]['value']); } - header('Content-type: text/javascript; charset: UTF-8'); - header('Cache-Control: must-revalidate'); - header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days - ?> -function embed_odeo(link) { - document.writeln(''); -} - -function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) { - if (placeholder != '') { - document.writeln(''); - } - else { - document.writeln(''); - } -} - -function embed_flash(bgcolor, width, height, link, loop, type) { - document.writeln(''); -} - -function embed_flv(width, height, link, placeholder, loop, player) { - document.writeln(''); -} + if (!$xml_is_sane) + { + return false; + } + } -function embed_wmedia(width, height, link) { - document.writeln(''); -} - javascript])) + { + SimplePie_Misc::output_javascript(); exit; } @@ -1550,13 +1553,13 @@ function embed_wmedia(width, height, link) { if (!empty($this->data)) { // If the cache is for an outdated build of SimplePie - if (!isset($this->data['build']) || $this->data['build'] != SIMPLEPIE_BUILD) + if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD) { $cache->unlink(); $this->data = array(); } // If we've hit a collision just rerun it with caching disabled - elseif (isset($this->data['url']) && $this->data['url'] != $this->feed_url) + elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url) { $cache = false; $this->data = array(); @@ -1568,7 +1571,7 @@ function embed_wmedia(width, height, link) { if ($cache->mtime() + $this->autodiscovery_cache_duration > time()) { // Do not need to do feed autodiscovery yet. - if ($this->data['feed_url'] == $this->data['url']) + if ($this->data['feed_url'] === $this->data['url']) { $cache->unlink(); $this->data = array(); @@ -1598,7 +1601,7 @@ function embed_wmedia(width, height, link) { $file =& new $this->file_class($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen); if ($file->success) { - if ($file->status_code == 304) + if ($file->status_code === 304) { $cache->touch(); return true; @@ -1630,7 +1633,7 @@ function embed_wmedia(width, height, link) { // If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it. if (!isset($file)) { - if (is_a($this->file, 'SimplePie_File') && $this->file->url == $this->feed_url) + if (is_a($this->file, 'SimplePie_File') && $this->file->url === $this->feed_url) { $file =& $this->file; } @@ -1640,7 +1643,7 @@ function embed_wmedia(width, height, link) { } } // If the file connection has an error, set SimplePie::error to that and quit - if (!$file->success) + if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) { $this->error = $file->error; if (!empty($this->data)) @@ -1661,14 +1664,14 @@ function embed_wmedia(width, height, link) { { // We need to unset this so that if SimplePie::set_file() has been called that object is untouched unset($file); - if ($file = $locate->find($this->autodiscovery)) + if ($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds)) { if ($cache) { $this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD); if (!$cache->save($this)) { - trigger_error("$cache->name is not writeable", E_USER_WARNING); + trigger_error("$this->cache_location is not writeable", E_USER_WARNING); } $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc'); } @@ -1786,8 +1789,15 @@ function embed_wmedia(width, height, link) { } } } - // We have an error, just set SimplePie::error to it and quit - $this->error = sprintf('XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column()); + if(isset($parser)) + { + // We have an error, just set SimplePie_Misc::error to it and quit + $this->error = sprintf('XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column()); + } + else + { + $this->error = 'The data could not be converted to UTF-8'; + } SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__); return false; } @@ -1882,18 +1892,18 @@ function embed_wmedia(width, height, link) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_090; } } - elseif (isset($this->data['child']['']['rss'])) + elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'])) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_ALL; - if (isset($this->data['child']['']['rss'][0]['attribs']['']['version'])) + if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { - switch (trim($this->data['child']['']['rss'][0]['attribs']['']['version'])) + switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { case '0.91': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091; - if (isset($this->data['child']['']['rss'][0]['child']['']['skiphours']['hour'][0]['data'])) + if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { - switch (trim($this->data['child']['']['rss'][0]['child']['']['skiphours']['hour'][0]['data'])) + switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { case '0': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_NETSCAPE; @@ -1962,7 +1972,7 @@ function embed_wmedia(width, height, link) { { $file =& new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen); - if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0) + if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0) { $sniffer =& new $this->content_type_sniffer_class($file); if (substr($sniffer->get_type(), 0, 6) === 'image/') @@ -1977,6 +1987,11 @@ function embed_wmedia(width, height, link) { return $this->sanitize($favicon, SIMPLEPIE_CONSTRUCT_IRI); } } + // not an image + else + { + return false; + } } } } @@ -2021,7 +2036,7 @@ function embed_wmedia(width, height, link) { { if ($this->feed_url !== null) { - return 'outlook' . $this->sanitize(SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI); + return $this->sanitize('outlook' . SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI); } else { @@ -2066,12 +2081,12 @@ function embed_wmedia(width, height, link) { { if ($this->subscribe_url()) { - $return = $this->sanitize($feed_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->feed_url); + $return = $feed_url . rawurlencode($this->feed_url); if ($site_url !== null && $this->get_link() !== null) { - $return .= $this->sanitize($site_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_link()); + $return .= $site_url . rawurlencode($this->get_link()); } - return $return; + return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI); } else { @@ -2086,7 +2101,7 @@ function embed_wmedia(width, height, link) { function subscribe_bloglines() { - return urldecode($this->subscribe_service('http://www.bloglines.com/sub/')); + return $this->subscribe_service('http://www.bloglines.com/sub/'); } function subscribe_eskobo() @@ -2180,9 +2195,9 @@ function embed_wmedia(width, height, link) { } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { - if (isset($this->data['child']['']['rss'][0]['child'][$namespace][$tag])) + if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag])) { - return $this->data['child']['']['rss'][0]['child'][$namespace][$tag]; + return $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]; } } return null; @@ -2220,7 +2235,7 @@ function embed_wmedia(width, height, link) { } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { - if ($channel = $this->get_feed_tags('', 'channel')) + if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel')) { if (isset($channel[0]['child'][$namespace][$tag])) { @@ -2256,7 +2271,7 @@ function embed_wmedia(width, height, link) { } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { - if ($image = $this->get_channel_tags('', 'image')) + if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image')) { if (isset($image[0]['child'][$namespace][$tag])) { @@ -2306,7 +2321,7 @@ function embed_wmedia(width, height, link) { { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } - elseif ($return = $this->get_channel_tags('', 'title')) + elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } @@ -2360,9 +2375,20 @@ function embed_wmedia(width, height, link) { } $categories[] =& new $this->category_class($term, $scheme, $label); } - foreach ((array) $this->get_channel_tags('', 'category') as $category) + foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { - $categories[] =& new $this->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); + // This is really the label, but keep this as the term also for BC. + // Label will also work on retrieving because that falls back to term. + $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); + if (isset($category['attribs']['']['domain'])) + { + $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); + } + else + { + $scheme = null; + } + $categories[] =& new $this->category_class($term, $scheme, null); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { @@ -2594,7 +2620,7 @@ function embed_wmedia(width, height, link) { { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } - if ($links = $this->get_channel_tags('', 'link')) + if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } @@ -2614,7 +2640,7 @@ function embed_wmedia(width, height, link) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } - elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) + elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } @@ -2632,6 +2658,11 @@ function embed_wmedia(width, height, link) { } } + function get_all_discovered_feeds() + { + return $this->all_discovered_feeds; + } + function get_description() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle')) @@ -2650,9 +2681,9 @@ function embed_wmedia(width, height, link) { { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } - elseif ($return = $this->get_channel_tags('', 'description')) + elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { - return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); + return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { @@ -2686,7 +2717,7 @@ function embed_wmedia(width, height, link) { { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } - elseif ($return = $this->get_channel_tags('', 'copyright')) + elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -2706,7 +2737,7 @@ function embed_wmedia(width, height, link) { function get_language() { - if ($return = $this->get_channel_tags('', 'language')) + if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -2786,7 +2817,7 @@ function embed_wmedia(width, height, link) { { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } - elseif ($return = $this->get_image_tags('', 'title')) + elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -2826,7 +2857,7 @@ function embed_wmedia(width, height, link) { { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } - elseif ($return = $this->get_image_tags('', 'url')) + elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } @@ -2846,7 +2877,7 @@ function embed_wmedia(width, height, link) { { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } - elseif ($return = $this->get_image_tags('', 'link')) + elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } @@ -2858,11 +2889,11 @@ function embed_wmedia(width, height, link) { function get_image_width() { - if ($return = $this->get_image_tags('', 'width')) + if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width')) { return round($return[0]['data']); } - elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags('', 'url')) + elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return 88.0; } @@ -2874,11 +2905,11 @@ function embed_wmedia(width, height, link) { function get_image_height() { - if ($return = $this->get_image_tags('', 'height')) + if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'height')) { return round($return[0]['data']); } - elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags('', 'url')) + elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return 31.0; } @@ -2890,8 +2921,9 @@ function embed_wmedia(width, height, link) { function get_item_quantity($max = 0) { + $max = (int) $max; $qty = count($this->get_items()); - if ($max == 0) + if ($max === 0) { return $qty; } @@ -2916,50 +2948,54 @@ function embed_wmedia(width, height, link) { function get_items($start = 0, $end = 0) { - if (!empty($this->multifeed_objects)) + if (!isset($this->data['items'])) { - return SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit); - } - elseif (!isset($this->data['items'])) - { - if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry')) + if (!empty($this->multifeed_objects)) { - $keys = array_keys($items); - foreach ($keys as $key) - { - $this->data['items'][] =& new $this->item_class($this, $items[$key]); - } + $this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit); } - if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry')) + else { - $keys = array_keys($items); - foreach ($keys as $key) + $this->data['items'] = array(); + if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry')) { - $this->data['items'][] =& new $this->item_class($this, $items[$key]); + $keys = array_keys($items); + foreach ($keys as $key) + { + $this->data['items'][] =& new $this->item_class($this, $items[$key]); + } } - } - if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item')) - { - $keys = array_keys($items); - foreach ($keys as $key) + if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry')) { - $this->data['items'][] =& new $this->item_class($this, $items[$key]); + $keys = array_keys($items); + foreach ($keys as $key) + { + $this->data['items'][] =& new $this->item_class($this, $items[$key]); + } } - } - if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item')) - { - $keys = array_keys($items); - foreach ($keys as $key) + if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item')) { - $this->data['items'][] =& new $this->item_class($this, $items[$key]); + $keys = array_keys($items); + foreach ($keys as $key) + { + $this->data['items'][] =& new $this->item_class($this, $items[$key]); + } } - } - if ($items = $this->get_channel_tags('', 'item')) - { - $keys = array_keys($items); - foreach ($keys as $key) + if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item')) + { + $keys = array_keys($items); + foreach ($keys as $key) + { + $this->data['items'][] =& new $this->item_class($this, $items[$key]); + } + } + if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item')) { - $this->data['items'][] =& new $this->item_class($this, $items[$key]); + $keys = array_keys($items); + foreach ($keys as $key) + { + $this->data['items'][] =& new $this->item_class($this, $items[$key]); + } } } } @@ -2967,7 +3003,7 @@ function embed_wmedia(width, height, link) { if (!empty($this->data['items'])) { // If we want to order it by date, check if all items have a date, and then sort it - if ($this->order_by_date) + if ($this->order_by_date && empty($this->multifeed_objects)) { if (!isset($this->data['ordered_items'])) { @@ -2995,7 +3031,7 @@ function embed_wmedia(width, height, link) { } // Slice the data as desired - if ($end == 0) + if ($end === 0) { return array_slice($items, $start); } @@ -3010,11 +3046,17 @@ function embed_wmedia(width, height, link) { } } + /** + * @static + */ function sort_items($a, $b) { return $a->get_date('U') <= $b->get_date('U'); } + /** + * @static + */ function merge_items($urls, $start = 0, $end = 0, $limit = 0) { if (is_array($urls) && sizeof($urls) > 0) @@ -3047,7 +3089,7 @@ function embed_wmedia(width, height, link) { usort($items, array('SimplePie', 'sort_items')); } - if ($end == 0) + if ($end === 0) { return array_slice($items, $start); } @@ -3130,7 +3172,7 @@ class SimplePie_Item { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } - elseif ($return = $this->get_item_tags('', 'guid')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -3181,7 +3223,7 @@ class SimplePie_Item { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } - elseif ($return = $this->get_item_tags('', 'title')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } @@ -3215,7 +3257,7 @@ class SimplePie_Item { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } - elseif ($return = $this->get_item_tags('', 'description')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } @@ -3305,9 +3347,20 @@ class SimplePie_Item } $categories[] =& new $this->feed->category_class($term, $scheme, $label); } - foreach ((array) $this->get_item_tags('', 'category') as $category) + foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { - $categories[] =& new $this->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); + // This is really the label, but keep this as the term also for BC. + // Label will also work on retrieving because that falls back to term. + $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); + if (isset($category['attribs']['']['domain'])) + { + $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); + } + else + { + $scheme = null; + } + $categories[] =& new $this->feed->category_class($term, $scheme, null); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { @@ -3412,9 +3465,6 @@ class SimplePie_Item } } - /** - * @todo Atom inheritance (item author, source author, feed author) - */ function get_authors() { $authors = array(); @@ -3462,7 +3512,7 @@ class SimplePie_Item $authors[] =& new $this->feed->author_class($name, $url, $email); } } - if ($author = $this->get_item_tags('', 'author')) + if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author')) { $authors[] =& new $this->feed->author_class(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); } @@ -3541,7 +3591,7 @@ class SimplePie_Item { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags('', 'pubDate')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) { $this->data['date']['raw'] = $return[0]['data']; } @@ -3662,13 +3712,13 @@ class SimplePie_Item { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } - if ($links = $this->get_item_tags('', 'link')) + if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } - if ($links = $this->get_item_tags('', 'guid')) + if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) { - if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) == 'true') + if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true') { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } @@ -3689,7 +3739,7 @@ class SimplePie_Item $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } - elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) + elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } @@ -4255,7 +4305,7 @@ class SimplePie_Item $restriction_relationship = 'allow'; $restriction_type = null; $restriction_value = 'itunes'; - if (isset($restriction['data']) && strtolower($restriction['data']) == 'yes') + if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { $restriction_relationship = 'deny'; } @@ -4291,7 +4341,7 @@ class SimplePie_Item $restriction_relationship = 'allow'; $restriction_type = null; $restriction_value = 'itunes'; - if (isset($restriction['data']) && strtolower($restriction['data']) == 'yes') + if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { $restriction_relationship = 'deny'; } @@ -5402,7 +5452,7 @@ class SimplePie_Item foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link) { - if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] == 'enclosure') + if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { // Attributes $bitrate = null; @@ -5437,7 +5487,7 @@ class SimplePie_Item foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link) { - if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] == 'enclosure') + if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { // Attributes $bitrate = null; @@ -5470,7 +5520,7 @@ class SimplePie_Item } } - if ($enclosure = $this->get_item_tags('', 'enclosure')) + if ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure')) { if (isset($enclosure[0]['attribs']['']['url'])) { @@ -5505,7 +5555,7 @@ class SimplePie_Item } } - if (sizeof($this->data['enclosures']) == 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width)) + if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width)) { // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] =& new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width); @@ -5584,16 +5634,16 @@ class SimplePie_Item { if ($this->get_permalink() !== null) { - $return = $this->sanitize($item_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_permalink()); + $return = $item_url . rawurlencode($this->get_permalink()); if ($title_url !== null && $this->get_title() !== null) { - $return .= $this->sanitize($title_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_title()); + $return .= $title_url . rawurlencode($this->get_title()); } if ($summary_url !== null && $this->get_description() !== null) { - $return .= $this->sanitize($summary_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_description()); + $return .= $summary_url . rawurlencode($this->get_description()); } - return $return; + return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI); } else { @@ -5733,7 +5783,7 @@ class SimplePie_Source { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } - elseif ($return = $this->get_source_tags('', 'title')) + elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } @@ -5787,9 +5837,20 @@ class SimplePie_Source } $categories[] =& new $this->item->feed->category_class($term, $scheme, $label); } - foreach ((array) $this->get_source_tags('', 'category') as $category) + foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { - $categories[] =& new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); + // This is really the label, but keep this as the term also for BC. + // Label will also work on retrieving because that falls back to term. + $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); + if (isset($category['attribs']['']['domain'])) + { + $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); + } + else + { + $scheme = null; + } + $categories[] =& new $this->item->feed->category_class($term, $scheme, null); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { @@ -6021,7 +6082,7 @@ class SimplePie_Source { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } - if ($links = $this->get_source_tags('', 'link')) + if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } @@ -6041,7 +6102,7 @@ class SimplePie_Source $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } - elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) + elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } @@ -6077,7 +6138,7 @@ class SimplePie_Source { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } - elseif ($return = $this->get_source_tags('', 'description')) + elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } @@ -6113,7 +6174,7 @@ class SimplePie_Source { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } - elseif ($return = $this->get_source_tags('', 'copyright')) + elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -6133,7 +6194,7 @@ class SimplePie_Source function get_language() { - if ($return = $this->get_source_tags('', 'language')) + if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } @@ -6932,11 +6993,11 @@ class SimplePie_Enclosure $mime = $mime[0]; // Process values for 'auto' - if ($width == 'auto') + if ($width === 'auto') { - if ($mime == 'video') + if ($mime === 'video') { - if ($height == 'auto') + if ($height === 'auto') { $width = 480; } @@ -6955,15 +7016,15 @@ class SimplePie_Enclosure } } - if ($height == 'auto') + if ($height === 'auto') { - if ($mime == 'audio') + if ($mime === 'audio') { $height = 0; } - elseif ($mime == 'video') + elseif ($mime === 'video') { - if ($width == 'auto') + if ($width === 'auto') { if ($widescreen) { @@ -6988,17 +7049,17 @@ class SimplePie_Enclosure $height = 376; } } - elseif ($mime == 'audio') + elseif ($mime === 'audio') { $height = 0; } // Set proper placeholder value - if ($mime == 'audio') + if ($mime === 'audio') { $placeholder = $audio; } - elseif ($mime == 'video') + elseif ($mime === 'video') { $placeholder = $video; } @@ -7017,7 +7078,7 @@ class SimplePie_Enclosure } // Odeo Feed MP3's - if ($handler == 'odeo') + if ($handler === 'odeo') { if ($native) { @@ -7030,7 +7091,7 @@ class SimplePie_Enclosure } // Flash - elseif ($handler == 'flash') + elseif ($handler === 'flash') { if ($native) { @@ -7044,7 +7105,7 @@ class SimplePie_Enclosure // Flash Media Player file types. // Preferred handler for MP3 file types. - elseif ($handler == 'fmedia' || ($handler == 'mp3' && $mediaplayer != '')) + elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== '')) { $height += 20; if ($native) @@ -7059,15 +7120,17 @@ class SimplePie_Enclosure // QuickTime 7 file types. Need to test with QuickTime 6. // Only handle MP3's if the Flash Media Player is not present. - elseif ($handler == 'quicktime' || ($handler == 'mp3' && $mediaplayer == '')) + elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === '')) { $height += 16; if ($native) { - if ($placeholder != ""){ + if ($placeholder !== '') + { $embed .= "get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\">"; } - else { + else + { $embed .= "get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\">"; } } @@ -7078,7 +7141,7 @@ class SimplePie_Enclosure } // Windows Media - elseif ($handler == 'wmedia') + elseif ($handler === 'wmedia') { $height += 45; if ($native) @@ -7100,7 +7163,7 @@ class SimplePie_Enclosure function get_real_type($find_handler = false) { // If it's Odeo, let's get it out of the way. - if (substr(strtolower($this->get_link()), 0, 15) == 'http://odeo.com') + if (substr(strtolower($this->get_link()), 0, 15) === 'http://odeo.com') { return 'odeo'; } @@ -7628,7 +7691,7 @@ class SimplePie_File } $this->headers = curl_exec($fp); - if (curl_errno($fp) == 23 || curl_errno($fp) == 61) + if (curl_errno($fp) === 23 || curl_errno($fp) === 61) { curl_setopt($fp, CURLOPT_ENCODING, 'none'); $this->headers = curl_exec($fp); @@ -7650,7 +7713,7 @@ class SimplePie_File $this->headers = $parser->headers; $this->body = $parser->body; $this->status_code = $parser->status_code; - if (($this->status_code == 300 || $this->status_code == 301 || $this->status_code == 302 || $this->status_code == 303 || $this->status_code == 307 || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) + if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); @@ -7663,7 +7726,7 @@ class SimplePie_File { $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; $url_parts = parse_url($url); - if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) == 'https') + if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { $url_parts['host'] = "ssl://$url_parts[host]"; $url_parts['port'] = 443; @@ -7731,7 +7794,7 @@ class SimplePie_File $this->headers = $parser->headers; $this->body = $parser->body; $this->status_code = $parser->status_code; - if (($this->status_code == 300 || $this->status_code == 301 || $this->status_code == 302 || $this->status_code == 303 || $this->status_code == 307 || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) + if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); @@ -8438,7 +8501,7 @@ class SimplePie_gzdecode if ($this->flags & 8) { // Get the length of the filename - $len = strspn($this->compressed_data, "\x00", $this->position); + $len = strcspn($this->compressed_data, "\x00", $this->position); // Check the length of the string is still valid $this->min_compressed_size += $len + 1; @@ -8458,7 +8521,7 @@ class SimplePie_gzdecode if ($this->flags & 16) { // Get the length of the comment - $len = strspn($this->compressed_data, "\x00", $this->position); + $len = strcspn($this->compressed_data, "\x00", $this->position); // Check the length of the string is still valid $this->min_compressed_size += $len + 1; @@ -8556,7 +8619,19 @@ class SimplePie_Cache */ function create($location, $filename, $extension) { - return new SimplePie_Cache_File($location, $filename, $extension); + $location_iri =& new SimplePie_IRI($location); + switch ($location_iri->get_scheme()) + { + case 'mysql': + if (extension_loaded('mysql')) + { + return new SimplePie_Cache_MySQL($location_iri, $filename, $extension); + } + break; + + default: + return new SimplePie_Cache_File($location, $filename, $extension); + } } } @@ -8570,9 +8645,9 @@ class SimplePie_Cache_File function SimplePie_Cache_File($location, $filename, $extension) { $this->location = $location; - $this->filename = rawurlencode($filename); - $this->extension = rawurlencode($extension); - $this->name = "$location/$this->filename.$this->extension"; + $this->filename = $filename; + $this->extension = $extension; + $this->name = "$this->location/$this->filename.$this->extension"; } function save($data) @@ -8641,112 +8716,398 @@ class SimplePie_Cache_File } } -class SimplePie_Misc +class SimplePie_Cache_DB { - function time_hms($seconds) + function prepare_simplepie_object_for_cache($data) { - $time = ''; + $items = $data->get_items(); + $items_by_id = array(); - $hours = floor($seconds / 3600); - $remainder = $seconds % 3600; - if ($hours > 0) + if (!empty($items)) { - $time .= $hours.':'; + foreach ($items as $item) + { + $items_by_id[$item->get_id()] = $item; + } + + if (count($items_by_id) !== count($items)) + { + $items_by_id = array(); + foreach ($items as $item) + { + $items_by_id[$item->get_id(true)] = $item; + } + } + + if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) + { + $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; + } + elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) + { + $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; + } + elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) + { + $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; + } + elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0])) + { + $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]; + } + else + { + $channel = null; + } + + if ($channel !== null) + { + if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'])) + { + unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']); + } + if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry'])) + { + unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']); + } + if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item'])) + { + unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']); + } + if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item'])) + { + unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']); + } + if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item'])) + { + unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']); + } + } + if (isset($data->data['items'])) + { + unset($data->data['items']); + } + if (isset($data->data['ordered_items'])) + { + unset($data->data['ordered_items']); + } } + return array(serialize($data->data), $items_by_id); + } +} - $minutes = floor($remainder / 60); - $seconds = $remainder % 60; - if ($minutes < 10 && $hours > 0) +class SimplePie_Cache_MySQL extends SimplePie_Cache_DB +{ + var $mysql; + var $options; + var $id; + + function SimplePie_Cache_MySQL($mysql_location, $name, $extension) + { + $host = $mysql_location->get_host(); + if (SimplePie_Misc::stripos($host, 'unix(') === 0 && substr($host, -1) === ')') { - $minutes = '0' . $minutes; + $server = ':' . substr($host, 5, -1); } - if ($seconds < 10) + else { - $seconds = '0' . $seconds; + $server = $host; + if ($mysql_location->get_port() !== null) + { + $server .= ':' . $mysql_location->get_port(); + } } - $time .= $minutes.':'; - $time .= $seconds; + if (strpos($mysql_location->get_userinfo(), ':') !== false) + { + list($username, $password) = explode(':', $mysql_location->get_userinfo(), 2); + } + else + { + $username = $mysql_location->get_userinfo(); + $password = null; + } - return $time; + if ($this->mysql = mysql_connect($server, $username, $password)) + { + $this->id = $name . $extension; + $this->options = SimplePie_Misc::parse_str($mysql_location->get_query()); + if (!isset($this->options['prefix'][0])) + { + $this->options['prefix'][0] = ''; + } + + if (mysql_select_db(ltrim($mysql_location->get_path(), '/')) + && mysql_query('SET NAMES utf8') + && ($query = mysql_unbuffered_query('SHOW TABLES'))) + { + $db = array(); + while ($row = mysql_fetch_row($query)) + { + $db[] = $row[0]; + } + + if (!in_array($this->options['prefix'][0] . 'cache_data', $db)) + { + if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))')) + { + $this->mysql = null; + } + } + + if (!in_array($this->options['prefix'][0] . 'items', $db)) + { + if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` TEXT CHARACTER SET utf8 NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))')) + { + $this->mysql = null; + } + } + } + else + { + $this->mysql = null; + } + } } - function absolutize_url($relative, $base) + function save($data) { - if ($relative !== '') + if ($this->mysql) { - $relative = SimplePie_Misc::parse_url($relative); - if ($relative['scheme'] !== '') - { - $target = $relative; - } - elseif ($base !== '') + $feed_id = "'" . mysql_real_escape_string($this->id) . "'"; + + if (is_a($data, 'SimplePie')) { - $base = SimplePie_Misc::parse_url($base); - $target = SimplePie_Misc::parse_url(''); - if ($relative['authority'] !== '') + if (SIMPLEPIE_PHP5) { - $target = $relative; - $target['scheme'] = $base['scheme']; + // This keyword needs to defy coding standards for PHP4 compatibility + $data = clone($data); } - else + + $prepared = $this->prepare_simplepie_object_for_cache($data); + + if ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql)) { - $target['scheme'] = $base['scheme']; - $target['authority'] = $base['authority']; - if ($relative['path'] !== '') + if (mysql_num_rows($query)) { - if (strpos($relative['path'], '/') === 0) - { - $target['path'] = $relative['path']; - } - elseif ($base['authority'] !== '' && $base['path'] === '') + $items = count($prepared[1]); + if ($items) { - $target['path'] = '/' . $relative['path']; + $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = ' . $items . ', `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id; } - elseif (($last_segment = strrpos($base['path'], '/')) !== false) + else { - $target['path'] = substr($base['path'], 0, $last_segment + 1) . $relative['path']; + $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id; } - else + + if (!mysql_query($sql, $this->mysql)) { - $target['path'] = $relative['path']; + return false; } - $target['query'] = $relative['query']; } - else + elseif (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(' . $feed_id . ', ' . count($prepared[1]) . ', \'' . mysql_real_escape_string($prepared[0]) . '\', ' . time() . ')', $this->mysql)) + { + return false; + } + + $ids = array_keys($prepared[1]); + if (!empty($ids)) { - $target['path'] = $base['path']; - if ($relative['query'] !== '') + foreach ($ids as $id) { - $target['query'] = $relative['query']; + $database_ids[] = mysql_real_escape_string($id); } - elseif ($base['query'] !== '') + + if ($query = mysql_unbuffered_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'items` WHERE `id` = \'' . implode('\' OR `id` = \'', $database_ids) . '\' AND `feed_id` = ' . $feed_id, $this->mysql)) { - $target['query'] = $base['query']; + $existing_ids = array(); + while ($row = mysql_fetch_row($query)) + { + $existing_ids[] = $row[0]; + } + + $new_ids = array_diff($ids, $existing_ids); + + foreach ($new_ids as $new_id) + { + if (!($date = $prepared[1][$new_id]->get_date('U'))) + { + $date = time(); + } + + if (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(' . $feed_id . ', \'' . mysql_real_escape_string($new_id) . '\', \'' . mysql_real_escape_string(serialize($prepared[1][$new_id]->data)) . '\', ' . $date . ')', $this->mysql)) + { + return false; + } + } + return true; } } + else + { + return true; + } } - $target['fragment'] = $relative['fragment']; } - else + elseif ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql)) { - // No base URL, just return the relative URL - $target = $relative; + if (mysql_num_rows($query)) + { + if (mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = 0, `data` = \'' . mysql_real_escape_string(serialize($data)) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id, $this->mysql)) + { + return true; + } + } + elseif (mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(\'' . mysql_real_escape_string($this->id) . '\', 0, \'' . mysql_real_escape_string(serialize($data)) . '\', ' . time() . ')', $this->mysql)) + { + return true; + } + } + } + return false; + } + + function load() + { + if ($this->mysql && ($query = mysql_query('SELECT `items`, `data` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query))) + { + $data = unserialize($row[1]); + + if (isset($this->options['items'][0])) + { + $items = (int) $this->options['items'][0]; + } + else + { + $items = (int) $row[0]; + } + + if ($items !== 0) + { + if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) + { + $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; + } + elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) + { + $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; + } + elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) + { + $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; + } + elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0])) + { + $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]; + } + else + { + $feed = null; + } + + if ($feed !== null) + { + $sql = 'SELECT `data` FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . '\' ORDER BY `posted` DESC'; + if ($items > 0) + { + $sql .= ' LIMIT ' . $items; + } + + if ($query = mysql_unbuffered_query($sql, $this->mysql)) + { + while ($row = mysql_fetch_row($query)) + { + $feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row[0]); + } + } + else + { + return false; + } + } } - $return = SimplePie_Misc::compress_parse_url($target['scheme'], $target['authority'], $target['path'], $target['query'], $target['fragment']); + return $data; + } + return false; + } + + function mtime() + { + if ($this->mysql && ($query = mysql_query('SELECT `mtime` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query))) + { + return $row[0]; } else { - $return = $base; + return false; } - $return = SimplePie_Misc::normalize_url($return); - return $return; + } + + function touch() + { + if ($this->mysql && ($query = mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `mtime` = ' . time() . ' WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && mysql_affected_rows($this->mysql)) + { + return true; + } + else + { + return false; + } + } + + function unlink() + { + if ($this->mysql && ($query = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($query2 = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql))) + { + return true; + } + else + { + return false; + } + } +} + +class SimplePie_Misc +{ + function time_hms($seconds) + { + $time = ''; + + $hours = floor($seconds / 3600); + $remainder = $seconds % 3600; + if ($hours > 0) + { + $time .= $hours.':'; + } + + $minutes = floor($remainder / 60); + $seconds = $remainder % 60; + if ($minutes < 10 && $hours > 0) + { + $minutes = '0' . $minutes; + } + if ($seconds < 10) + { + $seconds = '0' . $seconds; + } + + $time .= $minutes.':'; + $time .= $seconds; + + return $time; + } + + function absolutize_url($relative, $base) + { + $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative); + return $iri->get_iri(); } function remove_dot_segments($input) { $output = ''; - while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input == '.' || $input == '..') + while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, if (strpos($input, '../') === 0) @@ -8762,7 +9123,7 @@ class SimplePie_Misc { $input = substr_replace($input, '/', 0, 3); } - elseif ($input == '/.') + elseif ($input === '/.') { $input = '/'; } @@ -8772,13 +9133,13 @@ class SimplePie_Misc $input = substr_replace($input, '/', 0, 4); $output = substr_replace($output, '', strrpos($output, '/')); } - elseif ($input == '/..') + elseif ($input === '/..') { $input = '/'; $output = substr_replace($output, '', strrpos($output, '/')); } // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, - elseif ($input == '.' || $input == '..') + elseif ($input === '.' || $input === '..') { $input = ''; } @@ -8822,7 +9183,7 @@ class SimplePie_Misc { for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++) { - if (count($attribs[$j]) == 2) + if (count($attribs[$j]) === 2) { $attribs[$j][2] = $attribs[$j][1]; } @@ -8855,22 +9216,25 @@ class SimplePie_Misc function error($message, $level, $file, $line) { - switch ($level) + if ((ini_get('error_reporting') & $level) > 0) { - case E_USER_ERROR: - $note = 'PHP Error'; - break; - case E_USER_WARNING: - $note = 'PHP Warning'; - break; - case E_USER_NOTICE: - $note = 'PHP Notice'; - break; - default: - $note = 'Unknown Error'; - break; + switch ($level) + { + case E_USER_ERROR: + $note = 'PHP Error'; + break; + case E_USER_WARNING: + $note = 'PHP Warning'; + break; + case E_USER_NOTICE: + $note = 'PHP Notice'; + break; + default: + $note = 'Unknown Error'; + break; + } + error_log("$note: $message in $file on line $line", 0); } - error_log("$note: $message in $file on line $line", 0); return $message; } @@ -8922,7 +9286,7 @@ class SimplePie_Misc { $url = SimplePie_Misc::normalize_url($url); $parsed = SimplePie_Misc::parse_url($url); - if ($parsed['scheme'] !== '' && $parsed['scheme'] != 'http' && $parsed['scheme'] != 'https') + if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https') { return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http); } @@ -8932,15 +9296,15 @@ class SimplePie_Misc return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http); } - if ($http == 2 && $parsed['scheme'] !== '') + if ($http === 2 && $parsed['scheme'] !== '') { return "feed:$url"; } - elseif ($http == 3 && strtolower($parsed['scheme']) == 'http') + elseif ($http === 3 && strtolower($parsed['scheme']) === 'http') { return substr_replace($url, 'podcast', 0, 4); } - elseif ($http == 4 && strtolower($parsed['scheme']) == 'http') + elseif ($http === 4 && strtolower($parsed['scheme']) === 'http') { return substr_replace($url, 'itpc', 0, 4); } @@ -8952,57 +9316,37 @@ class SimplePie_Misc function parse_url($url) { - preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match); - for ($i = count($match); $i <= 9; $i++) - { - $match[$i] = ''; - } - return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]); + $iri =& new SimplePie_IRI($url); + return array( + 'scheme' => (string) $iri->get_scheme(), + 'authority' => (string) $iri->get_authority(), + 'path' => (string) $iri->get_path(), + 'query' => (string) $iri->get_query(), + 'fragment' => (string) $iri->get_fragment() + ); } function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '') { - $return = ''; - if ($scheme !== '') - { - $return .= "$scheme:"; - } - if ($authority !== '') - { - $return .= "//$authority"; - } - if ($path !== '') - { - $return .= $path; - } - if ($query !== '') - { - $return .= "?$query"; - } - if ($fragment !== '') - { - $return .= "#$fragment"; - } - return $return; + $iri =& new SimplePie_IRI(''); + $iri->set_scheme($scheme); + $iri->set_authority($authority); + $iri->set_path($path); + $iri->set_query($query); + $iri->set_fragment($fragment); + return $iri->get_iri(); } function normalize_url($url) { - $url = preg_replace_callback('/%([0-9A-Fa-f]{2})/', array('SimplePie_Misc', 'percent_encoding_normalization'), $url); - $url = SimplePie_Misc::parse_url($url); - $url['scheme'] = strtolower($url['scheme']); - if ($url['authority'] !== '') - { - $url['authority'] = strtolower($url['authority']); - $url['path'] = SimplePie_Misc::remove_dot_segments($url['path']); - } - return SimplePie_Misc::compress_parse_url($url['scheme'], $url['authority'], $url['path'], $url['query'], $url['fragment']); + $iri =& new SimplePie_IRI($url); + return $iri->get_iri(); } function percent_encoding_normalization($match) { $integer = hexdec($match[1]); - if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer == 0x2D || $integer == 0x2E || $integer == 0x5F || $integer == 0x7E) + if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E) { return chr($integer); } @@ -9086,8 +9430,8 @@ class SimplePie_Misc { return SimplePie_Misc::windows_1252_to_utf8($data); } - // This is second, as behaviour of this varies only with PHP version - elseif (function_exists('mb_convert_encoding') && ($return = @mb_convert_encoding($data, $output, $input))) + // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported). + elseif (function_exists('mb_convert_encoding') && @mb_convert_encoding("\x80", 'UTF-16BE', $input) !== "\x00\x80" && ($return = @mb_convert_encoding($data, $output, $input))) { return $return; } @@ -9105,10 +9449,8 @@ class SimplePie_Misc function encoding($charset) { - /* Character sets are case-insensitive, and also need some further - normalization in the real world (though we'll return them in the form given - in their registration). */ - switch (strtolower(preg_replace('/[\x09-\x0D\x20-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]/', '', $charset))) + // Normalization from UTS #22 + switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) { case 'adobestandardencoding': case 'csadobestandardencoding': @@ -9119,8 +9461,6 @@ class SimplePie_Misc return 'Adobe-Symbol-Encoding'; case 'ami1251': - case 'ami1251': - case 'amiga1251': case 'amiga1251': return 'Amiga-1251'; @@ -9134,8 +9474,8 @@ class SimplePie_Misc case 'arabic7': case 'asmo449': case 'csiso89asmo449': - case 'isoir89': case 'iso9036': + case 'isoir89': return 'ASMO_449'; case 'big5': @@ -9157,8 +9497,8 @@ class SimplePie_Misc case 'bs4730': case 'csiso4unitedkingdom': case 'gb': - case 'isoir4': case 'iso646gb': + case 'isoir4': case 'uk': return 'BS_4730'; @@ -9175,15 +9515,15 @@ class SimplePie_Misc case 'csa71': case 'csaz243419851': case 'csiso121canadian1': - case 'isoir121': case 'iso646ca': + case 'isoir121': return 'CSA_Z243.4-1985-1'; case 'csa72': case 'csaz243419852': case 'csiso122canadian2': - case 'isoir122': case 'iso646ca2': + case 'isoir122': return 'CSA_Z243.4-1985-2'; case 'csaz24341985gr': @@ -9204,8 +9544,8 @@ class SimplePie_Misc case 'csiso21german': case 'de': case 'din66003': - case 'isoir21': case 'iso646de': + case 'isoir21': return 'DIN_66003'; case 'csdkus': @@ -9215,7 +9555,6 @@ class SimplePie_Misc case 'csiso646danish': case 'dk': case 'ds2089': - case 'ds2089': case 'iso646dk': return 'DS_2089'; @@ -9287,14 +9626,14 @@ class SimplePie_Misc case 'csiso17spanish': case 'es': - case 'isoir17': case 'iso646es': + case 'isoir17': return 'ES'; case 'csiso85spanish2': case 'es2': - case 'isoir85': case 'iso646es2': + case 'isoir85': return 'ES2'; case 'cseucfixwidjapanese': @@ -9309,23 +9648,23 @@ class SimplePie_Misc case 'gb18030': return 'GB18030'; + case 'chinese': case 'cp936': - case 'gbk': - case 'ms936': - case 'windows936': case 'csgb2312': - case 'gb2312': - case 'chinese': case 'csiso58gb231280': + case 'gb2312': case 'gb231280': + case 'gbk': case 'isoir58': + case 'ms936': + case 'windows936': return 'GBK'; case 'cn': case 'csiso57gb1988': case 'gb198880': - case 'isoir57': case 'iso646cn': + case 'isoir57': return 'GB_1988-80'; case 'csiso153gost1976874': @@ -9383,93 +9722,93 @@ class SimplePie_Misc case 'ibmthai': return 'IBM-Thai'; - case 'ccsid00858': - case 'cp00858': - case 'ibm00858': + case 'ccsid858': + case 'cp858': + case 'ibm858': case 'pcmultilingual850euro': return 'IBM00858'; - case 'ccsid00924': - case 'cp00924': + case 'ccsid924': + case 'cp924': case 'ebcdiclatin9euro': - case 'ibm00924': + case 'ibm924': return 'IBM00924'; - case 'ccsid01140': - case 'cp01140': + case 'ccsid1140': + case 'cp1140': case 'ebcdicus37euro': - case 'ibm01140': + case 'ibm1140': return 'IBM01140'; - case 'ccsid01141': - case 'cp01141': + case 'ccsid1141': + case 'cp1141': case 'ebcdicde273euro': - case 'ibm01141': + case 'ibm1141': return 'IBM01141'; - case 'ccsid01142': - case 'cp01142': + case 'ccsid1142': + case 'cp1142': case 'ebcdicdk277euro': case 'ebcdicno277euro': - case 'ibm01142': + case 'ibm1142': return 'IBM01142'; - case 'ccsid01143': - case 'cp01143': + case 'ccsid1143': + case 'cp1143': case 'ebcdicfi278euro': case 'ebcdicse278euro': - case 'ibm01143': + case 'ibm1143': return 'IBM01143'; - case 'ccsid01144': - case 'cp01144': + case 'ccsid1144': + case 'cp1144': case 'ebcdicit280euro': - case 'ibm01144': + case 'ibm1144': return 'IBM01144'; - case 'ccsid01145': - case 'cp01145': + case 'ccsid1145': + case 'cp1145': case 'ebcdices284euro': - case 'ibm01145': + case 'ibm1145': return 'IBM01145'; - case 'ccsid01146': - case 'cp01146': + case 'ccsid1146': + case 'cp1146': case 'ebcdicgb285euro': - case 'ibm01146': + case 'ibm1146': return 'IBM01146'; - case 'ccsid01147': - case 'cp01147': + case 'ccsid1147': + case 'cp1147': case 'ebcdicfr297euro': - case 'ibm01147': + case 'ibm1147': return 'IBM01147'; - case 'ccsid01148': - case 'cp01148': + case 'ccsid1148': + case 'cp1148': case 'ebcdicinternational500euro': - case 'ibm01148': + case 'ibm1148': return 'IBM01148'; - case 'ccsid01149': - case 'cp01149': + case 'ccsid1149': + case 'cp1149': case 'ebcdicis871euro': - case 'ibm01149': + case 'ibm1149': return 'IBM01149'; - case 'cp037': - case 'csibm037': + case 'cp37': + case 'csibm37': case 'ebcdiccpca': case 'ebcdiccpnl': case 'ebcdiccpus': case 'ebcdiccpwt': - case 'ibm037': + case 'ibm37': return 'IBM037'; - case 'cp038': - case 'csibm038': + case 'cp38': + case 'csibm38': case 'ebcdicint': - case 'ibm038': + case 'ibm38': return 'IBM038'; case 'cp273': @@ -9611,8 +9950,8 @@ class SimplePie_Misc return 'IBM860'; case '861': - case 'cpis': case 'cp861': + case 'cpis': case 'csibm861': case 'ibm861': return 'IBM861'; @@ -9646,15 +9985,15 @@ class SimplePie_Misc case 'ibm866': return 'IBM866'; - case 'cpar': case 'cp868': + case 'cpar': case 'csibm868': case 'ibm868': return 'IBM868'; case '869': - case 'cpgr': case 'cp869': + case 'cpgr': case 'csibm869': case 'ibm869': return 'IBM869'; @@ -9711,7 +10050,6 @@ class SimplePie_Misc case 'ibm1026': return 'IBM1026'; - case 'ibm1047': case 'ibm1047': return 'IBM1047'; @@ -9767,9 +10105,8 @@ class SimplePie_Misc case 'csisolatin2': case 'iso88592': - case 'isoir101': - case 'iso88592': case 'iso885921987': + case 'isoir101': case 'l2': case 'latin2': return 'ISO-8859-2'; @@ -9780,18 +10117,16 @@ class SimplePie_Misc case 'csisolatin3': case 'iso88593': - case 'isoir109': - case 'iso88593': case 'iso885931988': + case 'isoir109': case 'l3': case 'latin3': return 'ISO-8859-3'; case 'csisolatin4': case 'iso88594': - case 'isoir110': - case 'iso88594': case 'iso885941988': + case 'isoir110': case 'l4': case 'latin4': return 'ISO-8859-4'; @@ -9799,9 +10134,8 @@ class SimplePie_Misc case 'csisolatincyrillic': case 'cyrillic': case 'iso88595': - case 'isoir144': - case 'iso88595': case 'iso885951988': + case 'isoir144': return 'ISO-8859-5'; case 'arabic': @@ -9809,18 +10143,15 @@ class SimplePie_Misc case 'csisolatinarabic': case 'ecma114': case 'iso88596': - case 'isoir127': - case 'iso88596': case 'iso885961987': + case 'isoir127': return 'ISO-8859-6'; case 'csiso88596e': - case 'iso88596e': case 'iso88596e': return 'ISO-8859-6-E'; case 'csiso88596i': - case 'iso88596i': case 'iso88596i': return 'ISO-8859-6-I'; @@ -9830,26 +10161,22 @@ class SimplePie_Misc case 'greek': case 'greek8': case 'iso88597': - case 'isoir126': - case 'iso88597': case 'iso885971987': + case 'isoir126': return 'ISO-8859-7'; case 'csisolatinhebrew': case 'hebrew': case 'iso88598': - case 'isoir138': - case 'iso88598': case 'iso885981988': + case 'isoir138': return 'ISO-8859-8'; case 'csiso88598e': - case 'iso88598e': case 'iso88598e': return 'ISO-8859-8-E'; case 'csiso88598i': - case 'iso88598i': case 'iso88598i': return 'ISO-8859-8-I'; @@ -9859,8 +10186,8 @@ class SimplePie_Misc case 'csisolatin6': case 'iso885910': - case 'isoir157': case 'iso8859101992': + case 'isoir157': case 'l6': case 'latin6': return 'ISO-8859-10'; @@ -9869,23 +10196,20 @@ class SimplePie_Misc return 'ISO-8859-13'; case 'iso885914': + case 'iso8859141998': case 'isoceltic': case 'isoir199': - case 'iso885914': - case 'iso8859141998': case 'l8': case 'latin8': return 'ISO-8859-14'; - case 'iso885915': case 'iso885915': case 'latin9': return 'ISO-8859-15'; - case 'iso885916': - case 'isoir226': case 'iso885916': case 'iso8859162001': + case 'isoir226': case 'l10': case 'latin10': return 'ISO-8859-16'; @@ -9916,7 +10240,6 @@ class SimplePie_Misc case 'csiso115481': case 'iso115481': - case 'iso115481': case 'isotr115481': return 'ISO-11548-1'; @@ -9951,55 +10274,55 @@ class SimplePie_Misc case 'csiso2intlrefversion': case 'irv': - case 'isoir2': case 'iso646irv1983': + case 'isoir2': return 'ISO_646.irv:1983'; case 'csiso2033': case 'e13b': - case 'isoir98': case 'iso20331983': + case 'isoir98': return 'ISO_2033-1983'; case 'csiso5427cyrillic': - case 'isoir37': case 'iso5427': + case 'isoir37': return 'ISO_5427'; - case 'isoir54': case 'iso5427cyrillic1981': case 'iso54271981': + case 'isoir54': return 'ISO_5427:1981'; case 'csiso5428greek': - case 'isoir55': case 'iso54281980': + case 'isoir55': return 'ISO_5428:1980'; case 'csiso6937add': - case 'isoir152': case 'iso6937225': + case 'isoir152': return 'ISO_6937-2-25'; case 'csisotextcomm': - case 'isoir142': case 'iso69372add': + case 'isoir142': return 'ISO_6937-2-add'; case 'csiso8859supp': - case 'isoir154': case 'iso8859supp': + case 'isoir154': case 'latin125': return 'ISO_8859-supp'; case 'csiso10367box': - case 'isoir155': case 'iso10367box': + case 'isoir155': return 'ISO_10367-box'; case 'csiso15italian': - case 'isoir15': case 'iso646it': + case 'isoir15': case 'it': return 'IT'; @@ -10008,12 +10331,12 @@ class SimplePie_Misc case 'jisc62201969': case 'jisc62201969jp': case 'katakana': - case 'x02017': + case 'x2017': return 'JIS_C6220-1969-jp'; case 'csiso14jisc6220ro': - case 'isoir14': case 'iso646jp': + case 'isoir14': case 'jisc62201969ro': case 'jp': return 'JIS_C6220-1969-ro'; @@ -10023,11 +10346,11 @@ class SimplePie_Misc case 'jisc62261978': return 'JIS_C6226-1978'; - case 'csiso87jisx0208': + case 'csiso87jisx208': case 'isoir87': case 'jisc62261983': - case 'jisx02081983': - case 'x0208': + case 'jisx2081983': + case 'x208': return 'JIS_C6226-1983'; case 'csiso91jisc62291984a': @@ -10037,8 +10360,8 @@ class SimplePie_Misc return 'JIS_C6229-1984-a'; case 'csiso92jisc62991984b': - case 'isoir92': case 'iso646jpocrb': + case 'isoir92': case 'jisc62291984b': case 'jpocrb': return 'JIS_C6229-1984-b'; @@ -10071,19 +10394,19 @@ class SimplePie_Misc return 'JIS_Encoding'; case 'cshalfwidthkatakana': - case 'jisx0201': - case 'x0201': + case 'jisx201': + case 'x201': return 'JIS_X0201'; - case 'csiso159jisx02121990': + case 'csiso159jisx2121990': case 'isoir159': - case 'jisx02121990': - case 'x0212': + case 'jisx2121990': + case 'x212': return 'JIS_X0212-1990'; case 'csiso141jusib1002': - case 'isoir141': case 'iso646yu': + case 'isoir141': case 'js': case 'jusib1002': case 'yu': @@ -10157,8 +10480,8 @@ class SimplePie_Misc case 'csiso86hungarian': case 'hu': - case 'isoir86': case 'iso646hu': + case 'isoir86': case 'msz77953': return 'MSZ_7795.3'; @@ -10184,46 +10507,46 @@ class SimplePie_Misc case 'csiso151cuba': case 'cuba': - case 'isoir151': case 'iso646cu': - case 'ncnc001081': + case 'isoir151': + case 'ncnc1081': return 'NC_NC00-10:81'; case 'csiso69french': case 'fr': - case 'isoir69': case 'iso646fr': + case 'isoir69': case 'nfz62010': return 'NF_Z_62-010'; case 'csiso25french': - case 'isoir25': case 'iso646fr1': + case 'isoir25': case 'nfz620101973': return 'NF_Z_62-010_(1973)'; case 'csiso60danishnorwegian': case 'csiso60norwegian1': - case 'isoir60': case 'iso646no': + case 'isoir60': case 'no': case 'ns45511': return 'NS_4551-1'; case 'csiso61norwegian2': - case 'isoir61': case 'iso646no2': + case 'isoir61': case 'no2': case 'ns45512': return 'NS_4551-2'; - case 'osdebcdicdf03irv': + case 'osdebcdicdf3irv': return 'OSD_EBCDIC_DF03_IRV'; - case 'osdebcdicdf041': + case 'osdebcdicdf41': return 'OSD_EBCDIC_DF04_1'; - case 'osdebcdicdf0415': + case 'osdebcdicdf415': return 'OSD_EBCDIC_DF04_15'; case 'cspc8danishnorwegian': @@ -10235,14 +10558,14 @@ class SimplePie_Misc return 'PC8-Turkish'; case 'csiso16portuguese': - case 'isoir16': case 'iso646pt': + case 'isoir16': case 'pt': return 'PT'; case 'csiso84portuguese2': - case 'isoir84': case 'iso646pt2': + case 'isoir84': case 'pt2': return 'PT2'; @@ -10258,16 +10581,16 @@ class SimplePie_Misc case 'csiso10swedish': case 'fi': - case 'isoir10': case 'iso646fi': case 'iso646se': + case 'isoir10': case 'se': case 'sen850200b': return 'SEN_850200_B'; case 'csiso11swedishfornames': - case 'isoir11': case 'iso646se2': + case 'isoir11': case 'se2': case 'sen850200c': return 'SEN_850200_C'; @@ -10315,9 +10638,9 @@ class SimplePie_Misc case 'cp367': case 'csascii': case 'ibm367': - case 'isoir6': - case 'iso646us': case 'iso646irv1991': + case 'iso646us': + case 'isoir6': case 'us': case 'usascii': return 'US-ASCII'; @@ -10381,18 +10704,18 @@ class SimplePie_Misc case 'iso885911': case 'tis620': - return 'Windows-874'; + return 'windows-874'; case 'cseuckr': - case 'euckr': - case 'windows949': case 'csksc56011987': + case 'euckr': case 'isoir149': case 'korean': case 'ksc5601': case 'ksc56011987': case 'ksc56011989': - return 'Windows-949'; + case 'windows949': + return 'windows-949'; case 'windows1250': return 'windows-1250'; @@ -10404,13 +10727,10 @@ class SimplePie_Misc case 'csisolatin1': case 'ibm819': case 'iso88591': - case 'isoir100': case 'iso885911987': + case 'isoir100': case 'l1': case 'latin1': - case 'windows1252': - return 'Windows-1252'; - case 'windows1252': return 'windows-1252'; @@ -10419,13 +10739,10 @@ class SimplePie_Misc case 'csisolatin5': case 'iso88599': - case 'isoir148': case 'iso885991989': + case 'isoir148': case 'l5': case 'latin5': - case 'windows1254': - return 'Windows-1254'; - case 'windows1254': return 'windows-1254'; @@ -10452,11 +10769,11 @@ class SimplePie_Misc { $curl = $curl['version']; } - elseif (substr($curl, 0, 5) == 'curl/') + elseif (substr($curl, 0, 5) === 'curl/') { $curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5)); } - elseif (substr($curl, 0, 8) == 'libcurl/') + elseif (substr($curl, 0, 8) === 'libcurl/') { $curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8)); } @@ -10469,7 +10786,7 @@ class SimplePie_Misc function is_subclass_of($class1, $class2) { - if (func_num_args() != 2) + if (func_num_args() !== 2) { trigger_error('Wrong parameter count for SimplePie_Misc::is_subclass_of()', E_USER_WARNING); } @@ -10486,7 +10803,7 @@ class SimplePie_Misc $class2 = strtolower($class2); while ($class1 = strtolower(get_parent_class($class1))) { - if ($class1 == $class2) + if ($class1 === $class2) { return true; } @@ -10633,7 +10950,7 @@ class SimplePie_Misc function atom_03_construct_type($attribs) { - if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) == 'base64')) + if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64')) { $mode = SIMPLEPIE_CONSTRUCT_BASE64; } @@ -10705,7 +11022,7 @@ class SimplePie_Misc case 'xhtml': return SIMPLEPIE_CONSTRUCT_XHTML; } - if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) == 'text/') + if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/') { return SIMPLEPIE_CONSTRUCT_NONE; } @@ -11005,6 +11322,43 @@ class SimplePie_Misc } return $encoding; } + + function output_javascript() + { + if (function_exists('ob_gzhandler')) + { + ob_start('ob_gzhandler'); + } + header('Content-type: text/javascript; charset: UTF-8'); + header('Cache-Control: must-revalidate'); + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days + ?> +function embed_odeo(link) { + document.writeln(''); +} + +function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) { + if (placeholder != '') { + document.writeln(''); + } + else { + document.writeln(''); + } +} + +function embed_flash(bgcolor, width, height, link, loop, type) { + document.writeln(''); +} + +function embed_flv(width, height, link, placeholder, loop, player) { + document.writeln(''); +} + +function embed_wmedia(width, height, link) { + document.writeln(''); +} + data = $data; + } + + /** + * Parse the input data + * + * @access public + * @return string Output data + */ + function parse() + { + while (($this->position = strpos($this->data, '&', $this->position)) !== false) + { + $this->consume(); + $this->entity(); + $this->consumed = ''; + } + return $this->data; + } + + /** + * Consume the next byte + * + * @access private + * @return mixed The next byte, or false, if there is no more data + */ + function consume() + { + if (isset($this->data[$this->position])) + { + $this->consumed .= $this->data[$this->position]; + return $this->data[$this->position++]; + } + else + { + return false; + } + } + + /** + * Consume a range of characters + * + * @access private + * @param string $chars Characters to consume + * @return mixed A series of characters that match the range, or false + */ + function consume_range($chars) + { + if ($len = strspn($this->data, $chars, $this->position)) + { + $data = substr($this->data, $this->position, $len); + $this->consumed .= $data; + $this->position += $len; + return $data; + } + else + { + return false; + } + } + + /** + * Unconsume one byte + * + * @access private + */ + function unconsume() + { + $this->consumed = substr($this->consumed, 0, -1); + $this->position--; + } + + /** + * Decode an entity + * + * @access private + */ + function entity() + { + switch ($this->consume()) + { + case "\x09": + case "\x0A": + case "\x0B": + case "\x0B": + case "\x0C": + case "\x20": + case "\x3C": + case "\x26": + case false: + break; + + case "\x23": + switch ($this->consume()) + { + case "\x78": + case "\x58": + $range = '0123456789ABCDEFabcdef'; + $hex = true; + break; + + default: + $range = '0123456789'; + $hex = false; + $this->unconsume(); + break; + } + + if ($codepoint = $this->consume_range($range)) + { + static $windows_1252_specials = array(0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8"); + + if ($hex) + { + $codepoint = hexdec($codepoint); + } + else + { + $codepoint = intval($codepoint); + } + + if (isset($windows_1252_specials[$codepoint])) + { + $replacement = $windows_1252_specials[$codepoint]; + } + else + { + $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint); + } + + if (!in_array($this->consume(), array(';', false), true)) + { + $this->unconsume(); + } + + $consumed_length = strlen($this->consumed); + $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length); + $this->position += strlen($replacement) - $consumed_length; + } + break; + + default: + static $entities = array('Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C"); + + for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++) + { + $consumed = substr($this->consumed, 1); + if (isset($entities[$consumed])) + { + $match = $consumed; + } + } + + if ($match !== null) + { + $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1); + $this->position += strlen($entities[$match]) - strlen($consumed) - 1; + } + break; + } + } +} + +/** + * IRI parser/serialiser + * + * @package SimplePie + */ +class SimplePie_IRI +{ + /** + * Scheme + * + * @access private + * @var string + */ + var $scheme; + + /** + * User Information + * + * @access private + * @var string + */ + var $userinfo; + + /** + * Host + * + * @access private + * @var string + */ + var $host; + + /** + * Port + * + * @access private + * @var string + */ + var $port; + + /** + * Path + * + * @access private + * @var string + */ + var $path; + + /** + * Query + * + * @access private + * @var string + */ + var $query; + + /** + * Fragment + * + * @access private + * @var string + */ + var $fragment; + + /** + * Whether the object represents a valid IRI + * + * @access private + * @var array + */ + var $valid = array(); + + /** + * Return the entire IRI when you try and read the object as a string + * + * @access public + * @return string + */ + function __toString() + { + return $this->get_iri(); + } + + /** + * Create a new IRI object, from a specified string + * + * @access public + * @param string $iri + * @return SimplePie_IRI + */ + function SimplePie_IRI($iri) + { + $iri = (string) $iri; + if ($iri !== '') + { + $parsed = $this->parse_iri($iri); + $this->set_scheme($parsed['scheme']); + $this->set_authority($parsed['authority']); + $this->set_path($parsed['path']); + $this->set_query($parsed['query']); + $this->set_fragment($parsed['fragment']); + } + } + + /** + * Create a new IRI object by resolving a relative IRI + * + * @static + * @access public + * @param SimplePie_IRI $base Base IRI + * @param string $relative Relative IRI + * @return SimplePie_IRI + */ + function absolutize($base, $relative) + { + $relative = (string) $relative; + if ($relative !== '') + { + $relative =& new SimplePie_IRI($relative); + if ($relative->get_scheme() !== null) + { + $target = $relative; + } + elseif ($base->get_iri() !== null) + { + if ($relative->get_authority() !== null) + { + $target = $relative; + $target->set_scheme($base->get_scheme()); + } + else + { + $target =& new SimplePie_IRI(''); + $target->set_scheme($base->get_scheme()); + $target->set_userinfo($base->get_userinfo()); + $target->set_host($base->get_host()); + $target->set_port($base->get_port()); + if ($relative->get_path() !== null) + { + if (strpos($relative->get_path(), '/') === 0) + { + $target->set_path($relative->get_path()); + } + elseif (($base->get_userinfo() !== null || $base->get_host() !== null || $base->get_port() !== null) && $base->get_path() === null) + { + $target->set_path('/' . $relative->get_path()); + } + elseif (($last_segment = strrpos($base->get_path(), '/')) !== false) + { + $target->set_path(substr($base->get_path(), 0, $last_segment + 1) . $relative->get_path()); + } + else + { + $target->set_path($relative->get_path()); + } + $target->set_query($relative->get_query()); + } + else + { + $target->set_path($base->get_path()); + if ($relative->get_query() !== null) + { + $target->set_query($relative->get_query()); + } + elseif ($base->get_query() !== null) + { + $target->set_query($base->get_query()); + } + } + } + $target->set_fragment($relative->get_fragment()); + } + else + { + // No base URL, just return the relative URL + $target = $relative; + } + } + else + { + $target = $base; + } + return $target; + } + + /** + * Parse an IRI into scheme/authority/path/query/fragment segments + * + * @access private + * @param string $iri + * @return array + */ + function parse_iri($iri) + { + preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $iri, $match); + for ($i = count($match); $i <= 9; $i++) + { + $match[$i] = ''; + } + return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]); + } + + /** + * Remove dot segments from a path + * + * @access private + * @param string $input + * @return string + */ + function remove_dot_segments($input) + { + $output = ''; + while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') + { + // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, + if (strpos($input, '../') === 0) + { + $input = substr($input, 3); + } + elseif (strpos($input, './') === 0) + { + $input = substr($input, 2); + } + // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, + elseif (strpos($input, '/./') === 0) + { + $input = substr_replace($input, '/', 0, 3); + } + elseif ($input === '/.') + { + $input = '/'; + } + // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, + elseif (strpos($input, '/../') === 0) + { + $input = substr_replace($input, '/', 0, 4); + $output = substr_replace($output, '', strrpos($output, '/')); + } + elseif ($input === '/..') + { + $input = '/'; + $output = substr_replace($output, '', strrpos($output, '/')); + } + // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, + elseif ($input === '.' || $input === '..') + { + $input = ''; + } + // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer + elseif (($pos = strpos($input, '/', 1)) !== false) + { + $output .= substr($input, 0, $pos); + $input = substr_replace($input, '', 0, $pos); + } + else + { + $output .= $input; + $input = ''; + } + } + return $output . $input; + } + + /** + * Replace invalid character with percent encoding + * + * @access private + * @param string $string Input string + * @param string $valid_chars Valid characters + * @param int $case Normalise case + * @return string + */ + function replace_invalid_with_pct_encoding($string, $valid_chars, $case = SIMPLEPIE_SAME_CASE) + { + // Normalise case + if ($case & SIMPLEPIE_LOWERCASE) + { + $string = strtolower($string); + } + elseif ($case & SIMPLEPIE_UPPERCASE) + { + $string = strtoupper($string); + } + + // Store position and string length (to avoid constantly recalculating this) + $position = 0; + $strlen = strlen($string); + + // Loop as long as we have invalid characters, advancing the position to the next invalid character + while (($position += strspn($string, $valid_chars, $position)) < $strlen) + { + // If we have a % character + if ($string[$position] === '%') + { + // If we have a pct-encoded section + if ($position + 2 < $strlen && strspn($string, '0123456789ABCDEFabcdef', $position + 1, 2) === 2) + { + // Get the the represented character + $chr = chr(hexdec(substr($string, $position + 1, 2))); + + // If the character is valid, replace the pct-encoded with the actual character while normalising case + if (strpos($valid_chars, $chr) !== false) + { + if ($case & SIMPLEPIE_LOWERCASE) + { + $chr = strtolower($chr); + } + elseif ($case & SIMPLEPIE_UPPERCASE) + { + $chr = strtoupper($chr); + } + $string = substr_replace($string, $chr, $position, 3); + $strlen -= 2; + $position++; + } + + // Otherwise just normalise the pct-encoded to uppercase + else + { + $string = substr_replace($string, strtoupper(substr($string, $position + 1, 2)), $position + 1, 2); + $position += 3; + } + } + // If we don't have a pct-encoded section, just replace the % with its own esccaped form + else + { + $string = substr_replace($string, '%25', $position, 1); + $strlen += 2; + $position += 3; + } + } + // If we have an invalid character, change into its pct-encoded form + else + { + $replacement = sprintf("%%%02X", ord($string[$position])); + $string = str_replace($string[$position], $replacement, $string); + $strlen = strlen($string); + } + } + return $string; + } + + /** + * Check if the object represents a valid IRI + * + * @access public + * @return bool + */ + function is_valid() + { + return array_sum($this->valid) === count($this->valid); + } + + /** + * Set the scheme. Returns true on success, false on failure (if there are + * any invalid characters). + * + * @access public + * @param string $scheme + * @return bool + */ + function set_scheme($scheme) + { + if ($scheme === null || $scheme === '') + { + $this->scheme = null; + } + else + { + $len = strlen($scheme); + switch (true) + { + case $len > 1: + if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-.', 1)) + { + $this->scheme = null; + $this->valid[__FUNCTION__] = false; + return false; + } + + case $len > 0: + if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 0, 1)) + { + $this->scheme = null; + $this->valid[__FUNCTION__] = false; + return false; + } + } + $this->scheme = strtolower($scheme); + } + $this->valid[__FUNCTION__] = true; + return true; + } + + /** + * Set the authority. Returns true on success, false on failure (if there are + * any invalid characters). + * + * @access public + * @param string $authority + * @return bool + */ + function set_authority($authority) + { + if (($userinfo_end = strrpos($authority, '@')) !== false) + { + $userinfo = substr($authority, 0, $userinfo_end); + $authority = substr($authority, $userinfo_end + 1); + } + else + { + $userinfo = null; + } + + if (($port_start = strpos($authority, ':')) !== false) + { + $port = substr($authority, $port_start + 1); + $authority = substr($authority, 0, $port_start); + } + else + { + $port = null; + } + + return $this->set_userinfo($userinfo) && $this->set_host($authority) && $this->set_port($port); + } + + /** + * Set the userinfo. + * + * @access public + * @param string $userinfo + * @return bool + */ + function set_userinfo($userinfo) + { + if ($userinfo === null || $userinfo === '') + { + $this->userinfo = null; + } + else + { + $this->userinfo = $this->replace_invalid_with_pct_encoding($userinfo, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:'); + } + $this->valid[__FUNCTION__] = true; + return true; + } + + /** + * Set the host. Returns true on success, false on failure (if there are + * any invalid characters). + * + * @access public + * @param string $host + * @return bool + */ + function set_host($host) + { + if ($host === null || $host === '') + { + $this->host = null; + $this->valid[__FUNCTION__] = true; + return true; + } + elseif ($host[0] === '[' && substr($host, -1) === ']') + { + if (Net_IPv6::checkIPv6(substr($host, 1, -1))) + { + $this->host = $host; + $this->valid[__FUNCTION__] = true; + return true; + } + else + { + $this->host = null; + $this->valid[__FUNCTION__] = false; + return false; + } + } + else + { + $this->host = $this->replace_invalid_with_pct_encoding($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=', SIMPLEPIE_LOWERCASE); + $this->valid[__FUNCTION__] = true; + return true; + } + } + + /** + * Set the port. Returns true on success, false on failure (if there are + * any invalid characters). + * + * @access public + * @param string $port + * @return bool + */ + function set_port($port) + { + if ($port === null || $port === '') + { + $this->port = null; + $this->valid[__FUNCTION__] = true; + return true; + } + elseif (strspn($port, '0123456789') === strlen($port)) + { + $this->port = (int) $port; + $this->valid[__FUNCTION__] = true; + return true; + } + else + { + $this->port = null; + $this->valid[__FUNCTION__] = false; + return false; + } + } + + /** + * Set the path. + * + * @access public + * @param string $path + * @return bool + */ + function set_path($path) + { + if ($path === null || $path === '') + { + $this->path = null; + $this->valid[__FUNCTION__] = true; + return true; + } + elseif (substr($path, 0, 2) === '//' && $this->userinfo === null && $this->host === null && $this->port === null) + { + $this->path = null; + $this->valid[__FUNCTION__] = false; + return false; + } + else + { + $this->path = $this->replace_invalid_with_pct_encoding($path, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=@/'); + if ($this->scheme !== null) + { + $this->path = $this->remove_dot_segments($this->path); + } + $this->valid[__FUNCTION__] = true; + return true; + } + } + + /** + * Set the query. + * + * @access public + * @param string $query + * @return bool + */ + function set_query($query) + { + if ($query === null || $query === '') + { + $this->query = null; + } + else + { + $this->query = $this->replace_invalid_with_pct_encoding($query, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:@/?'); + } + $this->valid[__FUNCTION__] = true; + return true; + } + + /** + * Set the fragment. + * + * @access public + * @param string $fragment + * @return bool + */ + function set_fragment($fragment) + { + if ($fragment === null || $fragment === '') + { + $this->fragment = null; + } + else + { + $this->fragment = $this->replace_invalid_with_pct_encoding($fragment, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:@/?'); + } + $this->valid[__FUNCTION__] = true; + return true; + } + + /** + * Get the complete IRI + * + * @access public + * @return string + */ + function get_iri() + { + $iri = ''; + if ($this->scheme !== null) + { + $iri .= $this->scheme . ':'; + } + if (($authority = $this->get_authority()) !== null) + { + $iri .= '//' . $authority; + } + if ($this->path !== null) + { + $iri .= $this->path; + } + if ($this->query !== null) + { + $iri .= '?' . $this->query; + } + if ($this->fragment !== null) + { + $iri .= '#' . $this->fragment; + } + + if ($iri !== '') + { + return $iri; + } + else + { + return null; + } + } + + /** + * Get the scheme + * + * @access public + * @return string + */ + function get_scheme() + { + return $this->scheme; + } + + /** + * Get the complete authority + * + * @access public + * @return string + */ + function get_authority() + { + $authority = ''; + if ($this->userinfo !== null) + { + $authority .= $this->userinfo . '@'; + } + if ($this->host !== null) + { + $authority .= $this->host; + } + if ($this->port !== null) + { + $authority .= ':' . $this->port; + } + + if ($authority !== '') + { + return $authority; + } + else + { + return null; + } + } + + /** + * Get the user information + * + * @access public + * @return string + */ + function get_userinfo() + { + return $this->userinfo; + } + + /** + * Get the host + * + * @access public + * @return string + */ + function get_host() + { + return $this->host; + } + + /** + * Get the port + * + * @access public + * @return string + */ + function get_port() + { + return $this->port; + } + + /** + * Get the path * - * @access private - * @var int + * @access public + * @return string */ - var $position = 0; + function get_path() + { + return $this->path; + } /** - * Create an instance of the class with the input data + * Get the query * * @access public - * @param string $data Input data + * @return string */ - function SimplePie_Decode_HTML_Entities($data) + function get_query() { - $this->data = $data; + return $this->query; } /** - * Parse the input data + * Get the fragment * * @access public - * @return string Output data + * @return string */ - function parse() + function get_fragment() { - while (($this->position = strpos($this->data, '&', $this->position)) !== false) - { - $this->consume(); - $this->entity(); - $this->consumed = ''; - } - return $this->data; + return $this->fragment; } +} +/** + * Class to validate and to work with IPv6 addresses. + * + * @package SimplePie + * @copyright 2003-2005 The PHP Group + * @license http://www.opensource.org/licenses/bsd-license.php + * @link http://pear.php.net/package/Net_IPv6 + * @author Alexander Merz + * @author elfrink at introweb dot nl + * @author Josh Peck + * @author Geoffrey Sneddon + */ +class SimplePie_Net_IPv6 +{ /** - * Consume the next byte + * Removes a possible existing netmask specification of an IP address. * - * @access private - * @return mixed The next byte, or false, if there is no more data + * @param string $ip the (compressed) IP as Hex representation + * @return string the IP the without netmask + * @since 1.1.0 + * @access public + * @static */ - function consume() + function removeNetmaskSpec($ip) { - if (isset($this->data[$this->position])) + if (strpos($ip, '/') !== false) { - $this->consumed .= $this->data[$this->position]; - return $this->data[$this->position++]; + list($addr, $nm) = explode('/', $ip); } else { - $this->consumed = false; - return false; + $addr = $ip; } + return $addr; } /** - * Consume a range of characters + * Uncompresses an IPv6 address * - * @access private - * @param string $chars Characters to consume - * @return mixed A series of characters that match the range, or false + * RFC 2373 allows you to compress zeros in an address to '::'. This + * function expects an valid IPv6 address and expands the '::' to + * the required zeros. + * + * Example: FF01::101 -> FF01:0:0:0:0:0:0:101 + * ::1 -> 0:0:0:0:0:0:0:1 + * + * @access public + * @static + * @param string $ip a valid IPv6-address (hex format) + * @return string the uncompressed IPv6-address (hex format) */ - function consume_range($chars) + function Uncompress($ip) { - if ($len = strspn($this->data, $chars, $this->position)) - { - $data = substr($this->data, $this->position, $len); - $this->consumed .= $data; - $this->position += $len; - return $data; - } - else + $uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip); + $c1 = -1; + $c2 = -1; + if (strpos($ip, '::') !== false) { - $this->consumed = false; - return false; + list($ip1, $ip2) = explode('::', $ip); + if ($ip1 === '') + { + $c1 = -1; + } + else + { + $pos = 0; + if (($pos = substr_count($ip1, ':')) > 0) + { + $c1 = $pos; + } + else + { + $c1 = 0; + } + } + if ($ip2 === '') + { + $c2 = -1; + } + else + { + $pos = 0; + if (($pos = substr_count($ip2, ':')) > 0) + { + $c2 = $pos; + } + else + { + $c2 = 0; + } + } + if (strstr($ip2, '.')) + { + $c2++; + } + // :: + if ($c1 === -1 && $c2 === -1) + { + $uip = '0:0:0:0:0:0:0:0'; + } + // ::xxx + else if ($c1 === -1) + { + $fill = str_repeat('0:', 7 - $c2); + $uip = str_replace('::', $fill, $uip); + } + // xxx:: + else if ($c2 === -1) + { + $fill = str_repeat(':0', 7 - $c1); + $uip = str_replace('::', $fill, $uip); + } + // xxx::xxx + else + { + $fill = str_repeat(':0:', 6 - $c2 - $c1); + $uip = str_replace('::', $fill, $uip); + $uip = str_replace('::', ':', $uip); + } } + return $uip; } /** - * Unconsume one byte + * Splits an IPv6 address into the IPv6 and a possible IPv4 part * - * @access private + * RFC 2373 allows you to note the last two parts of an IPv6 address as + * an IPv4 compatible address + * + * Example: 0:0:0:0:0:0:13.1.68.3 + * 0:0:0:0:0:FFFF:129.144.52.38 + * + * @access public + * @static + * @param string $ip a valid IPv6-address (hex format) + * @return array [0] contains the IPv6 part, [1] the IPv4 part (hex format) */ - function unconsume() + function SplitV64($ip) { - $this->consumed = substr($this->consumed, 0, -1); - $this->position--; + $ip = SimplePie_Net_IPv6::Uncompress($ip); + if (strstr($ip, '.')) + { + $pos = strrpos($ip, ':'); + $ip[$pos] = '_'; + $ipPart = explode('_', $ip); + return $ipPart; + } + else + { + return array($ip, ''); + } } /** - * Decode an entity + * Checks an IPv6 address * - * @access private + * Checks if the given IP is IPv6-compatible + * + * @access public + * @static + * @param string $ip a valid IPv6-address + * @return bool true if $ip is an IPv6 address */ - function entity() + function checkIPv6($ip) { - switch ($this->consume()) + $ipPart = SimplePie_Net_IPv6::SplitV64($ip); + $count = 0; + if (!empty($ipPart[0])) { - case "\x09": - case "\x0A": - case "\x0B": - case "\x0B": - case "\x0C": - case "\x20": - case "\x3C": - case "\x26": - case false: - break; - - case "\x23": - switch ($this->consume()) + $ipv6 = explode(':', $ipPart[0]); + for ($i = 0; $i < count($ipv6); $i++) + { + $dec = hexdec($ipv6[$i]); + $hex = strtoupper(preg_replace('/^[0]{1,3}(.*[0-9a-fA-F])$/', '\\1', $ipv6[$i])); + if ($ipv6[$i] >= 0 && $dec <= 65535 && $hex === strtoupper(dechex($dec))) { - case "\x78": - case "\x58": - $range = '0123456789ABCDEFabcdef'; - $hex = true; - break; - - default: - $range = '0123456789'; - $hex = false; - $this->unconsume(); - break; + $count++; } - - if ($codepoint = $this->consume_range($range)) + } + if ($count === 8) + { + return true; + } + elseif ($count === 6 && !empty($ipPart[1])) + { + $ipv4 = explode('.', $ipPart[1]); + $count = 0; + foreach ($ipv4 as $ipv4_part) { - static $windows_1252_specials = array(0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8"); - - if ($hex) - { - $codepoint = hexdec($codepoint); - } - else - { - $codepoint = intval($codepoint); - } - - if (isset($windows_1252_specials[$codepoint])) - { - $replacement = $windows_1252_specials[$codepoint]; - } - else - { - $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint); - } - - if ($this->consume() != ';') + if ($ipv4_part >= 0 && $ipv4_part <= 255 && preg_match('/^\d{1,3}$/', $ipv4_part)) { - $this->unconsume(); + $count++; } - - $consumed_length = strlen($this->consumed); - $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length); - $this->position += strlen($replacement) - $consumed_length; } - break; - - default: - static $entities = array('Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C"); - - for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++) + if ($count === 4) { - $consumed = substr($this->consumed, 1); - if (isset($entities[$consumed])) - { - $match = $consumed; - } + return true; } + } + else + { + return false; + } - if ($match !== null) - { - $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1); - $this->position += strlen($entities[$match]) - strlen($consumed) - 1; - } - break; + } + else + { + return false; } } } @@ -12769,7 +14074,7 @@ class SimplePie_Locator $this->content_type_sniffer_class = $content_type_sniffer_class; } - function find($type = SIMPLEPIE_LOCATOR_ALL) + function find($type = SIMPLEPIE_LOCATOR_ALL, &$working) { if ($this->is_feed($this->file)) { @@ -12792,7 +14097,7 @@ class SimplePie_Locator if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery()) { - return $working; + return $working[0]; } if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links()) @@ -12865,9 +14170,10 @@ class SimplePie_Locator { $links = array_merge(SimplePie_Misc::get_element('link', $this->file->body), SimplePie_Misc::get_element('a', $this->file->body), SimplePie_Misc::get_element('area', $this->file->body)); $done = array(); + $feeds = array(); foreach ($links as $link) { - if ($this->checked_feeds == $this->max_checked_feeds) + if ($this->checked_feeds === $this->max_checked_feeds) { break; } @@ -12884,19 +14190,26 @@ class SimplePie_Locator $href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->http_base); } - if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !empty($link['attribs']['type']['data']) && in_array(strtolower(SimplePie_Misc::parse_mime($link['attribs']['type']['data'])), array('application/rss+xml', 'application/atom+xml')))) + if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !empty($link['attribs']['type']['data']) && in_array(strtolower(SimplePie_Misc::parse_mime($link['attribs']['type']['data'])), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href])) { $this->checked_feeds++; $feed =& new $this->file_class($href, $this->timeout, 5, null, $this->useragent); - if ($this->is_feed($feed)) + if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { - return $feed; + $feeds[$href] = $feed; } } $done[] = $href; } } - return null; + + if (!empty($feeds)) + { + return array_values($feeds); + } + else { + return null; + } } function get_links() @@ -12921,7 +14234,7 @@ class SimplePie_Locator $current = SimplePie_Misc::parse_url($this->file->url); - if ($parsed['authority'] === '' || $parsed['authority'] == $current['authority']) + if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority']) { $this->local[] = $href; } @@ -12945,7 +14258,7 @@ class SimplePie_Locator { foreach ($array as $key => $value) { - if ($this->checked_feeds == $this->max_checked_feeds) + if ($this->checked_feeds === $this->max_checked_feeds) { break; } @@ -12953,7 +14266,7 @@ class SimplePie_Locator { $this->checked_feeds++; $feed =& new $this->file_class($value, $this->timeout, 5, null, $this->useragent); - if ($this->is_feed($feed)) + if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { return $feed; } @@ -12970,7 +14283,7 @@ class SimplePie_Locator { foreach ($array as $key => $value) { - if ($this->checked_feeds == $this->max_checked_feeds) + if ($this->checked_feeds === $this->max_checked_feeds) { break; } @@ -12978,7 +14291,7 @@ class SimplePie_Locator { $this->checked_feeds++; $feed =& new $this->file_class($value, $this->timeout, 5, null, $this->useragent); - if ($this->is_feed($feed)) + if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { return $feed; } @@ -13000,7 +14313,6 @@ class SimplePie_Parser var $current_column; var $current_byte; var $separator = ' '; - var $feed = false; var $namespace = array(''); var $element = array(''); var $xml_base = array(''); @@ -13014,7 +14326,7 @@ class SimplePie_Parser function parse(&$data, $encoding) { // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character - if (strtoupper($encoding) == 'US-ASCII') + if (strtoupper($encoding) === 'US-ASCII') { $this->encoding = 'UTF-8'; } @@ -13065,35 +14377,110 @@ class SimplePie_Parser } } - // Work around libxml bug - $data = str_replace('<', '<', $data); - $data = str_replace('>', '>', $data); - $data = str_replace('&', '&', $data); - $data = str_replace(''', ''', $data); - $data = str_replace('"', '"', $data); - $return = true; + static $xml_is_sane = null; + if ($xml_is_sane === null) + { + $parser_check = xml_parser_create(); + xml_parse_into_struct($parser_check, '&', $values); + xml_parser_free($parser_check); + $xml_is_sane = isset($values[0]['value']); + } + // Create the parser - $xml = xml_parser_create_ns($this->encoding, $this->separator); - xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1); - xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0); - xml_set_object($xml, $this); - xml_set_character_data_handler($xml, 'cdata'); - xml_set_element_handler($xml, 'tag_open', 'tag_close'); - - // Parse! - if (!xml_parse($xml, $data, true)) - { - $this->error_code = xml_get_error_code($xml); - $this->error_string = xml_error_string($this->error_code); - $return = false; - } - $this->current_line = xml_get_current_line_number($xml); - $this->current_column = xml_get_current_column_number($xml); - $this->current_byte = xml_get_current_byte_index($xml); - xml_parser_free($xml); - return $return; + if ($xml_is_sane) + { + $xml = xml_parser_create_ns($this->encoding, $this->separator); + xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1); + xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0); + xml_set_object($xml, $this); + xml_set_character_data_handler($xml, 'cdata'); + xml_set_element_handler($xml, 'tag_open', 'tag_close'); + + // Parse! + if (!xml_parse($xml, $data, true)) + { + $this->error_code = xml_get_error_code($xml); + $this->error_string = xml_error_string($this->error_code); + $return = false; + } + $this->current_line = xml_get_current_line_number($xml); + $this->current_column = xml_get_current_column_number($xml); + $this->current_byte = xml_get_current_byte_index($xml); + xml_parser_free($xml); + return $return; + } + else + { + libxml_clear_errors(); + $xml =& new XMLReader(); + $xml->xml($data); + while (@$xml->read()) + { + switch ($xml->nodeType) + { + + case constant('XMLReader::END_ELEMENT'): + if ($xml->namespaceURI !== '') + { + $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}"; + } + else + { + $tagName = $xml->localName; + } + $this->tag_close(null, $tagName); + break; + case constant('XMLReader::ELEMENT'): + $empty = $xml->isEmptyElement; + if ($xml->namespaceURI !== '') + { + $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}"; + } + else + { + $tagName = $xml->localName; + } + $attributes = array(); + while ($xml->moveToNextAttribute()) + { + if ($xml->namespaceURI !== '') + { + $attrName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}"; + } + else + { + $attrName = $xml->localName; + } + $attributes[$attrName] = $xml->value; + } + $this->tag_open(null, $tagName, $attributes); + if ($empty) + { + $this->tag_close(null, $tagName); + } + break; + case constant('XMLReader::TEXT'): + + case constant('XMLReader::CDATA'): + $this->cdata(null, $xml->value); + break; + } + } + if ($error = libxml_get_last_error()) + { + $this->error_code = $error->code; + $this->error_string = $error->message; + $this->current_line = $error->line; + $this->current_column = $error->column; + return false; + } + else + { + return true; + } + } } function get_error_code() @@ -13128,27 +14515,6 @@ class SimplePie_Parser function tag_open($parser, $tag, $attributes) { - if ($this->feed === 0) - { - return; - } - elseif ($this->feed == false) - { - if (in_array($tag, array( - SIMPLEPIE_NAMESPACE_ATOM_10 . $this->separator . 'feed', - SIMPLEPIE_NAMESPACE_ATOM_03 . $this->separator . 'feed', - 'rss', - SIMPLEPIE_NAMESPACE_RDF . $this->separator . 'RDF' - ))) - { - $this->feed = 1; - } - } - else - { - $this->feed++; - } - list($this->namespace[], $this->element[]) = $this->split_ns($tag); $attribs = array(); @@ -13181,7 +14547,7 @@ class SimplePie_Parser if ($this->current_xhtml_construct >= 0) { $this->current_xhtml_construct++; - if (end($this->namespace) == SIMPLEPIE_NAMESPACE_XHTML) + if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML) { $this->data['data'] .= '<' . end($this->element); if (isset($attribs[''])) @@ -13199,8 +14565,8 @@ class SimplePie_Parser $this->datas[] =& $this->data; $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][]; $this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)); - if ((end($this->namespace) == SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] == 'xml') - || (end($this->namespace) == SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] == 'xhtml')) + if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml') + || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')) { $this->current_xhtml_construct = 0; } @@ -13213,7 +14579,7 @@ class SimplePie_Parser { $this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding); } - elseif ($this->feed > 1) + else { $this->data['data'] .= $cdata; } @@ -13221,22 +14587,17 @@ class SimplePie_Parser function tag_close($parser, $tag) { - if (!$this->feed) - { - return; - } - if ($this->current_xhtml_construct >= 0) { $this->current_xhtml_construct--; - if (end($this->namespace) == SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'))) + if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'))) { $this->data['data'] .= 'element) . '>'; } } - if ($this->current_xhtml_construct == -1) + if ($this->current_xhtml_construct === -1) { - $this->data =& $this->datas[$this->feed]; + $this->data =& $this->datas[count($this->datas) - 1]; array_pop($this->datas); } @@ -13245,7 +14606,6 @@ class SimplePie_Parser array_pop($this->xml_base); array_pop($this->xml_base_explicit); array_pop($this->xml_lang); - $this->feed--; } function split_ns($string) @@ -13543,7 +14903,7 @@ class SimplePie_Sanitize $file =& new $this->file_class($img['attribs']['src']['data'], $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen); $headers = $file->headers; - if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300))) + if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) { if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) { @@ -13552,7 +14912,7 @@ class SimplePie_Sanitize } else { - trigger_error("$cache->name is not writeable", E_USER_WARNING); + trigger_error("$this->cache_location is not writeable", E_USER_WARNING); } } } @@ -13574,7 +14934,7 @@ class SimplePie_Sanitize $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); } - if ($this->output_encoding != 'UTF-8') + if ($this->output_encoding !== 'UTF-8') { $data = SimplePie_Misc::change_encoding($data, 'UTF-8', $this->output_encoding); } diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php index af3808b8..54afdef0 100644 --- a/wp-includes/class.wp-dependencies.php +++ b/wp-includes/class.wp-dependencies.php @@ -171,8 +171,14 @@ class WP_Dependencies { } function dequeue( $handles ) { - foreach ( (array) $handles as $handle ) - unset( $this->queue[$handle] ); + foreach ( (array) $handles as $handle ) { + $handle = explode('?', $handle); + $key = array_search($handle[0], $this->queue); + if ( false !== $key ) { + unset($this->queue[$key]); + unset($this->args[$handle[0]]); + } + } } function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 0fcb60ea..d290bbaa 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -214,7 +214,7 @@ class WP { // Trim the query of everything up to the '?'. $query = preg_replace("!^.+\?!", '', $query); - + // Substitute the substring matches into the query. $query = addslashes(WP_MatchesMapRegex::apply($query, $matches)); @@ -1594,59 +1594,59 @@ class WP_Ajax_Response { /** * Helper class to remove the need to use eval to replace $matches[] in query strings. - * + * * @since 2.9.0 */ class WP_MatchesMapRegex { /** * store for matches - * + * * @access private * @var array */ var $_matches; - + /** * store for mapping result - * + * * @access public * @var string */ var $output; - + /** * subject to perform mapping on (query string containing $matches[] references - * + * * @access private * @var string */ var $_subject; - + /** - * regexp pattern to match $matches[] references - * + * regexp pattern to match $matches[] references + * * @var string */ var $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number - + /** * constructor - * + * * @param string $subject subject if regex * @param array $matches data to use in map * @return self - */ + */ function WP_MatchesMapRegex($subject, $matches) { $this->_subject = $subject; $this->_matches = $matches; - $this->output = $this->_map(); + $this->output = $this->_map(); } - + /** * Substitute substring matches in subject. - * + * * static helper function to ease use - * + * * @access public * @param string $subject subject * @param array $matches data used for subsitution @@ -1654,12 +1654,12 @@ class WP_MatchesMapRegex { */ function apply($subject, $matches) { $oSelf =& new WP_MatchesMapRegex($subject, $matches); - return $oSelf->output; + return $oSelf->output; } - + /** - * do the actual mapping - * + * do the actual mapping + * * @access private * @return string */ @@ -1667,10 +1667,10 @@ class WP_MatchesMapRegex { $callback = array(&$this, 'callback'); return preg_replace_callback($this->_pattern, $callback, $this->_subject); } - + /** * preg_replace_callback hook - * + * * @access public * @param array $matches preg_replace regexp matches * @return string @@ -1679,7 +1679,7 @@ class WP_MatchesMapRegex { $index = intval(substr($matches[0], 9, -1)); return ( isset( $this->_matches[$index] ) ? $this->_matches[$index] : '' ); } - + } ?> diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index a5ebcd16..321080af 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -532,7 +532,7 @@ function get_comments_number( $post_id = 0 ) { else $count = $post->comment_count; - return apply_filters('get_comments_number', $count); + return apply_filters('get_comments_number', $count, $post_id); } /** @@ -599,12 +599,12 @@ function comment_text() { */ function get_comment_time( $d = '', $gmt = false, $translate = true ) { global $comment; - $comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date; + $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date; if ( '' == $d ) $date = mysql2date(get_option('time_format'), $comment_date, $translate); else $date = mysql2date($d, $comment_date, $translate); - return apply_filters('get_comment_time', $date, $d, $gmt); + return apply_filters('get_comment_time', $date, $d, $gmt, $translate); } /** @@ -813,7 +813,7 @@ function wp_comment_form_unfiltered_html_nonce() { function comments_template( $file = '/comments.php', $separate_comments = false ) { global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage; - if ( ! (is_single() || is_page() || $withcomments) ) + if ( !(is_single() || is_page() || $withcomments) || empty($post) ) return; if ( empty($file) ) @@ -835,12 +835,12 @@ function comments_template( $file = '/comments.php', $separate_comments = false /** * The email address of the current comment author escaped for use in attributes. - */ + */ $comment_author_email = $commenter['comment_author_email']; // Escaped by sanitize_comment_cookies() /** * The url of the current comment author escaped for use in attributes. - */ + */ $comment_author_url = esc_url($commenter['comment_author_url']); /** @todo Use API instead of SELECTs. */ @@ -970,7 +970,7 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c if ( !empty( $css_class ) ) { echo ' class="'.$css_class.'" '; } - $title = esc_attr( get_the_title() ); + $title = the_title_attribute( 'echo=0' ); echo apply_filters( 'comments_popup_link_attributes', '' ); @@ -1255,7 +1255,7 @@ class Walker_Comment extends Walker { } ?> < id="comment-"> - +
      @@ -1274,7 +1274,7 @@ class Walker_Comment extends Walker {
      $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
      - +
      get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment)); + if ( ! $_comment ) + return $null; wp_cache_add($_comment->comment_ID, $_comment, 'comment'); } } @@ -208,6 +211,8 @@ function get_comments( $args = '' ) { $approved = "comment_approved = '1'"; elseif ( 'spam' == $status ) $approved = "comment_approved = 'spam'"; + elseif ( 'trash' == $status ) + $approved = "comment_approved = 'trash'"; else $approved = "( comment_approved = '0' OR comment_approved = '1' )"; @@ -359,6 +364,86 @@ function get_comment_count( $post_id = 0 ) { return $comment_count; } +// +// Comment meta functions +// + +/** + * Add meta data field to a comment. + * + * @since 2.9 + * @uses add_metadata + * @link http://codex.wordpress.org/Function_Reference/add_comment_meta + * + * @param int $comment_id Comment ID. + * @param string $key Metadata name. + * @param mixed $value Metadata value. + * @param bool $unique Optional, default is false. Whether the same key should not be added. + * @return bool False for failure. True for success. + */ +function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) { + return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique); +} + +/** + * Remove metadata matching criteria from a comment. + * + * You can match based on the key, or key and value. Removing based on key and + * value, will keep from removing duplicate metadata with the same key. It also + * allows removing all metadata matching key, if needed. + * + * @since 2.9 + * @uses delete_metadata + * @link http://codex.wordpress.org/Function_Reference/delete_comment_meta + * + * @param int $comment_id comment ID + * @param string $meta_key Metadata name. + * @param mixed $meta_value Optional. Metadata value. + * @return bool False for failure. True for success. + */ +function delete_comment_meta($comment_id, $meta_key, $meta_value = '') { + return delete_metadata('comment', $comment_id, $meta_key, $meta_value); +} + +/** + * Retrieve comment meta field for a comment. + * + * @since 2.9 + * @uses get_metadata + * @link http://codex.wordpress.org/Function_Reference/get_comment_meta + * + * @param int $comment_id Comment ID. + * @param string $key The meta key to retrieve. + * @param bool $single Whether to return a single value. + * @return mixed Will be an array if $single is false. Will be value of meta data field if $single + * is true. + */ +function get_comment_meta($comment_id, $key, $single = false) { + return get_metadata('comment', $comment_id, $key, $single); +} + +/** + * Update comment meta field based on comment ID. + * + * Use the $prev_value parameter to differentiate between meta fields with the + * same key and comment ID. + * + * If the meta field for the comment does not exist, it will be added. + * + * @since 2.9 + * @uses update_metadata + * @link http://codex.wordpress.org/Function_Reference/update_comment_meta + * + * @param int $comment_id Comment ID. + * @param string $key Metadata key. + * @param mixed $value Metadata value. + * @param mixed $prev_value Optional. Previous value to check before removing. + * @return bool False on failure, true if success. + */ +function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') { + return update_metadata('comment', $comment_id, $meta_key, $meta_value, $prev_value); +} + /** * Sanitizes the cookies sent to the user already. * @@ -406,7 +491,7 @@ function wp_allow_comment($commentdata) { // Simple duplicate check // expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content) - $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' "; + $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_approved != 'trash' AND ( comment_author = '$comment_author' "; if ( $comment_author_email ) $dupe .= "OR comment_author_email = '$comment_author_email' "; $dupe .= ") AND comment_content = '$comment_content' LIMIT 1"; @@ -419,7 +504,7 @@ function wp_allow_comment($commentdata) { do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt ); - if ( $user_id ) { + if ( isset($user_id) && $user_id) { $userdata = get_userdata($user_id); $user = new WP_User($user_id); $post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID)); @@ -463,7 +548,8 @@ function check_comment_flood_db( $ip, $email, $date ) { global $wpdb; if ( current_user_can( 'manage_options' ) ) return; // don't throttle admins - if ( $lasttime = $wpdb->get_var( $wpdb->prepare("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = %s OR comment_author_email = %s ORDER BY comment_date DESC LIMIT 1", $ip, $email) ) ) { + $hour_ago = gmdate( 'Y-m-d H:i:s', time() - 3600 ); + if ( $lasttime = $wpdb->get_var( $wpdb->prepare( "SELECT `comment_date_gmt` FROM `$wpdb->comments` WHERE `comment_date_gmt` >= %s AND ( `comment_author_IP` = %s OR `comment_author_email` = %s ) ORDER BY `comment_date_gmt` DESC LIMIT 1", $hour_ago, $ip, $email ) ) ) { $time_lastcomment = mysql2date('U', $lasttime, false); $time_newcomment = mysql2date('U', $date, false); $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); @@ -623,16 +709,6 @@ function get_page_of_comment( $comment_ID, $args = array() ) { function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) { do_action('wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent); - if ( preg_match_all('/&#(\d+);/', $comment . $author . $url, $chars) ) { - foreach ( (array) $chars[1] as $char ) { - // If it's an encoded char in the normal ASCII set, reject - if ( 38 == $char ) - continue; // Unless it's & - if ( $char < 128 ) - return true; - } - } - $mod_keys = trim( get_option('blacklist_keys') ); if ( '' == $mod_keys ) return false; // If moderation keys are empty @@ -693,16 +769,18 @@ function wp_count_comments( $post_id = 0 ) { return $count; $where = ''; - if( $post_id > 0 ) + if ( $post_id > 0 ) $where = $wpdb->prepare( "WHERE comment_post_ID = %d", $post_id ); $count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved", ARRAY_A ); $total = 0; - $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam'); + $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed'); $known_types = array_keys( $approved ); foreach( (array) $count as $row_num => $row ) { - $total += $row['num_comments']; + // Don't count post-trashed toward totals + if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] ) + $total += $row['num_comments']; if ( in_array( $row['comment_approved'], $known_types ) ) $stats[$approved[$row['comment_approved']]] = $row['num_comments']; } @@ -728,6 +806,7 @@ function wp_count_comments( $post_id = 0 ) { * @since 2.0.0 * @uses $wpdb * @uses do_action() Calls 'delete_comment' hook on comment ID + * @uses do_action() Calls 'deleted_comment' hook on comment ID after deletion, on success * @uses do_action() Calls 'wp_set_comment_status' hook on comment ID with 'delete' set for the second parameter * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object * @@ -736,12 +815,13 @@ function wp_count_comments( $post_id = 0 ) { */ function wp_delete_comment($comment_id) { global $wpdb; - do_action('delete_comment', $comment_id); + if (!$comment = get_comment($comment_id)) + return false; - $comment = get_comment($comment_id); + if (wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0) + return wp_trash_comment($comment_id); - if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) ) - return false; + do_action('delete_comment', $comment_id); // Move children up a level. $children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment_id) ); @@ -750,6 +830,19 @@ function wp_delete_comment($comment_id) { clean_comment_cache($children); } + // Delete metadata + $meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->commentmeta WHERE comment_id = %d ", $comment_id ) ); + if ( !empty($meta_ids) ) { + do_action( 'delete_commentmeta', $meta_ids ); + $in_meta_ids = "'" . implode("', '", $meta_ids) . "'"; + $wpdb->query( "DELETE FROM $wpdb->commentmeta WHERE meta_id IN ($in_meta_ids)" ); + do_action( 'deleted_commentmeta', $meta_ids ); + } + + if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) ) + return false; + do_action('deleted_comment', $comment_id); + $post_id = $comment->comment_post_ID; if ( $post_id && $comment->comment_approved == 1 ) wp_update_comment_count($post_id); @@ -761,13 +854,126 @@ function wp_delete_comment($comment_id) { return true; } +/** + * Moves a comment to the Trash + * + * @since 2.9.0 + * @uses do_action() on 'trash_comment' before trashing + * @uses do_action() on 'trashed_comment' after trashing + * + * @param int $comment_id Comment ID. + * @return mixed False on failure + */ +function wp_trash_comment($comment_id) { + if ( EMPTY_TRASH_DAYS == 0 ) + return wp_delete_comment($comment_id); + + if ( !$comment = get_comment($comment_id) ) + return false; + + do_action('trash_comment', $comment_id); + + if ( wp_set_comment_status($comment_id, 'trash') ) { + add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved); + add_comment_meta($comment_id, '_wp_trash_meta_time', time() ); + do_action('trashed_comment', $comment_id); + return true; + } + + return false; +} + +/** + * Removes a comment from the Trash + * + * @since 2.9.0 + * @uses do_action() on 'untrash_comment' before untrashing + * @uses do_action() on 'untrashed_comment' after untrashing + * + * @param int $comment_id Comment ID. + * @return mixed False on failure + */ +function wp_untrash_comment($comment_id) { + if ( ! (int)$comment_id ) + return false; + + do_action('untrash_comment', $comment_id); + + $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true); + if ( empty($status) ) + $status = '0'; + + if ( wp_set_comment_status($comment_id, $status) ) { + delete_comment_meta($comment_id, '_wp_trash_meta_time'); + delete_comment_meta($comment_id, '_wp_trash_meta_status'); + do_action('untrashed_comment', $comment_id); + return true; + } + + return false; +} + +/** + * Marks a comment as Spam + * + * @since 2.9.0 + * @uses do_action() on 'spam_comment' before spamming + * @uses do_action() on 'spammed_comment' after spamming + * + * @param int $comment_id Comment ID. + * @return mixed False on failure + */ +function wp_spam_comment($comment_id) { + if ( !$comment = get_comment($comment_id) ) + return false; + + do_action('spam_comment', $comment_id); + + if ( wp_set_comment_status($comment_id, 'spam') ) { + add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved); + do_action('spammed_comment', $comment_id); + return true; + } + + return false; +} + +/** + * Removes a comment from the Spam + * + * @since 2.9.0 + * @uses do_action() on 'unspam_comment' before unspamming + * @uses do_action() on 'unspammed_comment' after unspamming + * + * @param int $comment_id Comment ID. + * @return mixed False on failure + */ +function wp_unspam_comment($comment_id) { + if ( ! (int)$comment_id ) + return false; + + do_action('unspam_comment', $comment_id); + + $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true); + if ( empty($status) ) + $status = '0'; + + if ( wp_set_comment_status($comment_id, $status) ) { + delete_comment_meta($comment_id, '_wp_trash_meta_status'); + do_action('unspammed_comment', $comment_id); + return true; + } + + return false; +} + /** * The status of a comment by ID. * * @since 1.0.0 * * @param int $comment_id Comment ID - * @return string|bool Status might be 'deleted', 'approved', 'unapproved', 'spam'. False on failure. + * @return string|bool Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure. */ function wp_get_comment_status($comment_id) { $comment = get_comment($comment_id); @@ -777,13 +983,15 @@ function wp_get_comment_status($comment_id) { $approved = $comment->comment_approved; if ( $approved == NULL ) - return 'deleted'; + return false; elseif ( $approved == '1' ) return 'approved'; elseif ( $approved == '0' ) return 'unapproved'; elseif ( $approved == 'spam' ) return 'spam'; + elseif ( $approved == 'trash' ) + return 'trash'; else return false; } @@ -925,7 +1133,10 @@ function wp_insert_comment($commentdata) { * @return array Parsed comment information. */ function wp_filter_comment($commentdata) { - $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_ID']); + if ( isset($commentdata['user_ID']) ) + $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_ID']); + elseif ( isset($commentdata['user_id']) ) + $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_id']); $commentdata['comment_agent'] = apply_filters('pre_comment_user_agent', $commentdata['comment_agent']); $commentdata['comment_author'] = apply_filters('pre_comment_author_name', $commentdata['comment_author']); $commentdata['comment_content'] = apply_filters('pre_comment_content', $commentdata['comment_content']); @@ -976,14 +1187,17 @@ function wp_new_comment( $commentdata ) { $commentdata = apply_filters('preprocess_comment', $commentdata); $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID']; - $commentdata['user_ID'] = (int) $commentdata['user_ID']; + if ( isset($commentdata['user_ID']) ) + $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID']; + elseif ( isset($commentdata['user_id']) ) + $commentdata['user_id'] = (int) $commentdata['user_id']; - $commentdata['comment_parent'] = absint($commentdata['comment_parent']); + $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0; $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : ''; $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); - $commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT']; + $commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254); $commentdata['comment_date'] = current_time('mysql'); $commentdata['comment_date_gmt'] = current_time('mysql', 1); @@ -1002,7 +1216,7 @@ function wp_new_comment( $commentdata ) { $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment - if ( get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_ID'] ) + if ( get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_id'] ) wp_notify_postauthor($comment_ID, $commentdata['comment_type']); } @@ -1032,9 +1246,11 @@ function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) $status = '0'; switch ( $comment_status ) { case 'hold': + case '0': $status = '0'; break; case 'approve': + case '1': $status = '1'; if ( get_option('comments_notify') ) { $comment = get_comment($comment_id); @@ -1044,13 +1260,15 @@ function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) case 'spam': $status = 'spam'; break; - case 'delete': - return wp_delete_comment($comment_id); + case 'trash': + $status = 'trash'; break; default: return false; } + $comment_old = wp_clone(get_comment($comment_id)); + if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) { if ( $wp_error ) return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error); @@ -1063,7 +1281,7 @@ function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) $comment = get_comment($comment_id); do_action('wp_set_comment_status', $comment_id, $comment_status); - wp_transition_comment_status($comment_status, $comment->comment_approved, $comment); + wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment); wp_update_comment_count($comment->comment_post_ID); @@ -1089,7 +1307,7 @@ function wp_update_comment($commentarr) { $comment = get_comment($commentarr['comment_ID'], ARRAY_A); // Escape data pulled from DB. - $comment = $wpdb->escape($comment); + $comment = esc_sql($comment); $old_status = $comment['comment_approved']; @@ -1309,13 +1527,19 @@ function do_all_pings() { // Do pingbacks while ($ping = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) { - $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';"); + $mid = $wpdb->get_var( "SELECT meta_id FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme' LIMIT 1"); + do_action( 'delete_postmeta', $mid ); + $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->postmeta} WHERE meta_id = %d", $mid ) ); + do_action( 'deleted_postmeta', $mid ); pingback($ping->post_content, $ping->ID); } // Do Enclosures while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) { - $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = '_encloseme';", $enclosure->ID) ); + $mid = $wpdb->get_var( $wpdb->prepare("SELECT meta_id FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = '_encloseme'", $enclosure->ID) ); + do_action( 'delete_postmeta', $mid ); + $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE meta_id = %d", $mid) ); + do_action( 'deleted_postmeta', $mid ); do_enclose($enclosure->post_content, $enclosure->ID); } @@ -1457,8 +1681,7 @@ function pingback($content, $post_ID) { // using a timeout of 3 seconds should be enough to cover slow servers $client = new IXR_Client($pingback_server_url); $client->timeout = 3; - $client->useragent .= ' -- WordPress/' . $wp_version; - + $client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . $wp_version, $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom); // when set to true, this outputs debug messages by itself $client->debug = false; diff --git a/wp-includes/compat.php b/wp-includes/compat.php index 00438650..ce7e954c 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -56,8 +56,13 @@ if (!function_exists('stripos')) { } } -if ( ! function_exists('hash_hmac') ): +if ( !function_exists('hash_hmac') ): function hash_hmac($algo, $data, $key, $raw_output = false) { + return _hash_hmac($algo, $data, $key, $raw_output); +} +endif; + +function _hash_hmac($algo, $data, $key, $raw_output = false) { $packs = array('md5' => 'H32', 'sha1' => 'H40'); if ( !isset($packs[$algo]) ) @@ -67,17 +72,20 @@ function hash_hmac($algo, $data, $key, $raw_output = false) { if (strlen($key) > 64) $key = pack($pack, $algo($key)); - else if (strlen($key) < 64) - $key = str_pad($key, 64, chr(0)); + + $key = str_pad($key, 64, chr(0)); $ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64)); $opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64)); - return $algo($opad . pack($pack, $algo($ipad . $data))); + $hmac = $algo($opad . pack($pack, $algo($ipad . $data))); + + if ( $raw_output ) + return pack( $pack, $hmac ); + return $hmac; } -endif; -if ( ! function_exists('mb_substr') ): +if ( !function_exists('mb_substr') ): function mb_substr( $str, $start, $length=null, $encoding=null ) { return _mb_substr($str, $start, $length, $encoding); } @@ -115,4 +123,40 @@ if ( !function_exists( 'htmlspecialchars_decode' ) ) { } } -?> +// For PHP < 5.2.0 +if ( !function_exists('json_encode') ) { + function json_encode( $string ) { + global $wp_json; + + if ( !is_a($wp_json, 'Services_JSON') ) { + require_once( 'class-json.php' ); + $wp_json = new Services_JSON(); + } + + return $wp_json->encode( $string ); + } +} + +if ( !function_exists('json_decode') ) { + function json_decode( $string ) { + global $wp_json; + + if ( !is_a($wp_json, 'Services_JSON') ) { + require_once( 'class-json.php' ); + $wp_json = new Services_JSON(); + } + + return $wp_json->decode( $string ); + } +} + +// pathinfo that fills 'filename' without extension like in PHP 5.2+ +function pathinfo52($path) { + $parts = pathinfo($path); + if ( !isset($parts['filename']) ) { + $parts['filename'] = substr( $parts['basename'], 0, strrpos($parts['basename'], '.') ); + if ( empty($parts['filename']) ) // there's no extension + $parts['filename'] = $parts['basename']; + } + return $parts; +} diff --git a/wp-includes/cron.php b/wp-includes/cron.php index be9ea67e..416803a9 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -8,7 +8,7 @@ /** * Schedules a hook to run only once. * - * Schedules a hook which will be executed once by the Wordpress actions core at + * Schedules a hook which will be executed once by the WordPress actions core at * a time which you specify. The action will fire off when someone visits your * WordPress site, if the schedule time has passed. * @@ -393,5 +393,3 @@ function _upgrade_cron_array($cron) { function check_server_timer( $local_time ) { return true; } - -?> diff --git a/wp-includes/default-embeds.php b/wp-includes/default-embeds.php new file mode 100644 index 00000000..d0a2336d --- /dev/null +++ b/wp-includes/default-embeds.php @@ -0,0 +1,52 @@ +', $matches, $attr, $url, $rawattr ); +} +wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' ); + +/** + * The PollDaddy.com embed handler callback. PollDaddy does not support oEmbed, at least not yet. + * + * @see WP_Embed::register_handler() + * @see WP_Embed::shortcode() + * + * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}. + * @param array $attr Embed attributes. + * @param string $url The original URL that was matched by the regex. + * @param array $rawattr The original unmodified attributes. + * @return string The embed HTML. + */ +function wp_embed_handler_polldaddy( $matches, $attr, $url, $rawattr ) { + return apply_filters( 'embed_polldaddy', '', $matches, $attr, $url, $rawattr ); +} +wp_embed_register_handler( 'polldaddy', '#http://answers.polldaddy.com/poll/(\d+)(.*?)#i', 'wp_embed_handler_polldaddy' ); + +?> \ No newline at end of file diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 2519d7aa..668f389d 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -13,200 +13,215 @@ */ // Strip, trim, kses, special chars for string saves -$filters = array('pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', - 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', - 'pre_user_nickname'); -foreach ( $filters as $filter ) { - add_filter($filter, 'strip_tags'); - add_filter($filter, 'trim'); - add_filter($filter, 'wp_filter_kses'); - add_filter($filter, '_wp_specialchars', 30); +foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) { + add_filter( $filter, 'sanitize_text_field' ); + add_filter( $filter, 'wp_filter_kses' ); + add_filter( $filter, '_wp_specialchars', 30 ); +} + +// Strip, kses, special chars for string display +foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) { + add_filter( $filter, 'sanitize_text_field' ); + add_filter( $filter, 'wp_kses_data' ); + add_filter( $filter, '_wp_specialchars', 30 ); } // Kses only for textarea saves -$filters = array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description'); -foreach ( $filters as $filter ) { - add_filter($filter, 'wp_filter_kses'); +foreach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) { + add_filter( $filter, 'wp_filter_kses' ); +} + +// Kses only for textarea saves displays +foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) { + add_filter( $filter, 'wp_kses_data' ); } -// Email -$filters = array('pre_comment_author_email', 'pre_user_email'); -foreach ( $filters as $filter ) { - add_filter($filter, 'trim'); - add_filter($filter, 'sanitize_email'); - add_filter($filter, 'wp_filter_kses'); +// Email saves +foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) { + add_filter( $filter, 'trim' ); + add_filter( $filter, 'sanitize_email' ); + add_filter( $filter, 'wp_filter_kses' ); +} + +// Email display +foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) { + add_filter( $filter, 'sanitize_email' ); + add_filter( $filter, 'wp_kses_data' ); } // Save URL -$filters = array('pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', - 'pre_link_rss'); -foreach ( $filters as $filter ) { - add_filter($filter, 'strip_tags'); - add_filter($filter, 'trim'); - add_filter($filter, 'esc_url_raw'); - add_filter($filter, 'wp_filter_kses'); +foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', + 'pre_link_rss' ) as $filter ) { + add_filter( $filter, 'wp_strip_all_tags' ); + add_filter( $filter, 'esc_url_raw' ); + add_filter( $filter, 'wp_filter_kses' ); } // Display URL -$filters = array('user_url', 'link_url', 'link_image', 'link_rss', 'comment_url'); -foreach ( $filters as $filter ) { - add_filter($filter, 'strip_tags'); - add_filter($filter, 'trim'); - add_filter($filter, 'esc_url'); - add_filter($filter, 'wp_filter_kses'); +foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url' ) as $filter ) { + add_filter( $filter, 'wp_strip_all_tags' ); + add_filter( $filter, 'esc_url' ); + add_filter( $filter, 'wp_kses_data' ); } // Slugs -$filters = array('pre_term_slug'); -foreach ( $filters as $filter ) { - add_filter($filter, 'sanitize_title'); +foreach ( array( 'pre_term_slug' ) as $filter ) { + add_filter( $filter, 'sanitize_title' ); } // Keys -$filters = array('pre_post_type'); -foreach ( $filters as $filter ) { - add_filter($filter, 'sanitize_user'); +foreach ( array( 'pre_post_type' ) as $filter ) { + add_filter( $filter, 'sanitize_user' ); } // Places to balance tags on input -$filters = array('content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content'); -foreach ( $filters as $filter ) { - add_filter( $filter, 'balanceTags', 50); +foreach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content' ) as $filter ) { + add_filter( $filter, 'balanceTags', 50 ); } // Format strings for display. -$filters = array('comment_author', 'term_name', 'link_name', 'link_description', - 'link_notes', 'bloginfo', 'wp_title', 'widget_title'); -foreach ( $filters as $filter ) { - add_filter($filter, 'wptexturize'); - add_filter($filter, 'convert_chars'); - add_filter($filter, 'esc_html'); +foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title' ) as $filter ) { + add_filter( $filter, 'wptexturize' ); + add_filter( $filter, 'convert_chars' ); + add_filter( $filter, 'esc_html' ); } // Format text area for display. -$filters = array('term_description'); -foreach ( $filters as $filter ) { - add_filter($filter, 'wptexturize'); - add_filter($filter, 'convert_chars'); - add_filter($filter, 'wpautop'); +foreach ( array( 'term_description' ) as $filter ) { + add_filter( $filter, 'wptexturize' ); + add_filter( $filter, 'convert_chars' ); + add_filter( $filter, 'wpautop' ); + add_filter( $filter, 'shortcode_unautop'); } // Format for RSS -$filters = array('term_name_rss'); -foreach ( $filters as $filter ) { - add_filter($filter, 'convert_chars'); +foreach ( array( 'term_name_rss' ) as $filter ) { + add_filter( $filter, 'convert_chars' ); } // Display filters -add_filter('the_title', 'wptexturize'); -add_filter('the_title', 'convert_chars'); -add_filter('the_title', 'trim'); - -add_filter('the_content', 'wptexturize'); -add_filter('the_content', 'convert_smilies'); -add_filter('the_content', 'convert_chars'); -add_filter('the_content', 'wpautop'); -add_filter('the_content', 'prepend_attachment'); - -add_filter('the_excerpt', 'wptexturize'); -add_filter('the_excerpt', 'convert_smilies'); -add_filter('the_excerpt', 'convert_chars'); -add_filter('the_excerpt', 'wpautop'); -add_filter('get_the_excerpt', 'wp_trim_excerpt'); - -add_filter('comment_text', 'wptexturize'); -add_filter('comment_text', 'convert_chars'); -add_filter('comment_text', 'make_clickable', 9); -add_filter('comment_text', 'force_balance_tags', 25); -add_filter('comment_text', 'convert_smilies', 20); -add_filter('comment_text', 'wpautop', 30); - -add_filter('comment_excerpt', 'convert_chars'); - -add_filter('list_cats', 'wptexturize'); -add_filter('single_post_title', 'wptexturize'); - -add_filter('wp_sprintf', 'wp_sprintf_l', 10, 2); +add_filter( 'the_title', 'wptexturize' ); +add_filter( 'the_title', 'convert_chars' ); +add_filter( 'the_title', 'trim' ); + +add_filter( 'the_content', 'wptexturize' ); +add_filter( 'the_content', 'convert_smilies' ); +add_filter( 'the_content', 'convert_chars' ); +add_filter( 'the_content', 'wpautop' ); +add_filter( 'the_content', 'shortcode_unautop' ); +add_filter( 'the_content', 'prepend_attachment' ); + +add_filter( 'the_excerpt', 'wptexturize' ); +add_filter( 'the_excerpt', 'convert_smilies' ); +add_filter( 'the_excerpt', 'convert_chars' ); +add_filter( 'the_excerpt', 'wpautop' ); +add_filter( 'the_excerpt', 'shortcode_unautop'); +add_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); + +add_filter( 'comment_text', 'wptexturize' ); +add_filter( 'comment_text', 'convert_chars' ); +add_filter( 'comment_text', 'make_clickable', 9 ); +add_filter( 'comment_text', 'force_balance_tags', 25 ); +add_filter( 'comment_text', 'convert_smilies', 20 ); +add_filter( 'comment_text', 'wpautop', 30 ); + +add_filter( 'comment_excerpt', 'convert_chars' ); + +add_filter( 'list_cats', 'wptexturize' ); +add_filter( 'single_post_title', 'wptexturize' ); + +add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 ); // RSS filters -add_filter('the_title_rss', 'strip_tags'); -add_filter('the_title_rss', 'ent2ncr', 8); -add_filter('the_title_rss', 'esc_html'); -add_filter('the_content_rss', 'ent2ncr', 8); -add_filter('the_excerpt_rss', 'convert_chars'); -add_filter('the_excerpt_rss', 'ent2ncr', 8); -add_filter('comment_author_rss', 'ent2ncr', 8); -add_filter('comment_text_rss', 'ent2ncr', 8); -add_filter('comment_text_rss', 'esc_html'); -add_filter('bloginfo_rss', 'ent2ncr', 8); -add_filter('the_author', 'ent2ncr', 8); +add_filter( 'the_title_rss', 'strip_tags' ); +add_filter( 'the_title_rss', 'ent2ncr', 8 ); +add_filter( 'the_title_rss', 'esc_html' ); +add_filter( 'the_content_rss', 'ent2ncr', 8 ); +add_filter( 'the_excerpt_rss', 'convert_chars' ); +add_filter( 'the_excerpt_rss', 'ent2ncr', 8 ); +add_filter( 'comment_author_rss', 'ent2ncr', 8 ); +add_filter( 'comment_text_rss', 'ent2ncr', 8 ); +add_filter( 'comment_text_rss', 'esc_html' ); +add_filter( 'bloginfo_rss', 'ent2ncr', 8 ); +add_filter( 'the_author', 'ent2ncr', 8 ); // Misc filters -add_filter('option_ping_sites', 'privacy_ping_filter'); -add_filter('option_blog_charset', '_wp_specialchars'); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop -add_filter('option_home', '_config_wp_home'); -add_filter('option_siteurl', '_config_wp_siteurl'); -add_filter('tiny_mce_before_init', '_mce_set_direction'); -add_filter('pre_kses', 'wp_pre_kses_less_than'); -add_filter('sanitize_title', 'sanitize_title_with_dashes'); -add_action('check_comment_flood', 'check_comment_flood_db', 10, 3); -add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3); -add_filter('pre_comment_content', 'wp_rel_nofollow', 15); -add_filter('comment_email', 'antispambot'); -add_filter('option_tag_base', '_wp_filter_taxonomy_base'); -add_filter('option_category_base', '_wp_filter_taxonomy_base'); -add_filter( 'the_posts', '_close_comments_for_old_posts' ); -add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 ); -add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); -add_filter( 'editable_slug', 'urldecode' ); +add_filter( 'option_ping_sites', 'privacy_ping_filter' ); +add_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop +add_filter( 'option_home', '_config_wp_home' ); +add_filter( 'option_siteurl', '_config_wp_siteurl' ); +add_filter( 'tiny_mce_before_init', '_mce_set_direction' ); +add_filter( 'pre_kses', 'wp_pre_kses_less_than' ); +add_filter( 'sanitize_title', 'sanitize_title_with_dashes' ); +add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 3 ); +add_filter( 'comment_flood_filter', 'wp_throttle_comment_flood', 10, 3 ); +add_filter( 'pre_comment_content', 'wp_rel_nofollow', 15 ); +add_filter( 'comment_email', 'antispambot' ); +add_filter( 'option_tag_base', '_wp_filter_taxonomy_base' ); +add_filter( 'option_category_base', '_wp_filter_taxonomy_base' ); +add_filter( 'the_posts', '_close_comments_for_old_posts' ); +add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 ); +add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); +add_filter( 'editable_slug', 'urldecode' ); // Atom SSL support -add_filter('atom_service_url','atom_service_url_filter'); +add_filter( 'atom_service_url','atom_service_url_filter' ); // Actions -add_action('wp_head', 'wp_enqueue_scripts', 1); -add_action('wp_head', 'feed_links_extra', 3); -add_action('wp_head', 'rsd_link'); -add_action('wp_head', 'wlwmanifest_link'); -add_action('wp_head', 'index_rel_link'); -add_action('wp_head', 'parent_post_rel_link', 10, 0); -add_action('wp_head', 'start_post_rel_link', 10, 0); -add_action('wp_head', 'adjacent_posts_rel_link', 10, 0); -add_action('wp_head', 'locale_stylesheet'); -add_action('publish_future_post', 'check_and_publish_future_post', 10, 1); -add_action('wp_head', 'noindex', 1); -add_action('wp_head', 'wp_print_styles', 8); -add_action('wp_head', 'wp_print_head_scripts', 9); -add_action('wp_head', 'wp_generator'); -add_action('wp_footer', 'wp_print_footer_scripts'); -if(!defined('DOING_CRON')) - add_action('sanitize_comment_cookies', 'wp_cron'); -add_action('do_feed_rdf', 'do_feed_rdf', 10, 1); -add_action('do_feed_rss', 'do_feed_rss', 10, 1); -add_action('do_feed_rss2', 'do_feed_rss2', 10, 1); -add_action('do_feed_atom', 'do_feed_atom', 10, 1); -add_action('do_pings', 'do_all_pings', 10, 1); -add_action('do_robots', 'do_robots'); -add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); -add_action('admin_print_scripts', 'print_head_scripts', 20); -add_action('admin_print_footer_scripts', 'print_footer_scripts', 20); -add_action('admin_print_styles', 'print_admin_styles', 20); -add_action('init', 'smilies_init', 5); -add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); -add_action( 'shutdown', 'wp_ob_end_flush_all', 1); -add_action( 'pre_post_update', 'wp_save_post_revision' ); -add_action('publish_post', '_publish_post_hook', 5, 1); -add_action('future_post', '_future_post_hook', 5, 2); -add_action('future_page', '_future_post_hook', 5, 2); -add_action('save_post', '_save_post_hook', 5, 2); -add_action('transition_post_status', '_transition_post_status', 5, 3); -add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); -// Redirect Old Slugs -add_action('template_redirect', 'wp_old_slug_redirect'); -add_action('edit_post', 'wp_check_for_changed_slugs'); -add_action('edit_form_advanced', 'wp_remember_old_slug'); -add_action('init', '_show_post_preview'); +add_action( 'wp_head', 'wp_enqueue_scripts', 1 ); +add_action( 'wp_head', 'feed_links_extra', 3 ); +add_action( 'wp_head', 'rsd_link' ); +add_action( 'wp_head', 'wlwmanifest_link' ); +add_action( 'wp_head', 'index_rel_link' ); +add_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); +add_action( 'wp_head', 'start_post_rel_link', 10, 0 ); +add_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); +add_action( 'wp_head', 'locale_stylesheet' ); +add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 ); +add_action( 'wp_head', 'noindex', 1 ); +add_action( 'wp_head', 'wp_print_styles', 8 ); +add_action( 'wp_head', 'wp_print_head_scripts', 9 ); +add_action( 'wp_head', 'wp_generator' ); +add_action( 'wp_head', 'rel_canonical' ); +add_action( 'wp_footer', 'wp_print_footer_scripts' ); + +// WP Cron +if ( !defined( 'DOING_CRON' ) ) + add_action( 'sanitize_comment_cookies', 'wp_cron' ); + +// 2 Actions 2 Furious +add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 ); +add_action( 'do_feed_rss', 'do_feed_rss', 10, 1 ); +add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 ); +add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 ); +add_action( 'do_pings', 'do_all_pings', 10, 1 ); +add_action( 'do_robots', 'do_robots' ); +add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' ); +add_action( 'admin_print_scripts', 'print_head_scripts', 20 ); +add_action( 'admin_print_footer_scripts', 'print_footer_scripts', 20 ); +add_action( 'admin_print_styles', 'print_admin_styles', 20 ); +add_action( 'init', 'smilies_init', 5 ); +add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); +add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 ); +add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); +add_action( 'pre_post_update', 'wp_save_post_revision' ); +add_action( 'publish_post', '_publish_post_hook', 5, 1 ); +add_action( 'future_post', '_future_post_hook', 5, 2 ); +add_action( 'future_page', '_future_post_hook', 5, 2 ); +add_action( 'save_post', '_save_post_hook', 5, 2 ); +add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); +add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); +add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); + +// Post Thumbnail CSS class filtering +add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' ); +add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' ); -add_filter('pre_option_gmt_offset','wp_timezone_override_offset'); +// Redirect Old Slugs +add_action( 'template_redirect', 'wp_old_slug_redirect' ); +add_action( 'edit_post', 'wp_check_for_changed_slugs' ); +add_action( 'edit_form_advanced', 'wp_remember_old_slug' ); +add_action( 'init', '_show_post_preview' ); -?> +// Timezone +add_filter( 'pre_option_gmt_offset','wp_timezone_override_offset' ); diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 54d1d401..6dcf8225 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -376,8 +376,8 @@ class WP_Widget_Text extends WP_Widget { function widget( $args, $instance ) { extract($args); - $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']); - $text = apply_filters( 'widget_text', $instance['text'] ); + $title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance ); + $text = apply_filters( 'widget_text', $instance['text'], $instance ); echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
      @@ -391,7 +391,7 @@ class WP_Widget_Text extends WP_Widget { if ( current_user_can('unfiltered_html') ) $instance['text'] = $new_instance['text']; else - $instance['text'] = wp_filter_post_kses( $new_instance['text'] ); + $instance['text'] = stripslashes( wp_filter_post_kses( addslashes($new_instance['text']) ) ); // wp_filter_post_kses() expects slashed $instance['filter'] = isset($new_instance['filter']); return $instance; } @@ -406,7 +406,7 @@ class WP_Widget_Text extends WP_Widget { -

      /> 

      +

      /> 

      '') ); $title = esc_attr( $instance['title'] ); - $count = (bool) $instance['count']; - $hierarchical = (bool) $instance['hierarchical']; - $dropdown = (bool) $instance['dropdown']; + $count = isset($instance['count']) ? (bool) $instance['count'] :false; + $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false; + $dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false; ?>

      @@ -579,8 +579,8 @@ class WP_Widget_Recent_Posts extends WP_Widget { } function form( $instance ) { - $title = esc_attr($instance['title']); - if ( !$number = (int) $instance['number'] ) + $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; + if ( !isset($instance['number']) || !$number = (int) $instance['number'] ) $number = 5; ?>

      @@ -609,7 +609,7 @@ class WP_Widget_Recent_Comments extends WP_Widget { add_action( 'wp_head', array(&$this, 'recent_comments_style') ); add_action( 'comment_post', array(&$this, 'flush_widget_cache') ); - add_action( 'wp_set_comment_status', array(&$this, 'flush_widget_cache') ); + add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') ); } function recent_comments_style() { ?> @@ -634,7 +634,7 @@ class WP_Widget_Recent_Comments extends WP_Widget { $number = 15; if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) { - $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 15"); + $comments = $wpdb->get_results("SELECT $wpdb->comments.* FROM $wpdb->comments JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 15"); wp_cache_add( 'recent_comments', $comments, 'widget' ); } @@ -732,6 +732,8 @@ class WP_Widget_RSS extends WP_Widget { echo $before_title . $title . $after_title; wp_widget_rss_output( $rss, $instance ); echo $after_widget; + $rss->__destruct(); + unset($rss); } function update($new_instance, $old_instance) { @@ -770,7 +772,6 @@ function wp_widget_rss_output( $rss, $args = array() ) { if ( is_wp_error($rss) ) { if ( is_admin() || current_user_can('manage_options') ) echo '

      ' . sprintf( __('RSS Error: %s'), $rss->get_error_message() ) . '

      '; - return; } @@ -787,6 +788,8 @@ function wp_widget_rss_output( $rss, $args = array() ) { if ( !$rss->get_item_quantity() ) { echo '
      • ' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '
      '; + $rss->__destruct(); + unset($rss); return; } @@ -838,6 +841,8 @@ function wp_widget_rss_output( $rss, $args = array() ) { } } echo ''; + $rss->__destruct(); + unset($rss); } @@ -946,6 +951,9 @@ function wp_widget_rss_process( $widget_rss, $check_feed = true ) { $link = esc_url(strip_tags($rss->get_permalink())); while ( stristr($link, 'http') != $link ) $link = substr($link, 1); + + $rss->__destruct(); + unset($rss); } } @@ -985,7 +993,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget { function form( $instance ) { ?>

      -

      +

      $cut ) { + $k = $cut; + $use_dotdotdot = 1; + } else { + $k = count($blah); + $use_dotdotdot = 0; + } + + /** @todo Check performance, might be faster to use array slice instead. */ + for ( $i=0; $i<$k; $i++ ) + $excerpt .= $blah[$i].' '; + $excerpt .= ($use_dotdotdot) ? '...' : ''; + $content = $excerpt; + } + $content = str_replace(']]>', ']]>', $content); + echo $content; +} + +/** + * Strip HTML and put links at the bottom of stripped content. + * + * Searches for all of the links, strips them out of the content, and places + * them at the bottom of the content with numbers. + * + * @since 0.71 + * @deprecated 2.9.0 + * + * @param string $content Content to get links + * @return string HTML stripped out of content with links at the bottom. + */ +function make_url_footnote( $content ) { + _deprecated_function(__FUNCTION__, '2.9', '' ); + preg_match_all( '/(.+?)<\/a>/', $content, $matches ); + $links_summary = "\n"; + for ( $i=0; $i \ No newline at end of file diff --git a/wp-includes/feed-atom.php b/wp-includes/feed-atom.php index 17b7833b..da3eeb46 100644 --- a/wp-includes/feed-atom.php +++ b/wp-includes/feed-atom.php @@ -43,7 +43,7 @@ echo ''; ?> ]]> - ]]> + ]]> diff --git a/wp-includes/feed-rdf.php b/wp-includes/feed-rdf.php index eee132ed..946f370a 100644 --- a/wp-includes/feed-rdf.php +++ b/wp-includes/feed-rdf.php @@ -46,8 +46,8 @@ echo ''; ?> - - ]]> + + ]]> diff --git a/wp-includes/feed-rss.php b/wp-includes/feed-rss.php index e5c2fe83..90eeab05 100644 --- a/wp-includes/feed-rss.php +++ b/wp-includes/feed-rss.php @@ -23,11 +23,7 @@ echo ''; ?> <?php the_title_rss() ?> - ]]> - - - diff --git a/wp-includes/feed-rss2.php b/wp-includes/feed-rss2.php index c4299cbe..12286da2 100644 --- a/wp-includes/feed-rss2.php +++ b/wp-includes/feed-rss2.php @@ -46,12 +46,12 @@ echo ''; ?> ]]> post_content ) > 0 ) : ?> - ]]> + ]]> ]]> - + diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 02263564..ebd392b1 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -130,66 +130,38 @@ function the_title_rss() { } /** - * Display the post content for the feed. - * - * For encoding the html or the $encode_html parameter, there are three possible - * values. '0' will make urls footnotes and use make_url_footnote(). '1' will - * encode special characters and automatically display all of the content. The - * value of '2' will strip all HTML tags from the content. - * - * Also note that you cannot set the amount of words and not set the html - * encoding. If that is the case, then the html encoding will default to 2, - * which will strip all HTML tags. - * - * To restrict the amount of words of the content, you can use the cut - * parameter. If the content is less than the amount, then there won't be any - * dots added to the end. If there is content left over, then dots will be added - * and the rest of the content will be removed. + * Retrieve the post content for feeds. * * @package WordPress * @subpackage Feed - * @since 0.71 - * @uses apply_filters() Calls 'the_content_rss' on the content before processing. - * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file - * parameters. - * - * @param string $more_link_text Optional. Text to display when more content is available but not displayed. - * @param int|bool $stripteaser Optional. Default is 0. - * @param string $more_file Optional. - * @param int $cut Optional. Amount of words to keep for the content. - * @param int $encode_html Optional. How to encode the content. + * @since 2.9.0 + * @uses apply_filters() Calls 'the_content_feed' on the content before processing. + * @see get_the_content() + * + * @param string $feed_type The type of feed. rss2 | atom | rss | rdf */ -function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { - $content = get_the_content($more_link_text, $stripteaser, $more_file); - $content = apply_filters('the_content_rss', $content); - if ( $cut && !$encode_html ) - $encode_html = 2; - if ( 1== $encode_html ) { - $content = esc_html($content); - $cut = 0; - } elseif ( 0 == $encode_html ) { - $content = make_url_footnote($content); - } elseif ( 2 == $encode_html ) { - $content = strip_tags($content); - } - if ( $cut ) { - $blah = explode(' ', $content); - if ( count($blah) > $cut ) { - $k = $cut; - $use_dotdotdot = 1; - } else { - $k = count($blah); - $use_dotdotdot = 0; - } +function get_the_content_feed($feed_type = null) { + if ( !$feed_type ) + $feed_type = get_default_feed(); - /** @todo Check performance, might be faster to use array slice instead. */ - for ( $i=0; $i<$k; $i++ ) - $excerpt .= $blah[$i].' '; - $excerpt .= ($use_dotdotdot) ? '...' : ''; - $content = $excerpt; - } + $content = apply_filters('the_content', get_the_content()); $content = str_replace(']]>', ']]>', $content); - echo $content; + return apply_filters('the_content_feed', $content, $feed_type); +} + +/** + * Display the post content for feeds. + * + * @package WordPress + * @subpackage Feed + * @since 2.9.0 + * @uses apply_filters() Calls 'the_content_feed' on the content before processing. + * @see get_the_content() + * + * @param string $feed_type The type of feed. rss2 | atom | rss | rdf + */ +function the_content_feed($feed_type = null) { + echo get_the_content_feed(); } /** @@ -311,10 +283,12 @@ function comment_text_rss() { * @since 2.1.0 * @uses apply_filters() * - * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. + * @param string $type Optional, default is the type returned by get_default_feed(). * @return string All of the post categories for displaying in the feed. */ -function get_the_category_rss($type = 'rss') { +function get_the_category_rss($type = null) { + if ( empty($type) ) + $type = get_default_feed(); $categories = get_the_category(); $tags = get_the_tags(); $the_list = ''; @@ -354,9 +328,9 @@ function get_the_category_rss($type = 'rss') { * @since 0.71 * @see get_the_category_rss() For better explanation. * - * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. + * @param string $type Optional, default is the type returned by get_default_feed(). */ -function the_category_rss($type = 'rss') { +function the_category_rss($type = null) { echo get_the_category_rss($type); } diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 37b75229..21f82d6d 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1,6 +1,6 @@ |\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); $stop = count($textarr); - /* translators: opening curly quote */ - $opening_quote = _x('“', 'opening curly quote'); - /* translators: closing curly quote */ - $closing_quote = _x('”', 'closing curly quote'); - - $no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt')); - $no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code')); - $no_texturize_tags_stack = array(); - $no_texturize_shortcodes_stack = array(); + // No need to setup these variables more than once + if (!$static_setup) { + /* translators: opening curly quote */ + $opening_quote = _x('“', 'opening curly quote'); + /* translators: closing curly quote */ + $closing_quote = _x('”', 'closing curly quote'); + + $default_no_texturize_tags = array('pre', 'code', 'kbd', 'style', 'script', 'tt'); + $default_no_texturize_shortcodes = array('code'); + + // if a plugin has provided an autocorrect array, use it + if ( isset($wp_cockneyreplace) ) { + $cockney = array_keys($wp_cockneyreplace); + $cockneyreplace = array_values($wp_cockneyreplace); + } else { + $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); + $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); + } - // if a plugin has provided an autocorrect array, use it - if ( isset($wp_cockneyreplace) ) { - $cockney = array_keys($wp_cockneyreplace); - $cockneyreplace = array_values($wp_cockneyreplace); - } else { - $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); - $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); + $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); + $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace); + + $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); + $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2'); + + $static_setup = true; } - $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); - $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace); + // Transform into regexp sub-expression used in _wptexturize_pushpop_element + // Must do this everytime in case plugins use these filters in a context sensitive manner + $no_texturize_tags = '(' . implode('|', apply_filters('no_texturize_tags', $default_no_texturize_tags) ) . ')'; + $no_texturize_shortcodes = '(' . implode('|', apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')'; - $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); - $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2'); + $no_texturize_tags_stack = array(); + $no_texturize_shortcodes_stack = array(); for ( $i = 0; $i < $stop; $i++ ) { $curl = $textarr[$i]; if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} - && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { // If it's not a tag + && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { + // This is not a tag, nor is the texturization disabled // static strings $curl = str_replace($static_characters, $static_replacements, $curl); // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); - } else { - wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); - wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); + } elseif (!empty($curl)) { + /* + * Only call _wptexturize_pushpop_element if first char is correct + * tag opening + */ + if ('<' == $curl{0}) + _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); + elseif ('[' == $curl{0}) + _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); } $curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl); @@ -79,17 +98,44 @@ function wptexturize($text) { return $output; } -function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') { - $o = preg_quote($opening, '/'); - $c = preg_quote($closing, '/'); - foreach($disabled_elements as $element) { - if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element); - if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) { +/** + * Search for disabled element tags. Push element to stack on tag open and pop + * on tag close. Assumes first character of $text is tag opening. + * + * @access private + * @since 2.9.0 + * + * @param string $text Text to check. First character is assumed to be $opening + * @param array $stack Array used as stack of opened tag elements + * @param string $disabled_elements Tags to match against formatted as regexp sub-expression + * @param string $opening Tag opening character, assumed to be 1 character long + * @param string $opening Tag closing character + * @return object + */ +function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') { + // Check if it is a closing tag -- otherwise assume opening tag + if (strncmp($opening . '/', $text, 2)) { + // Opening? Check $text+1 against disabled elements + if (preg_match('/^' . $disabled_elements . '\b/', substr($text, 1), $matches)) { + /* + * This disables texturize until we find a closing tag of our type + * (e.g.
      ) even if there was invalid nesting before that
      +			 * 
      +			 * Example: in the case 
      sadsadasd"baba"
      + * "baba" won't be texturize + */ + + array_push($stack, $matches[1]); + } + } else { + // Closing? Check $text+2 against disabled elements + $c = preg_quote($closing, '/'); + if (preg_match('/^' . $disabled_elements . $c . '/', substr($text, 2), $matches)) { $last = array_pop($stack); - // disable texturize until we find a closing tag of our type (e.g.
      )
      -			// even if there was invalid nesting before that
      -			// Example: in the case 
      sadsadasd"baba"
      "baba" won't be texturized - if ($last != $element) array_push($stack, $last); + + // Make sure it matches the opening tag + if ($last != $matches[1]) + array_push($stack, $last); } } } @@ -133,12 +179,13 @@ function clean_pre($matches) { * @return string Text which has been converted into correct paragraph tags. */ function wpautop($pee, $br = 1) { + if ( trim($pee) === '' ) return ''; $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|
      \s*
      |', "\n\n", $pee); // Space things out a little - $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)'; + $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend)'; $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!()!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines @@ -170,7 +217,28 @@ function wpautop($pee, $br = 1) { if (strpos($pee, ']*>)(.*?)
      !is', 'clean_pre', $pee ); $pee = preg_replace( "|\n

      $|", '

      ', $pee ); - $pee = preg_replace('/

      \s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone + + return $pee; +} + +/** + * Don't auto-p wrap shortcodes that stand alone + * + * Ensures that shortcodes are not wrapped in <

      >...<

      >. + * + * @since 2.9.0 + * + * @param string $pee The content. + * @return string The filtered content. + */ +function shortcode_unautop($pee) { + global $shortcode_tags; + + if ( !empty($shortcode_tags) && is_array($shortcode_tags) ) { + $tagnames = array_keys($shortcode_tags); + $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); + $pee = preg_replace('/

      \\s*?(\\[(' . $tagregexp . ')\\b.*?\\/?\\](?:.+?\\[\\/\\2\\])?)\\s*<\\/p>/s', '$1', $pee); + } return $pee; } @@ -605,6 +673,39 @@ function sanitize_file_name( $filename ) { $filename = str_replace($special_chars, '', $filename); $filename = preg_replace('/[\s-]+/', '-', $filename); $filename = trim($filename, '.-_'); + + // Split the filename into a base and extension[s] + $parts = explode('.', $filename); + + // Return if only one extension + if ( count($parts) <= 2 ) + return apply_filters('sanitize_file_name', $filename, $filename_raw); + + // Process multiple extensions + $filename = array_shift($parts); + $extension = array_pop($parts); + $mimes = get_allowed_mime_types(); + + // Loop over any intermediate extensions. Munge them with a trailing underscore if they are a 2 - 5 character + // long alpha string not in the extension whitelist. + foreach ( (array) $parts as $part) { + $filename .= '.' . $part; + + if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) { + $allowed = false; + foreach ( $mimes as $ext_preg => $mime_match ) { + $ext_preg = '!(^' . $ext_preg . ')$!i'; + if ( preg_match( $ext_preg, $part ) ) { + $allowed = true; + break; + } + } + if ( !$allowed ) + $filename .= '_'; + } + } + $filename .= '.' . $extension; + return apply_filters('sanitize_file_name', $filename, $filename_raw); } @@ -628,7 +729,7 @@ function sanitize_file_name( $filename ) { */ function sanitize_user( $username, $strict = false ) { $raw_username = $username; - $username = strip_tags($username); + $username = wp_strip_all_tags($username); // Kill octets $username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username); $username = preg_replace('/&.+?;/', '', $username); // Kill entities @@ -1110,7 +1211,7 @@ function addslashes_gpc($gpc) { $gpc = stripslashes($gpc); } - return $wpdb->escape($gpc); + return esc_sql($gpc); } /** @@ -1185,9 +1286,11 @@ function antispambot($emailaddy, $mailto=0) { */ function _make_url_clickable_cb($matches) { $url = $matches[2]; + $url = esc_url($url); if ( empty($url) ) return $matches[0]; + return $matches[1] . "$url"; } @@ -1210,12 +1313,13 @@ function _make_web_ftp_clickable_cb($matches) { $dest = esc_url($dest); if ( empty($dest) ) return $matches[0]; - // removed trailing [,;:] from URL - if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) { + + // removed trailing [.,;:)] from URL + if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) { $ret = substr($dest, -1); $dest = substr($dest, 0, strlen($dest)-1); } - return $matches[1] . "$dest" . $ret; + return $matches[1] . "$dest$ret"; } /** @@ -1249,7 +1353,7 @@ function _make_email_clickable_cb($matches) { function make_clickable($ret) { $ret = ' ' . $ret; // in testing, using arrays here was found to be faster - $ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/\-=?@\[\](+]|[.,;:](?![\s<])|(?(1)\)(?![\s<])|\)))+)#is', '_make_url_clickable_cb', $ret); + $ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/=?@\[\](+-]|[.,;:](?![\s<]|(\))?([\s]|$))|(?(1)\)(?![\s<.,;:]|$)|\)))+)#is', '_make_url_clickable_cb', $ret); $ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret); $ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret); // this one is not in an array because we need it to run last, for cleanup of accidental links within links @@ -1271,7 +1375,7 @@ function wp_rel_nofollow( $text ) { // This is a pre save filter, so text is already escaped. $text = stripslashes($text); $text = preg_replace_callback('||i', 'wp_rel_nofollow_callback', $text); - $text = $wpdb->escape($text); + $text = esc_sql($text); return $text; } @@ -1318,7 +1422,9 @@ function translate_smiley($smiley) { $img = $wpsmiliestrans[$smiley]; $smiley_masked = esc_attr($smiley); - return " $smiley_masked "; + $srcurl = apply_filters('smilies_src', "$siteurl/wp-includes/images/smilies/$img", $img, $siteurl); + + return " $smiley_masked "; } @@ -1682,12 +1788,15 @@ function human_time_diff( $from, $to = '' ) { * Generates an excerpt from the content, if needed. * * The excerpt word amount will be 55 words and if the amount is greater than - * that, then the string '[...]' will be appended to the excerpt. If the string + * that, then the string ' [...]' will be appended to the excerpt. If the string * is less than 55 words, then the content will be returned as is. * + * The 55 word limit can be modified by plugins/themes using the excerpt_length filter + * The ' [...]' string can be modified by plugins/themes using the excerpt_more filter + * * @since 1.5.0 * - * @param string $text The exerpt. If set to empty an excerpt is generated. + * @param string $text The excerpt. If set to empty an excerpt is generated. * @return string The excerpt. */ function wp_trim_excerpt($text) { @@ -1701,11 +1810,12 @@ function wp_trim_excerpt($text) { $text = str_replace(']]>', ']]>', $text); $text = strip_tags($text); $excerpt_length = apply_filters('excerpt_length', 55); + $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); $words = explode(' ', $text, $excerpt_length + 1); if (count($words) > $excerpt_length) { array_pop($words); - array_push($words, '[...]'); $text = implode(' ', $words); + $text = $text . $excerpt_more; } } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); @@ -2072,14 +2182,14 @@ function clean_url( $url, $protocols = null, $context = 'display' ) { /** * Perform a deep string replace operation to ensure the values in $search are no longer present - * + * * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that * str_replace would return - * + * * @since 2.8.1 * @access private - * + * * @param string|array $search * @param string $subject * @return string The processed string @@ -2095,7 +2205,7 @@ function _deep_replace($search, $subject){ } } } - + return $subject; } @@ -2184,8 +2294,10 @@ function htmlentities2($myHTML) { } /** - * Escape single quotes, specialchar double quotes, and fix line endings. + * Escape single quotes, htmlspecialchar " < > &, and fix line endings. * + * Escapes text strings for echoing in JS, both inline (for example in onclick="...") + * and inside + - - - - - - + + + + + + +

      diff --git a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js index e0e51b5b..7b2bbd9b 100644 --- a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js @@ -1 +1 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var k=c.dom,j={content:i};e.onPreProcess.dispatch(e,j);j.node=k.create("div",0,j.content);e.onPostProcess.dispatch(e,j);j.content=c.serializer.serialize(j.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(j.content)){e._insertBlockContent(c,k,j.content)}else{e._insert(j.content)}}c.addCommand("mceInsertClipboardContent",function(i,h){g(h)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"}," ");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);g(p.innerHTML);return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var r=o.get("_mcePaste"),q;r.id="_mceRemoved";o.remove(r);r=o.get("_mcePaste")||r;q=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML;o.remove(r);if(k){j.setRng(k)}g(q)},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,g){var b=this.editor,c=g.content,f,e;function f(h){a(h,function(i){if(i.constructor==RegExp){c=c.replace(i,"")}else{c=c.replace(i[0],i[1])}})}f([/^\s*( )+/g,/( |]*>)+\s*$/g]);if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)){g.wordContent=true;if(b.getParam("paste_convert_middot_lists",true)){f([[//gi,"$&__MCE_ITEM__"],[/(]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}f([//gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){f([/<\/?(span)[^>]*>/gi])}}e=b.getParam("paste_strip_class_attributes","all");if(e!="none"){if(e=="all"){f([/ class=\"([^\"]*)\"/gi,/ class=(\w+)/gi])}else{f([/ class=\"(mso[^\"]*)\"/gi,/ class=(mso\w+)/gi])}}if(b.getParam("paste_remove_spans")){f([/<\/?(span)[^>]*>/gi])}g.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert(' ',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol");if(c){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(kb.y+b.h){h.getDoc().body.scrollTop=k span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML});a(n,function(r){o.remove(r)});if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,i){var b=this.editor,c=i.content,g,f;function g(h){a(h,function(j){if(j.constructor==RegExp){c=c.replace(j,"")}else{c=c.replace(j[0],j[1])}})}if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||i.wordContent){i.wordContent=true;g([/^\s*( )+/g,/( |]*>)+\s*$/g]);if(b.getParam("paste_convert_middot_lists",true)){g([[//gi,"$&__MCE_ITEM__"],[/(]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}g([//gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){g([/<\/?(span)[^>]*>/gi])}}f=b.getParam("paste_strip_class_attributes");if(f!="none"){function e(l,h){var k,j="";if(f=="all"){return""}h=tinymce.explode(h," ");for(k=h.length-1;k>=0;k--){if(!/^(Mso)/i.test(h[k])){j+=(!j?"":" ")+h[k]}}return' class="'+j+'"'}g([[/ class=\"([^\"]*)\"/gi,e],[/ class=(\w+)/gi,e]])}if(b.getParam("paste_remove_spans")){g([/<\/?(span)[^>]*>/gi])}i.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert(' ',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(c&&!/TD|TH/.test(c.nodeName)){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(kb.y+b.h){h.getDoc().body.scrollTop=k'; + cssHTML += ''; }); // Write content into iframe @@ -32,7 +32,7 @@ var PasteWordDialog = { insert : function() { var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, h); + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); tinyMCEPopup.close(); }, diff --git a/wp-includes/js/tinymce/plugins/paste/pastetext.htm b/wp-includes/js/tinymce/plugins/paste/pastetext.htm index bedde9ad..0bb2ecb6 100644 --- a/wp-includes/js/tinymce/plugins/paste/pastetext.htm +++ b/wp-includes/js/tinymce/plugins/paste/pastetext.htm @@ -2,8 +2,8 @@ {#paste.paste_text_desc} - - + + @@ -30,4 +30,4 @@
      - + \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/paste/pasteword.htm b/wp-includes/js/tinymce/plugins/paste/pasteword.htm index de6b5e4f..68dab3ec 100644 --- a/wp-includes/js/tinymce/plugins/paste/pasteword.htm +++ b/wp-includes/js/tinymce/plugins/paste/pasteword.htm @@ -2,8 +2,8 @@ {#paste.paste_word_desc} - - + +
      diff --git a/wp-includes/js/tinymce/plugins/wordpress/css/content.css b/wp-includes/js/tinymce/plugins/wordpress/css/content.css index a542e6e0..f8384955 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/css/content.css +++ b/wp-includes/js/tinymce/plugins/wordpress/css/content.css @@ -12,4 +12,18 @@ } .mceWPnextpage { background: #ffffff url(../img/page_bug.gif) no-repeat right top; -} \ No newline at end of file +} + +img.wpGallery { + border: 1px dashed #888; + background: #f2f8ff url("../../wpgallery/img/gallery.png") no-repeat scroll center center; + width: 99%; + height: 250px; +} + +img.wp-oembed { + border: 1px dashed #888; + background: #f7f5f2 url("../img/embedded.png") no-repeat scroll center center; + width: 300px; + height: 250px; +} diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js index 0962cffb..0cc2bab9 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js @@ -6,6 +6,8 @@ var DOM = tinymce.DOM; tinymce.create('tinymce.plugins.WordPress', { + mceTout : 0, + init : function(ed, url) { var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML; moreHTML = ''; @@ -16,8 +18,9 @@ // Hides the specified toolbar and resizes the iframe ed.onPostRender.add(function() { - if ( ed.getParam('wordpress_adv_hidden', 1) ) { - DOM.hide(ed.controlManager.get(tbId).id); + var adv_toolbar = ed.controlManager.get(tbId); + if ( ed.getParam('wordpress_adv_hidden', 1) && adv_toolbar ) { + DOM.hide(adv_toolbar.id); t._resizeIframe(ed, tbId, 28); } }); @@ -41,9 +44,12 @@ }); ed.addCommand('WP_Adv', function() { - var id = ed.controlManager.get(tbId).id, cm = ed.controlManager; + var cm = ed.controlManager, id = cm.get(tbId).id; + + if ( 'undefined' == id ) + return; - if (DOM.isHidden(id)) { + if ( DOM.isHidden(id) ) { cm.setActive('wp_adv', 1); DOM.show(id); t._resizeIframe(ed, tbId, -28); @@ -122,8 +128,9 @@ // Add Media buttons to fullscreen ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + var DOM = tinymce.DOM; if ( 'mceFullScreen' != cmd ) return; - if ( 'mce_fullscreen' != ed.id ) + if ( 'mce_fullscreen' != ed.id && DOM.get('add_audio') && DOM.get('add_video') && DOM.get('add_image') && DOM.get('add_media') ) ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media'; }); @@ -161,6 +168,26 @@ }); }; + ed.onSaveContent.add(function(ed, o) { + if ( typeof(switchEditors) == 'object' ) { + if ( ed.isHidden() ) + o.content = o.element.value; + else + o.content = switchEditors.pre_wpautop(o.content); + } + }); + + /* disable for now + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t._setEmbed(o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if ( o.get ) + o.content = t._getEmbed(o.content); + }); + */ + // Add listeners to handle more break t._handleMoreBreak(ed, url); @@ -188,6 +215,28 @@ ed.addShortcut('alt+shift+b', ed.getLang('bold_desc'), 'Bold'); ed.addShortcut('alt+shift+i', ed.getLang('italic_desc'), 'Italic'); } + + ed.onInit.add(function(ed) { + tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { + ed.plugins.wordpress._hideButtons(); + }); + tinymce.dom.Event.add(ed.getBody(), 'dragstart', function(e) { + ed.plugins.wordpress._hideButtons(); + }); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + ed.plugins.wordpress._hideButtons(); + }); + + ed.onSaveContent.add(function(ed, o) { + ed.plugins.wordpress._hideButtons(); + }); + + ed.onMouseDown.add(function(ed, e) { + if ( e.target.nodeName != 'IMG' ) + ed.plugins.wordpress._hideButtons(); + }); }, getInfo : function() { @@ -201,6 +250,59 @@ }, // Internal functions + _setEmbed : function(c) { + return c.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g, function(a,b){ + return ''+b+''; + }); + }, + + _getEmbed : function(c) { + return c.replace(/]+>/g, function(a) { + if ( a.indexOf('class="wp-oembed') != -1 ) { + var u = a.match(/alt="([^\"]+)"/); + if ( u[1] ) + a = '[embed]' + u[1] + '[/embed]'; + } + return a; + }); + }, + + _showButtons : function(n, id) { + var ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; + + vp = ed.dom.getViewPort(ed.getWin()); + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = ed.dom.getPos(n); + + X = Math.max(p2.x - vp.x, 0) + p1.x; + Y = Math.max(p2.y - vp.y, 0) + p1.y; + + DOM.setStyles(id, { + 'top' : Y+5+'px', + 'left' : X+5+'px', + 'display' : 'block' + }); + + if ( this.mceTout ) + clearTimeout(this.mceTout); + + this.mceTout = setTimeout( function(){ed.plugins.wordpress._hideButtons();}, 5000 ); + }, + + _hideButtons : function() { + if ( !this.mceTout ) + return; + + if ( document.getElementById('wp_editbtns') ) + tinymce.DOM.hide('wp_editbtns'); + + if ( document.getElementById('wp_gallerybtns') ) + tinymce.DOM.hide('wp_gallerybtns'); + + clearTimeout(this.mceTout); + this.mceTout = 0; + }, + do_align : function(n, a) { var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor; @@ -239,7 +341,7 @@ _handleMoreBreak : function(ed, url) { var moreHTML, nextpageHTML; - + moreHTML = '$1'; nextpageHTML = ''; diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index 28f6c62c..ec97912d 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -1 +1 @@ -(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='';b='';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){if(c.getParam("wordpress_adv_hidden",1)){a.hide(c.controlManager.get(h).id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var j=c.controlManager.get(h).id,i=c.controlManager;if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/img/media.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_media").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/img/image.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_image").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/img/video.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_video").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/img/audio.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_audio").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.onBeforeExecCommand.add(function(i,k,j,l){if("mceFullScreen"!=k){return}if("mce_fullscreen"!=i.id){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='$1';b='';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(//g,e);g.content=g.content.replace(//g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i=""}if(i.indexOf('class="mceWPnextpage')!==-1){i=""}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})(); \ No newline at end of file +(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{mceTout:0,init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='';b='';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){var i=c.controlManager.get(h);if(c.getParam("wordpress_adv_hidden",1)&&i){a.hide(i.id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var i=c.controlManager,j=i.get(h).id;if("undefined"==j){return}if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/img/media.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_media").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/img/image.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_image").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/img/video.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_video").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/img/audio.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_audio").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.onBeforeExecCommand.add(function(i,l,k,m){var j=tinymce.DOM;if("mceFullScreen"!=l){return}if("mce_fullscreen"!=i.id&&j.get("add_audio")&&j.get("add_video")&&j.get("add_image")&&j.get("add_media")){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}c.onSaveContent.add(function(i,j){if(typeof(switchEditors)=="object"){if(i.isHidden()){j.content=j.element.value}else{j.content=switchEditors.pre_wpautop(j.content)}}});e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}c.onInit.add(function(i){tinymce.dom.Event.add(i.getWin(),"scroll",function(j){i.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(i.getBody(),"dragstart",function(j){i.plugins.wordpress._hideButtons()})});c.onBeforeExecCommand.add(function(i,k,j,l){i.plugins.wordpress._hideButtons()});c.onSaveContent.add(function(i,j){i.plugins.wordpress._hideButtons()});c.onMouseDown.add(function(i,j){if(j.target.nodeName!="IMG"){i.plugins.wordpress._hideButtons()}})},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return''+c+''})},_getEmbed:function(b){return b.replace(/]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"});if(this.mceTout){clearTimeout(this.mceTout)}this.mceTout=setTimeout(function(){g.plugins.wordpress._hideButtons()},5000)},_hideButtons:function(){if(!this.mceTout){return}if(document.getElementById("wp_editbtns")){tinymce.DOM.hide("wp_editbtns")}if(document.getElementById("wp_gallerybtns")){tinymce.DOM.hide("wp_gallerybtns")}clearTimeout(this.mceTout);this.mceTout=0},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='$1';b='';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(//g,e);g.content=g.content.replace(//g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i=""}if(i.indexOf('class="mceWPnextpage')!==-1){i=""}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/embedded.png b/wp-includes/js/tinymce/plugins/wordpress/img/embedded.png new file mode 100644 index 0000000000000000000000000000000000000000..173401ba5f118eab4be853d9fffc15c5bf88e677 GIT binary patch literal 28741 zcmV)XK&`)tP)mQCv^Y-AOJ~3K~#90q`Y~UBv*Cj{k!+Zl6zKVRdw}Jy>IGn zwbqu9goKdT#3B|0gE3&Rjc3M#ZSXJy_TcTYjXgH@jAzDX@Yo(cW6WX}iCrK-JK9&I z-uJD#y4Kt?Zp6K3{)p_B0C}u$9M6+aMrB51MBMkDbKdiwb4!T`|F7FkFW$w{!XjZ5 z5g0=<7*Hyg7z_pkVMw`DrrBB~Fd=avrr+riMj=KA^lgtqA;zE?qzQ2xp)uGbA&NqD z5HRTXiQ|Y;u}r(QgeXI$TqYR|aLy4$Awe9|>vjo@rdTQy#{p5G5m6w5R|<`QC{Tik zfYK;DD2>*jB!3qHg&;~H-hpUP9<2>ZX@bBY5CV}_Dg;J><-jU0vJ6E8Y6JoC4u!6w zq%I;T!3%f+BO<4jM#KxE@OaLMQVQ?)3d{?fREESk?~_)~rQ)-6FhG>xMIk;T%~HPo z@c#ebm<9jOXaguv3KXDFXsuCNp_E2zoqw-2TC4os=;6B}&>E#QN`pxi3Jt?^&kGQRPH&>Kh^N~=bUhU*MoOL6l#jq7=i$od7N|jBq4Dg?+F|b z2%#7$;N?06*LkH8??LIT92b*seeDZ(E8#vb{wuv+e?KO$KFfI5FaFcO|BC=W_lVDK z!w2^aCxOp_#O3uVgrMqChK@lHpK#{P6b$g;wOQ8_8#%=x4|K z1#H7ZZv@`$Mc#y>ihJ(lg&&Q0c}Vd2BM6Wo2uiFMrZqe)a1%m9&Yi5z|Hi`#{?3c6 zj0?d)aFe?aoP1w5v5b~ulrAtfW*9AxV9989`q<2)+;E&dpxw|D5M)9inpcbG)oA&H zs90FK<+GpsyMCwtQSYv3-T|~I#OGG0^*J}I(0VwS!-GYG z(mo$#r7;RbDV{w89Os=cdgxY^61)c;`r#E7T6shaB0uU{pJR0S<^^T+DDZLb<)?if zD1Ou(|EO<12fqhCs9?Vr9#KX$mC{}taXM38Y3SSRHiTE5_Xy|jLEl=8g1?Lk25mGC zJa{Dd;gJ)+q!6u)LE}*#q9A1J#^vn1U<0kROX|E==${8RO6GQez9JL1%%BY!W;oSR zFrtL_M^WM5eeRQg^Xv0Vo&WOhKm4D50x|V3B5l{~qS;&`3L})(_%tCZ7O+W57)OLb zM7P%=3`2q-zzzoau_%(v62&1}Ak9+3Fa`xKv4n*vCvyW!u@Di&5uHv4V?qjr5Nk8M z%g&R#v^PKnhGMBimZcQq5QWD1JR~TcPdloN?GtneelEJ@MD1Dg zQFvTVru@0z7*eYtIEcb20S#X3^Bx;K{#=Mq&-wtbgyCs;=ZT|$OD^0*pbeSxL!y>n zUmGD%AxEcY8_(=HN*o8N7iP6Kw-}?orj@$Kd)e%fCp7$692TvVGINXl{9=;dhxanP z9Ys;88L#}B+>kUNco7D1wr|7cm5jz^luX~|f7?oI;*bFJhm;QtP|wbrj(x#};b)~>zk zXI}s6N86pwBdvvnBWapG5Cp-YyPw?M{!zpQCyr3%(4rMyK~BxPU1CqyRhGZ^h-1#&@hRi@I#O1MGp9>M*}e(1$w$&FhExkB z!i8H_r!I3WHoJdYE{6X;_0mtR#bp^wOYNEpBAg5nSLZ^6QX<}g(n_I}))BDX1ZszO z;(>>(%ho$P7r8dv<*&8zRb_o1hSk-Cb#XP7ObLq*qF{_Pts z=j7QInOLmSuC>@lyrmdeiHE*zL3*UR+o>l4a=waU35?le8B{ z;+30viZ3g`NW_8nM|%) zjiAV!J1ZiawT6D*F>qZb%7y2R)jvVn2Fbu5J#q+8y&y1w3BssWuSFvxqvO?T?S_fT z$s4xsEa9D`y>6%9>9qH^noIXCEiFvjR_h0v@Toz+Kd9Af){95PlX-{tj&#tcTCL~2 zTxqlc?{Z7m4Bhz9Q_Ik*pPdv#u*72+dJKGi9C-*40nr+h(|1mvS)kFVF;Xj$rS3f1 zNjGEyP}pAq1(nI-F2DMp4kE>MtwPL}Z0(bFh_U%vTzN@H7? zYj?>?Mx|-?g!YP9Gy|3Sv595gDL=a~bNX{Bd?7HwDu7mNz|vBa*T4G3R0`Si<|{t| zxKdh$VFXJ3hEnSLh=0Z6{KD#m+1ZzRk&R&(R*W&aQmuufqhn#CF|w=C*tBb;F^cyY zypB=?#qTuKH5TdOy`vk4yXiQux7EK8}?>ccEXqebDh zpuIt<0P#ba;3mieB=o^nqgv2Hc zvV=_aunU@j?c*~=D{E3xXPNGHkZ$+9oKOry{@3sP5^w*tpCfG@#Cr&{0^W8=#gSzW zkLV1iovoSK=T7{FWJ_$t<}p5i;-xaIlqex9^Ua%mBf^anrO`!w)0 zz)LRK9s)%~b^`=pe`R%xn|X5q56hNWD@f%d#Pr{J+RF&gHRQ0ZL>0eR`b% zbIlG(Vo7yIB@EET0tF0FDI(Gu6Byh8Qk@b7nsT{J94d-ojpE9X*i29=SHOf!t_+wv zxs|cT2-~(y@aosTjQaQ(gR|2-{Po+p=*8P|#-RpuY=V|y@}-0#1(Xqzp5x5SX}Z0P z%Xe<$U%l}q47wQy5AUPfPSO_y_&HJ|O6li*e)ki*Qy>NI8@{;y(hGk}A-^YDp}f%R z_Bgb3goAtcg4P(L3B!oS_*k%F<;q}meA(8OQ>(U)jZR`hSXx*}JDpCpG&^^6Vd3m; zXWabhUbFdlmYRnHV+Q>s$-*G?X_n$_hBF2y8EIxIh6V6G4-cZzqI0EMavrZSLk8_Q zb7r0}Fl^hhj&i90UJ%Y{wz<(8zy#0E0q=4m<+Ua(M3f^BVVR{tOb9sVaL&`sQkwk) zKM)dQQ7*t3%hbx{^fFH&jEIU6WAzGQvB>&b2^oo)7_0K4ovT?s60k&im$PEc8ulJIMDxsP3gtRl zV|bqJCjpmpgW%gg{@qV*qVsGi_X>fD2tz?hj8;5^@RwfLIX`pur%s?I!8uQAWjNs!KGbv)VeZ69 z=GzG#p==BPu3EkRU1NUMJd zATUB=Gun$Cisd4aF^tsfOpcDQJuKjY0Z9jxQGD`?-=-=NBH+XiHH3^qvvaw^rv&dk zM`va!gaO4cqE;+WnJ6(nHqOeLr=muP3o*vT6bms%YkU+V#xT-Y&gECFL>In`Kk8?WWUONBPF* z|A?oaJV>**M7w8+N+GSK4sH+<#wpcmgPAkO8DxfPWrWc}N^z{hm?=_T5iu4PX?Hu^ zefz^?*^^Ax>iqGCev!4?R$;;k=H}0EV9z0L`O3HGES*M2CCZfwm1=>{ee?UAKE1@R zyyLY5PRP>dmr#E~TD@ZHrrQ*}3YANA#ti9=m*!ol-BuqoM+zwl1X58h*xjMWow1(rZn@*txbb0NsKs!E@+Gj zFk#48V~ml}Dvd^ia&?3#E>kQPDOHL@K|rtDr_=5FBlOQl?K% zb982rAaHqz$^hqaMk85D5JrrTl=$lXdxmlEM=N?tX+Hd}S8?*>35xXw<-nukB2lQ( z&gEPq2spHNk!CQ*SU5p_yhJD!oH6tVj^ZIt52Kwz5Mnw#I9R``DRw{Aj zH8)TSG%hm4)}e|49?kUGHp^En!z|x`CZOADQ7+Ud7()k3ZLERr^?CWO2@0x6>PyVE zk06~ct<2J}iV5E&>oytmr`f&lFi-FIn4TrjA&Du_ww9u@Tyy0mv|0nEPn~6SqRM=` z%jWe{^s|(?r6sDB3fjmEjN#{8^Kb@VaPehHYjJ7s%;{5`GTSYO8j5i-PdSQ3q9DxG zPk*lBBIBg7Cz~@RCnF4nVpJlI z!Fh!aB8r8WFpen|>y#^odbN%UW3&O~%0$%)fzHr60;9=PZoQMsC+K$jl!Jg?yG^B_ zaWdfS(i}D!&^&#V?re*!=xKL*#95!r#Kck|bsdx#h=h8nfsJ8ebeyc;V^IVb8Ky?c z>|A#-<6|{8ZkyzmTkfZ+JY!l@4k}E~%yE2rk!mF((gv~5pLRZPc~r;=Nop;xx%myr zb+3H;e>`yDaN&;IzrCfkIJfTj!N<4GpFMGTdv?0)vq7xUj5cc2Ds>8_kU~@d6y8aY zW?A69TMz!2H(L_sBZQH&Hv35tf)D~KGT z3KUBLSsF922@+W9rE!WC11Pf06G=pXVS2&xuix=f8Y2y+=bLoX7DuPg&`v$g&H~0+ z`Zl9nG~Dy_Zd|5llq&QSOCs_@)3WEdX76b=7tGn2SJ1If4-Y$IH_e=Ay!`2W7OSB zi%&C`^=$uu%KQNnhP>frS5EZ$>BV>6{{)ZkIl@GtMh2J&Vk!)h0UK6Nu<7bu%(go8 z>;R<=($84REP?d|p`uhQaAtA9crC&KI_TqFOe6{)1+?axgq0#>5NCoDAq+!mjViVB zD3@Hhh0lKBniNi^()8OcVL|Obe}BA z$>msOl2jDkq=VJMvRdhd2`@v`fxNb)l~EUL*))nsb$+2gcIxzedUATPpJv%0s!z68 zZrpOm%dWfND>uIB?JkJobYW(9{pjx9SGT)^^`H9Nzkbol{U@$UQx_|oQ3@KR5}Vg7 zr(UfPRI9|kfD7{m$gH1`dW#YvF`&JERB1$^y-^H+dr&-rXBy3Iz)2B*NGY|0XG6hI zZ4(4C=LE@wH7my1wR0nD*DNPenqxC_Ym!80Cl>Jv=Y}NAgO4*h%{Eh&6KHs(9^WVqB0{OMZq+jCg&N&-hF-VEzSBp!=Yen2ZM7I}OtNg% z1dU3}w{HD1tG8W5DGsqoLR@F_qASoo7a{Sz(T%iP=?fBoP8>lHRC zU-iD7pBg*>|r)FjUp_BBSCDb9m`>Q`ax3JhIG8&f&Ub*uE zlDNEKqTg(C^w?QWo?6622E0M(B(KtW0|musu}0RM&gBHWRNVc{`KNMqvHkk9XrmMlZ)&=e2n&DN~ILCX4_VF zZQ6`$&vEB>KEsnoJabvddpCC>90Tt#HhW%M{wK8bd{=qFW}bzm-e{mzx^456vv$xI zRJLW^3cGgASUOsZ?NfX9+tHED#f|IMmRx2>W)|A32K|1v_rSsai?6<{yKMRL#ozkF zKY19q=l6d1w>i`Ezi{8QsAoR)--^?7t?M(dFaONn{=wFRGY4MdeOA#P#z$il2NAPN z1FpDmBT=D@h)0_cqo7bIpcO&p6+(th9YO|9Bg*Ifz)FABA=ZeQ_J&7m<ZtX{SZH*TnVw!qQIc)mu(DXKMrkQFHVTae>}3~kv-kes8N0C1wyRgHuxDo4 z*4n@>E$Fbl)GF4Nm8xj77O)CsZ+*n{oRj(Y|K*Ei8_ZyRIR#tGCA+-bUd14Di;Yt zLl~D(1ejPElB{U8+8{RBU`2?6n1c8}`G>FEfr$cQZ3qi7Hg#Ymug8lek|Oi-EuP-9 zpKixfsw!etz&Rl*ht$Fl6)MtnK&cXudco+tZBvGo7fYYXMwNP4AT9+cpx@6p&_2!J z@HBG^C&>l{qH@ewwMZB$D&>Ij#tNn;rx+h8lJqRo(+BwM-+z{a9f$K!h$F6kFIuJV*SszurE%f9mXsxsgt{8zG`n$+YsCQjj+Xma8!njZx~ADsj2UWVMPP zsbe$*L5vDL-g;8Nrx`v_1VKQj+voQ0KaOOA4HYKMuqaHR&}5Jm2J^&dRQo-<9XS3~V0 z*D!*>@C&cGl(B2yOXKSI@NcgyV6>2Cia-DCVGiwkk`fLRLsTqM3@gKOu}28efk*2X z=+e)1nB@B&rL@+X29N>C@MRZUOR3Y&{_vUocA~K?(Zn|K*hijt&>CG!mzPHE?q`nL zfj?^>+AH>#e)W30E>PBa?7(AVJ@F<5HmUVlX~KMT)>Ewb=6;Z~OKmwMwmIl0nbzKRmCttZTS+YgXA!J2v$$yz-)B z%eJrWzw>pkOCueGN=e^2(Kx3T2A$s0sYCzj*wcG2Jky-#sUPmWHf@-oWI@GQ_8dC_eqg+t8Asl_Clhfp?_NU~%+(P9#&W za=8{o6e+Yayz$0Yvgxv2{PfShi4E&7AP$RpYn6hYz@L59@x|K?5tEQ58JDgukj#zJ z?4*n_=_zLCA?!plyqsEt&&Y~F@4 zG4o+?MEw8&AOJ~3K~!zH_5KA`RfVmqB07oV*qH&xjxItBgT+(KFLm*QHi_+W=MU~B z?LA6RRL~X%%{D7HZ|Apu`=dPl*poc;$bOX8tY5z#DWsIb4fJ{^`N)6x1#~gyBmd>M z`P+~Fm*Mgz#lE>?Y#yD$m|T20xBcP&K0s%w&#PWN%E?oPkuc!e>sD~@59jIG9;F~7 zKx2b0iSd{$Kog*pBh%`ImPgOE0OyUK3(YRhlVv{D&m7pphSh6=k;+JP{LG1X_UvM& zRKXUaM)Hk2ziqF(c9;FBH(YB2RkB3bSKM%^J$NFrD<;<2uit*ycCVjGPIpOa5m}(D zU1~|XtR&VbWs}s~*^aZTCbV@nwRr7J;46#$u8t#(@(!Oxcn47_q)^r-=@VUY!8%48 zRT-^Ek+_r~H2$I;+X_!SbKF03CJsdrL*PSnsm9u=?VOpnEIs)I{Z=1OOs_l5%Wix< zS6_cEJ1@G1m%Y()86CqqVc*dKJ2w<5j1(y;N3Eop@3q;sag2gdB%J|$pPQfyESU(#XJny6dyCha z0Q16{7#UX3l!D9&TD&N&)byDJs--$Vd}gogy7V%)e#ORM`{sCv3ESDlG)sMriAmwV8+o?5TOI_|%3vwh6|H zq^Z)n-f3FnC0~#fiUk~vMwPAWD!wxoxaAW?WmJ%NM(coHf51Y!nQd6Nnp8YVvlq_H zHKo~VYawBDtfGKe#l@)Ij~QQ4q*O?uy&o zINv7AI)r*9srMvV!m*P_>7HF+YCL5A)Cof7m^rnVJHE4rcfI2}{^nyp$36Gl$^P9P z9)9e8F5IvjhhyK-qtsW1MDa3t9>Nf#<-n(=beO zaWevp;27~rjVQ13zhNX)eynE`ZL~w2Cex5+LaYL*mqS^#yoxcwbDlyGL?NMxQCcV# zBAU&%yYI0BJ{wpW8ylDQQcu2q`%~`elRdY5SrL^A9qTD7p;}aA&J#wkarFeXYKhc? z)&@*~QzZgZzy}5}WGX@FyyxTqEa#p_&T#AZ_VCpHQsD>zH7~uvWnP$@U1ZtBs8OiW%E^NAj^s<C^pjwMqF*?Cx&pbieZ?R_TLcaX%$1wgZ2TzH9`p}&Ez|ZZX+Ziyokul3h{yT-`Y4N#qLdJb!7GLHLJ%lUPtWt62M&`gE%K`Cwqn8pD#GbaH zred5^_{334^PYZX99d{7m>NAv5kewDbSjuCr~;5WI#xe#%KcBWbd~1`WKJYWlnnY# zNev#|{V1E(uj7Az=I^=pfyXG9AEQxO%kq`Wx%a*Yc8s|`-f&apZgp=RBhzjb| zv1!h_5!yCIYe9KUl6c}U#F&s?&mmR_Vnqfhr|=@E)MImr1tXAV3Ch8SmCO0zsZ%_& z|0M5x({+qbj-iafdtt?<3090Q=TvK!R-*XEZMSgo_6FBqc?r+F@-&Y;@;%=E#y4~4 zLy8|fbOL|DYPPK`GG6V{?0Yt>uYgh{y%cRVyVna`wIf5i52owhY!T^`^ z>x2ODB)vrKK6n~QQ&uh;<&y1N`RK=gj}u3lT)yK)T(E5uANak0&6{5RRv!A{?Y!lU z*Wv{}_BUT)`P3?T&+D#CG!ishv-%@{_r2OjKJc@Z$$(^cTP2k;eWkHpu!~DAd-Wx& z3w_(S2lmfcCo0t{YxJE}E(3`TE=}>uA=)Uw%s1!MSY;H9VPRpOLuU>U>j^ron9tn* z8D4Vb6}QdwyX!1QqQK9t9bc~uScBX4}bkX69+YJe%Bvx-`%(K>03U^*=C3D-FGs3 z+f7?Z`wI*@Hc(?xEK1dM$s|hAee9qcJp9c3;7u=InN2oU*@H)BZIJoQif(i}K3{Z{ zrg*2&#)DQ266?PE$fHur0`;m_-iRrd*|2;)8>Y5^Qe3lZoXN4Nyap7*>Zz6VyG~U~ zW$!)u?XTIc?tAblc0cwEYd3CSLabt>L@(?PY#Wady!%S}Bq& zr5K+Qgc=(@e^1*#simXxRUlbrnVvny#8`uW_{Xo&Y@MK5tx;Q5;YC+o!J&n{eDHlA zAdC#V_dSkUvx&oJPI2|M*Ky*+S&p8%i<>TeC4cwzAMn#}emPMTWwSkG%p2TUrAvKlPHAbMVkHI)j9D z%T@p@&OgWG*c1Tm4%DiU^ahO9iU8`pzkN%0s?b$a)rgm0dpY~g8p=V)LfWGdRft2O z-#2+f1%fw%O7nd&c~>rh$winDRP31^w1(|o8Aym4E(dB?;zL%jStrJ{v z;RQT!8usi#?OLsnSY-+*)l`sb9oI_5xLneetFKv;dgZbWYgT7TOZzVm91U-fz{3C* zrx#79)l%ctlHPW~hFtnbI68ZbBS+@A@ycBQoS9u>a=Z>G>eV6upZLP%@lw2l{nICy7BNma}GZ6846|1C%^O$ zT>G-ObKROcU;E}Xg-80TVKlKPu#_K{wifM$nYto z{`moap0rH7f6hOcsaGnjT{)$CcAgEZmvhyn*YI~=_%z?V_cp>nQz;bbX9IR0-%Xa+ z7YXbFsnQ(Trx;I17+t3L>#u#Dr)E9J&cLCjqZr4GR`ScAoF>~eSxrZ)ak_ndQQq_B z%Ys*2dqL@EUNbpiJDoUnfX`Q9rUK)u#$^4}a;LPGCwK41iRZy5p5V=I|0&+_vp>Vp zlT8NJbL;Jo^4RXD&p+9>?|)iu{n}IE2j9AF={J7mZQ+^bF%BJ>Klwj7d$z?@ z7hT1hU;8$KYK+R;zSzHSKkLToOe|XuqWHk?e45u@|6+>efX>nqzx%O|lPoTQhO`h< z2{nNj#_J(PJ%YioVa;;h{rX+J;@YiDtqA$<1AEB4L5lswY& zP4U`S+^9~SJj>3V7xU6iOmOyq<|sLnDA{A{48ddYqrXd{j`%Gd3EaHGbKo@|SO~d4-O?`-A;D4g@r) z)Z>k1ey%0`#AOO}sV>}d$Cvq|Klv!HyXn{X;0OMY_y6{<@QMHL^ZdhYzt8EV2N2+W zzx4^e_vEAMfBw_5)M7u4xHgYgNGfg}^2JTiwk$3jEW4$r&|;Y zmbDXg#+MtkQS96@g;I*WkIWFn4zfI*_R2qR9{zlQi{#y7!y-y1wMyt0S__QTsx%r! z=8}`lp6>Gf$G(qq8Ff9*n_l-eKJea~iGqN|xfy=&@OSy@onPdCf9dlSBgI9lF5_q? z&l3k(!bBD7<@}nhB;}z!XKC4dC3rzWA%IN8o;jN-6RP~b9GSf3xYh2d$9MOznUnR) zH}TCoZl$`c!NAUO(~EcU=nwDXJNJH>-~ZK*@wykkmnZl1`Kv$v4VKpnetg{c`M%g< zv?6%@Yj<&M<^&=EI#I->0%0kDG@#WPAPQ_IoI1Hcvu9bFO{ml(wyYVW*X$Ao4p9*5 zlmY>RBqeo=Of)LI;igwp8Y$9kHF@_h{Vad=@z3$6AO8nBOC270{1#qu&1+d|Cj6%l zewa$p@x^;?_^hYlashmRkVS6p`kM^B#Rsoe*uMkT&>+n4z4 z=WhX}$((Ti0|)uofBWB<|}d%TDDd8XIwKoo=6h*M2DzjAl~k(6bP zhfYQMaycu;|*`)`;W|09yJ7! zBQg(d-0ESp$O(zV?8 z=%cijn*8RU{Vu!Kyo&e!?0fic|Kmga&PU(JM?Uns1VPBV{>^Vt9@|7{gr!cKA|)=l zYz5815_9t%dc6+CVv+KAj8ck9pgC}Aj?-rsIJ;n}70dW6#d)Douh7rZyzuM6C|+=1 zx@Ne@!~x}Mh1vF;vWHT--IU#X_cJlRmb>n|hpR4mCC&*?9$4hy?jEaFZAC=ba`7$> z9N)u^OV+Tpv67|P9*xNoWd+JYzv5Y1v@j8qc{n|jqP*qqdrz`qb%V)Kg9t7#;>PPS ziAXMQdO`I)tzJjH@l_Z3xBmREF|%-#-}&$dShsSNi?(m(v8NBw>78bxvW54*_Wk)o zno**WUCb>+@`u0pbHP|ayAS{JPy0o87YfbyA3n-eTZ=@Qp*~`0w^FRujFn3KAIjc4 zOwQ}N@Bf^8-!gT3L)k?KL9hcL33iGUn?#DVRc%F7Y|F78w^(r$Cvlvgtt7JJZYOpm zOO7O~(Xu)vlA^^M;faS~b{QE!s6`Iu! z!hFEsKo7tA>%YP6H{8zT%rTr3ItKc<`Sy3RfBz_V-*g8nmgV`FEp&I~Ihkk-DTqUf{Rx9McOGKSnG7oHkw+hu z$(bqEU)0ZmqX+2e*hEKpB@cb|OEjA)Gc)^WaFoQ&p+s@nnv3|KfAuM5DwA}t*8J}u z9>O_Tvm9y>lzicewV4Aq&N07G!7ISv>Tdcwv%o+ErIe`tp)Ojf!=)C{mS!3=d3M%z zRx{I&FAFMkrg6H z{j-1f`~EkcJWdUdVlhEtpN>3qCe;v4n*THgsr3 zXV#3V6sZ+rL+}#`ye)K`%f@C;j2^R|A8`2S8=HK zWarpVMbczFq>m;Vhzxp@tPy6#7VQQWF^FR14{>A;jPNP*pOF*m)ogFFdl{HbCG(+;ULj02n{G4mGIAhtkX1%=o zws*Kw69@RtW8dNSn{Q)cahkC+C%EI*d#KhXKnDbF6}jRS2+-LzKu2+yXtB=DJ0Vtz*bVr>uh0cOTT*A#)FJrJ=j#^|J zpZxjX@3Deu zg#M5`xBDQb6;pPK#0rCh3SWD~jXF`?5O|K0)ANY0$ZMaOg(gabEmy3ht`aa7n}Ss# zjYb3I#f&Up&EJ3ThnyIl<-PB@hhO=ZzraM`$$fx_&)tR(7A8={s|#4G5_f zp4M%6PWO{(xMe9y2ZLkfz@S^XYMp!EJs)As>NSj>IYB`MTyfb&Jov$n^8BvHn4R6t zlmGY}kACmROwGN)|NQjFut^73U412`LNCU&@KnHOzxE=l`XJ~9FPAXdaCDXhr9CcQ z)4|CJN19~))MIDjwAylM)*6-_}!6{rDfGA2FzAu!^d8B2r*`1NgDQZc~v(N3|<{P##GCaVRD=*`3zVsP> z@2~$W;%8-qMx()|wU=_=JFlbITVV9mX&$)ar?~OT8@XiDHH;pZrL3Wl4@r$BmsdEg zF-Ca(_zXwK=2*9`%)n4D^OYJP>_0q7t@pB*iHRh*J@R5J<8=N@!Jb(3-uTTy><{Gmc zIeC!OrFexR8`pNRaAKC-JI+$A@|| z8F4t$)DoExWnpscIM=KgNr(IazWfj0kYE1kU*d_U9^%ygGk{`Z0{;HHRnF`_1HjM! z($A3ZT*3Ha%fI8kd(&@!`wh>6?J9f36@#*l?k>&h?f|DX4J!nGHoDQ_`xL?)DMHRy z6pJCt20BQb%Th&2!PB&6=b2uZ1m?(fId*E~<+arsgK;@9HDx_43dU z9wBPhDR+0%J2*lsNeIJ5o_+CUrWaGzFDp}vBYHbDhmS9EYJ36TDh6^nMh425RzfSy zEcThRi>zN&WT6tZ&&YKKd-_ixTmE^0)%7%59 za^mQ5wr_a{N5d$7!QwOb91q}L?BV$hE(7qv6DW!tX*xZDjYqo4XDY~zI?-9Ct zH}dA2dzn8O;hd$nyTu!)pXUCLegf+pAGql~eEBo?@b_Q)uDk2@?fmfh=hehqO>W-4 znU=Doal*2}5?--H8XI1IeVk^a#hTTftl!*6K9`L!`JSR&@agTy6B)p1NQJoBWX;AA zuD|+57Um;v+IkCHE?vPJr+4w<3$OC2&-@;Ru)sn+<%L&{lGmDYd4LV;HuC)+Kg9T{ z<6M0Cm9*;cCx84UI!Z#ZoWu7N3sJ(MQ#FjS=#rvZPtXF|%VAB*d}WbiqcwKyK0t5D zCy5iRwM6#qr$^t;hpV;+M+KTFiPhB9q(rg7(;mxu2RV7-7<=A$lg@lUJKubgxE9l_ zRQT|NpTtDV*n8wS8#W9R$5jTq)^Pa97;}sBh|-9_@tp@58~{}iR`wO>?b0k%6qu~k z^TKNl#>W=jGkcn{Z|~8x4471dPRWHuP8~h2>W#$Ru)Rx7o_URuY~Z(l>sz!c(|r9q zFJQ&zumAW#UU>O4fTMr7i(L6qmUpgm#jub*_<;w*ci;UnEBJU`3E$IHrdzzY_cUjx z>eQ*q8XLrc*ffD=PoZ|S|1)h8H7{`vx;s@Z+I3sv(-?aL+QF^=SCBsmgIJ;nP zz3%<`=@(z&%>&2KQsC&Z6LjW_yngBg&%W?1hhIHN&rpG$-d@(NS;OZ(`$YTVcQU$mexbPu<5q_B$Lp^KCBLcm?-;@Gk!KZ+@6>eYeHP z+O7QBzxfQ+`XVnpIZF4+%`7y}@X(k4#&!?bD3v{G)^hxeq1B8T zT#=_#@agW^r!ZQ%5Grb!g%gUflg1PEU`~Y(yLxo2JxJrVx~voExWFnP{~rQ}tS`z_j%L)5 zhacaYJoD7+OwQNXxBoCU(HuK-nCa09YgcTf*xSwNu`x~`ImEl~x|7#ldyX5g?c)CX zujO|?c`q0B4Wh&4)E0%;jvwQ$cWvh2j;DF$r5d?>Ku?!PPk({Oc8v1ut~r{EF-E22 z^P1kWPGYN2R>1j0sjz9oW;ru|n&12{zn=cwd+&D#PEPWrzxx8e_G`aQZF-W6E~|2M z|Lgqd%aiQd|2!Xf?*=Zt?lvyDc$<3Qga6V!_uNaxZJXEf)h|EGo4ZHp9~z<~5SlJ# z|B*$~R44^`TF%i(VmucxF zjY)dha>YA2cyu?v_uu}E*I%2YR2pJg$Hg2zyq~*nznz}GAy)SHanZU<(SZ+fgXPPI zSR5OrwNNGK?80h8XU?OmT;$aFJpc16ukps=DJrd2*1J~>5T|jG1p)If4AAFeu~_}~ zB7Zx9pKl4&KAu*b89n69Ri>DmpQqH>&&Cbcal_Vo>Fw=g`}Mc5ZvAGa=B8Nf_6u78 z03ZNKL_t)j%z*3S?7}3j;dtPlOR(1GzkGft{k;KKtn1>BKlv_h-L{Esmu;fx&!PMf z<%FV_-zw$^Of z#H&v{PK2dUEVI71!0|H`k|d>3k4Y0nZ^@@xZ&6uj5#)Rp7n>X(J)7mc7@SQ}k}$Gr z6)(K}5_|XTi1P@wV{G)44YkJucitP5gtG1Wn`s5(XbpexpFhuuGl$uF z)tz+pmY6)b2*5|~zl+PSzTSTSJ74n3U0phq&`Vm-+u6(1;Wr5j1v)xC){K3j7`k(@`b##0NvJQ(Q?1SrdLgmah|2Ty55B?6 zd&cPM>LO4O7)@VKiJ@hkqyl*_2Pvo&jDQIg;!@I#gy$y`cw4;zt8k>wn8Xb)ThH3n z7jyLJekLm?DRlJH*W1m(Q^zQDbg+Ka8b14_|G;C<{Fv_H)%@VQ{|~8k?Ag7SR%3yB zb%Bw=0ebs$Opl+&dOaLJ4f#^$4@(81(J)L`QoODlSP><@5panUtcyscMd$@gO-(5W z@}p;Ws>hyrhH7(;uHq0c?tGP@HU0E=4Dhud{5L-G?oW`<^|N=+W2{==i=Que*KNO5 zPM;p@XjWP-GIQj5I;c&KGq*5BzR*Rb(!viQ9|k<~>=7D~p;C!BdTf%jV+$NPF+(d! z33EP6#7A1g*@-hOTeh0VpMIDhJ@YXA%SzNLi(Go~Dn9(a_j3J}?_^^3G*?}I3oF+w zBlS9%nV4bKie*flnZyhGKsB+tNF+W-4v%y3CEeV4>orVI945?b5QX@PG)`$YniR@@ zMjVtOrD6@4N6F zp(Epb=mYjPr$gS7jNY}_pKK;jEhv-8yzxBSuDXYd*KXyrU;GxHSLDF)G46ZECO-0k zTd7y-tn4lDssH!@*I#`p>jqb`<*Lgu?L!jXW{8@ej|jbhRDmac1~cl&HlbL$`iIQ5 z+qZM=_U&A^efv+Q;m&Fb9o^PbzT|@fp&znw?WJs7b0xW;#NvEHuB(T@g(PW?PyNSF zbK84tmpU}JLv8d)~*_s58Qo4{L}BeC|I;A^@D(Vt;+E7BG+tN!-0Ko5GWrd7Oi~3 zAYfs!#qrZ~h!s5FCrG93za>MRv_hH~LMc$4uX5XUx6#|v&*9_8$@LT|^>*Va&5N%+ zO+b<1fguKZ1{oRL$g?j!#-@vg`GpVP#4Wd8!ry*=&Nm=-6q- zYdMrlP?Aw@*+6I5a9Z#cSkGe9Y!*xSpGDzUBW* z!(AJ~!l$EWWwd3>owmDo(Dn6=NHeOC&ucMhi^}|2di(PH<^TG;`**+nNtO?m`OV+_ zFz>tf*Ln2sKZ~oU4E3+%;PKl=;>-zrkR~I$qfMIE{M3C7Z5b#kyte+OwY^)imcD ztlPYa(^GHo@ef}m@4N3N_tkGsNLVOntmcF7+Q#j-UPa&F8rBS#v-&hT!)aAQS4WPl z1|gaG_A(8##$wtdx*E%LZJGmPucJK8iBpr9C}Di`I0tvVNxpNC=YRYpFF*exi_KYP zDrdNH`*uc0kJ3?cT(V|0`}b9tn4BY5@CZG@q>jWSY}kAe${IYKpxVq41q5paUnzVq zAeRd>ym=p7`=BYRMygehmz*;@cf2UiJ@@R}mfy|=ZK51=Q)4=wI=r$Nq{aD#88=;- zX*Cjw#VaQZ^@bTeb4qn}b!wBgbXWJK-c8$YhsfvFTQ1>}TW;oOKXE-nJzaF=a@>E% z2-DLocE5I#dTF7$^AJqY+K1UAy-pBIHVg ztXZ>-54`V_iA6LSfu1vnwV9Dr9&xRPihK(B zJd#=lhSzaw>@c0n2YKR=N0EFVJ<8>PcuMvhKLc6M!#O#>oxsmI zdr>~L>g;{?2ffdK|Fa|R?Cy>E#=(vGbbKgaw(R*BztmF|8JO)|wt3;rqetpLe(DD% z?CFq`C#Lx1ul|Kso2lrdr^bY^4;(a;fUvAdHHd@2SNK?r6B26)l)@LEYSX69#;F!9 zR@*Epc80(YFeY-NXZL9^N_kD(2w9_G+U7!0 zqDhTo<0YGT>ggRkx#I;EryHD|nB~angXH}#ZoBCgZrpMYt@2r_G!;_$)@rNa7()K}RoyEvQ{ zFp2WAiQya>q?}rk{y(eX0G=N(HNVKj)BMp;$HO&iR&&|bD_353^)|Xz z*k+Wjt*%@C(b~?}4>iiY8yEicGk=(S;DP_taw?xcJ@G1Gx+(wV?;r3kTRCL!-a4$` zID=8yIJCQXRS)j$JO>X~xMWQaH(u7mV>?gjlV=i8i02ee64FGl&R`Sltv5WNddmIj zv(J7-Dvc%&-1iAO@&R-8I!BM3SPw|~kjJD%k0-+2YU(9P9X z463wt7KsdrF-RQY^$rs^6}~6uXgM^QmU{w;a)`C4SV%3TB4`IG2CHI@92v!r*7BVv zK2Ng=Zyq|xjn~}IrI%brzL=8FWz7)J?0JaCp86uG9pKK}@8#83ck=LKhv*v^qSmaU zl%iIHtGA61#Z6)tgU&z(NEFt9vVw`=+O0!GW`NfZG*AdO$*8+>B7}i1J@lRL%LN*4 z-&WwhQj%DU7MW056|8l|TrQ^x9M(7%n=Q^BIL5C1$M}aIJ|ThUv3}J+VcWLL3%B2T z=iq<)joaw%T1llg6ZiHFRjmIX;^o7u7LFh6s9t$#4P?K=-1{0cdh1Ae{)P}W0V1G>VdX6-yxE!XJ7ojtQs1T`DT^j6&De=W_bC) zJms*&o&#@k{q`IAsr&EcjeQFYuh_`lcRnajJn=m~_|Z?YFgqK1g0!3^v6ha`JXT7i zHpVK+Mv6osx=qI+3Q-!Z!Fd*i!`fsC3ywgCi0^pz`5nwJHgLwUWy^NvX6D$p{}|V9 zyO`GxjZ+lIo!5Ve$9H^%N51)W{`D{aC*E<>hxn_%`vhP3%SU*9|6z`u9OFHAUc};J z%$sj4aLsKVHKk~wD3>%n+UM*+>0u6Y%K&cfg2cu{HF>xM%GDr%V9E;To^|>>8dG|`yUF>()UH2|(b2Um{ zHztj^a?>U3JGh_gZ`{Jw*PUYLuBW+T(>46TU;ZoZy6gS6vuDIiO^zCkV|aNt+8Lr4 zd@U%a(PHs6#O6FFs*=pFE6>Y%1q`?}ONA6dk~F9^r#bk>bKG(F&#`0Yk5CeF)6E}3 z;uMK%JoLm9{MD!bh}&+v9GCoWo__AT+;hjz@bGs(#}~f-C%o_8U*YWdNw#g-z>Zgs zQtItQiW)VOeST+2Sl-jcnb9WYZlM{~$>lou#Sd&`{J>iF{HO;PS*&%mOxgz&fuOC} z8Zh2@1fTN{r8JE=mf32x2E5k3@Ra^!MpZuHx34whwJwvmS3Ck2v3K{+aI7K;0Od zYDMd#cNTc$A399aDc@jl&Led#%B2CWyz)+$_d?rIUazWC)5^<-HcC>?oE@dFXMo*% zpXZ6k{!XsH;a-05#5ZNts*AZ|`z`#hzyEFd?O*wF=vmLdXk#}Ja`^B(y+aXb539iQ zgfzifLo*7vh^%?5V8`Y6lFt4Pv$o_qN) zYu8@HE!W(@5C8F5QniQGE7tJkzx_0S{wGiIA3pu({P*AecWhp}9p5kW-5iQK%L0b48rBG-gLRwdZl7mc{F6!;c!xpyj2ykTcisi8qxn+rM!Q#-OD0Xzw7lbY+ zfl~#g;y9+&YBD#sz=0Fvym8`-s4sj0QM!$v4&_2lU%q;UUa@*r*wep^l_RUzzU2xw z^^CHw9OB~a(AH{?)obJcNR$hQ5t6;!C;-nN{aD3tTmK_96x;FA2@buFQH%L+UxHka1L+9C5+FEkq4wP}9)6CdN*7rxEDdRlhs}yXy+ChU!*f7m$)xM{CC=K! zx-1~}kf^;GA|T&33m%{)tJ9wBEtgmJ6pFM=!V*2KY12uznvExqEKc0l5e7GlsOvlP z<=a**TfW7FUM_T2l=7t-W#F*QD4|xX^5PpuG5d}H8Qp|0Lg@Q+ca+*Z#e(nW7(exf z{^pg&B~ZEGvhEYqu_^VGGPPYiLgsc!uFziP7l_elBI>y5+22-Ooc0 z?`C!`A}9!nHK1c$BIqQ>q1dzc$IMNi;+}gx$kgl{X;{E_36=UN2M)f#-PhgAzj)wh zc=ow(@ao=gbIWb_aOBPJ(DlK)SeTt=ta6;$$qg)96(IQ%Q;T!-cXaapI|njJSc@?! z`(Av6|Ni@b#6Ld&3Z8Rp+OQVS&nAnMjtDYJiq5unFUgIipiP#9zSwH1&O$)}F=7O68KDerHszFUDSBS^D~cR~r2TUYf*lGGP~z z%3_6F=;-S&GaGqCra`5eFgsnNnUCo$Xc}=s)DV(1X0Wfw=5>8Ma`FsO-J(o(UzTj5 z)ei%%-Et?ZI#!TGHCFa7=gi4{j4Zp7>TJyXLW9Y8fKzY2%)zmMM<4kM?tlNE^WE<} z#_ii*;q0*)zVMaL@zt<`$i;fnDRM92jXqd+;Mfqq~+*-V3V5E*Cd)!0^ulP@YI#r{(M z7h`L6-DLFG#3{xpJRfIN(CWx*KS`AiZC*^ykR*=OB?Lhp=L{3o1evaLY;+8seN~*V zq$^)wVC7KH$jW6553gkP>NQ+H($D&G-F^0Vf010d+i5=#B_2T#WcM!$lR}c=dw{h} z%tXvgH|g(nh%WGs8!l&jp~UgyJ89Ly#1?U`O_$~ot4=Px`eS_S@y{?g5V3j9wyaHe zzQBF&`7p!7gKS=Z9l!IRe~GiF9^~pPujX@qb_P!?KKik}h_gg-lf5r~n{R#Xdpz{5 zhdDE!QHVNg>GCy~Z(2v_g=io#ibm3+5k(BI971q3QUgg!oMmBQ+d`|hoZq71J`gmL zbk<|R36D>YMGmWD5`zO3LTJ+j3 z;!10=)@s3~84@xAPSDPgQ=xrx?DTqIdEQgkwn{v0%zKTHE7gl*n z4H%@$*LqFh`|Gq){dvzH(Z22$!56fM29ubKcl&~eYww)YQK{CO->aulH8JTSoYdPm z%}p|trWhz}TDI)Z8)pz zO?Rn_d@1W}^}-TqeUVDN#Y|-mE09=|QCT~MRSvOjd>C=(QaKcqe8otA7hS!}@bg7V z+G6q^VXBy`H)t%@Ng{(^^5`uUD0bypIoQL2!)KYFt5PTg)SEG@SN2k=HL=DqSE)_x zI&}2E0@J```VWa$MHd+AW#&g%7M~D`7jvPBIUsISLgC! zhd3uf#+GPp=F`Meo&BAi4|bab@jT;fV(ZOlI&tn)V$%6~D>`Bwv#CuowrH2lK!|{L z7AMN#WI4E1oG$^l$uL~%Aa>3jvw{=JW~!9S1{O@}@ccX{&P?o#Tryh9=hlgne9qI| zg)rY;ECzm0xujBqD1=(l!uLEZ7GL?;_OYi}n~~0o$^d*MLxs>b#VMU>B$hO);XI=BQBM={}A{MJn>c-(*cJAG%HMxA# zYC6h!T2TstqFIfo%r6p~Cb2UF&fxiu@yP|WClqsev-jwU$J$nO2_HA5P0GDQEVgu| z?aQ=(UV_JR4qDDy)3UbON|QrCAW)(rp(oOl4}(EZdtHI2mKFS5x38RMj8mQ$V4c;@ z_jM6(xu^AVCkAT-#?b$E{it9ji533+?aZ1E~^G4%e-O;ybUt{N}kcizS<8+$sq%g2LDoZ9H5~ku)0^ zEMhD+wOH$6#AKMJVMswB4DuKpiH*_3upmq?G+A&}T8#vk2u2It`7#|Hp!^cOojEoQ z_p|G@anb;aUWP@N1-Du17dc_R-XdzX@K6Lfji2vAvw-$mnafHQ#X^A6VxN0;{}YKZ z3+*+EFA(^-JlwVyBL-p-TH>gi>;-Laf*}h44Ckvhv4aHXg2cI*q}iH0zeyH7QL0qX zYGn|FT}q^<=y`+rLM}*6szhl5aYQ0woXW^uT^7|Tu~~0=D^Y#L(l0sjs@BG>#YSV= zIA(x)`#vAwtBVeGkM@OH#tb;spZA=hpWPETa8kPFL&z}F5D z#Nw>Nx(o=ur(9m4wICE3?CnBX<-oc|lA2cBns3Es+|#<4vprHj29;vSx({{Nfc38SY)9dWejT$G#M6p>>N4`D3&}bX+$nn zh)r-R+cbevEVc{@3+x{~1fzM3jc_(kED;_FsS%vcQooXC!Lw}&4^S?}%Y`Hj%XFp6 z^xPcPsF}ffD51AhqT~lO)5PrAf8_9)xrH~|0``DKftt(Wr6qw|z+EVC0VGhmE+TC@1% z1i6r|a+zWwk66e2++u6zsZ%Fr=BlT_HQVbR0dX}w=n~=u8v&Ol^Le!3hmo&Q}&~g_PZ`xPTe!oWhx#E0E=3nr<39iRwCUCSCH4oRa z`kt0r%?AWwxi8*ev7GA`BON(U_mx6Fp9WeaHR5|AfuDlOleW8Jtb^FZbmR-my2{06 zIB-e`oN_7RlBDU9)U;}GeIXYV%FQ^%Q?AXKn#B;lAF!~nP@kGCn2xSOho}H$TR7)~ z7_^@?Y$%;42z{{0xkd3ZB2AX}^w8B6GT$tsOv3zJ%wp3}ug(x94eASET|y&r6iOb_ zOd-q&`+Vh5>d3Rq&tnpY^Kp|4^YMw%$;mUb^Cweh7uz4VR8(mIm9};-BGhp-+FHMq zJKLofLl!6KWxbsPTIph%recis!0FUDZLIN(HJ-IjIfoc)aiGMxz-9=Pnv4%nJMdj* zH5S_%uK$U!FEpX9pjWiyt+kRSMorHxsC+I^p4N)2FF;xARAQ{Q)+*RV1kTs-QY+QFgDFdpt5rS01uW)L_t)>?yMme z2wY}Aa{{6jf`=%JXh%thIE26p@IoKY7xEfxsIwCa$@o)RI;7fMV0ONlF4h+3W8)TP z7Z&FdlTJ8C)aGkk`d(rC`Gu}DZ40|8nXu;_%oPK*m^e8RC1#?%A(l+Ldked;D3MLW z%ey_TL+2dUSSj`o$=R`STdP(ySf!oO%JT_4AJIxJ)v>I#Vyt!6TF+UhtaHj*ql|Tu zrp_60##)qf&bkYteFcNvg0@gEj2+;7ow&Qb<1KHk917?C*HYTKRP9q4 z)v0)*T#qNZ!}C=!P=3kty};9+#@W0$%32A9a=zE4g2JkNPzY6sl2qgS3C@OyIPpc4 z5u6h3D)ov*tg;fCYGtZvol2bKr)td#v0*Ms;?vf;MqBfiHmtP2^HPu;TyWn@sj}gG z>Kv2pxfYq7rfT|9|8xsV%@4vrBr~kE{PMl_h%o(s?OTP z!=keaZU+Vf*_QvF0D{X6gWweR2%2S7^84brN*kvDp(cS z3?y4A3CJd)l(UGd-lm8j==>jD0Sr+Z5QXBX#l^QCxU>F0>I))Ow=R7*MiQq5s0 zc%}V2;e0CUpWBF%X_!Jh>s*|viA!!%c2<)nN)Yipk$f&E#URAf zT2is1EMlAylUkKptDLoxT35HuY3rOgYXqFO&N^$wYsP8QETI#eUznwP4uMp%FB`TO zDrj%tB>^qvqDxj{XESr^#@)(g%ik7j)e0CPqu2|>&~3l^8nhBQJvPPi!2!l6=2^LNjjPpasi(zVy=8-a zZQm}nfA1dhp^~Eq_j{+u$5o@Upk}A%bZV^*w5VbshadP-2y^5;5o<(L#t`cgW0bLo zvBnycdd4~l1FMa7%Hga@QWaa9D3K&htV(g&q6yYl1UQ_vcm{NPwU*p$!godusQlN?+QYz+E=;!bPUxhi}d0L@`*kq?N+OsL$y*HS$8h5dy9sLzAlvlom;HO5?QC@-1k3M*%SrJ)5^Eb zs?=tGCxY+JV+uN<%~bxDj(~HU=bwAHr8a_gsJ$fI3*X0)rBSw>@fd+r35ln~c*;vr zHZ_Tf8nH>dup{j%=i;7@Qd%yTY^Bj!s-LqY?6(y-&NyI;BL`uU$qQ zM+n0D)dLI-b<@)sa`4!3S-WO~+qnKBMppI<7Fu!2#Ozsay8RZpa_i-;zq>yfJ$1^R zJb9AGb{-`$+MRs$3H|a*&xoU`Gpg9^D(5wYd`^_|Y^_#z!z-5~AaNRtbCMlph{8E5 z)>@nsm)KNU>%^p~GR8y>D|wTW8o?Oj5@)SKum(wOO3wGvQmNp_7G;~UQ;0f;Bki16 z<0K3{oeM+lT%wZ1X>m@H%-QKSK{>`aiLG052XFUS`aeS!q#}ZqEIV)r5})^5COfJ* zcWCF7!itCqlo&)=!6nuh+e{Lpv^E{RtI`#N8%*44nC@W0bd-y>x3lb~X6DU&W!~w3 zGHdd7NQ_pTQ?7kV*jdWE^=pSXJ2B^!2piTeqg)Kg=RCq7vxJvz+Q{zLk4kN^>iT1bYXD?;cvx<@@kTdr9aI~TO#GZXv~P!!%s&fr;xh!tNeDHL)PgFv*_;BtZ}r?g0# zS`l$#tQC_YsY#u625YTEsj>A&+6;W3P-{)bPmXg=S#YGOIIUISDP^pWr<``qiSL{! zg`hIX@H8=wYK&xCz$%-eXCQ(_#961Db4Dvs&WY2?I&p|aB*V%Q&B|%YCMQV2$nSS?P-99$P4M+p}j5yS|`q%f+J0=L5v^O;<

      7@i^K4g+01b^9J7CLiXoDX*1AHubX|E_ z$kBnf}(Vu_efAZE3&Ch@OGZO?L zL4X#HH^1|J);d@H`|tim4v)G_hsQD<^dvhQi&KmD4&#KV5?~82NgR<>DpZnCLlYY> zB_yh4pW5L?MOBD~Ni#f)C zbB;<{rCzVlJ?gRdai1iKNs}ddXA>%ENLo$){c@5x5Um)`X@4f6QMOu6-aG1PHk%Vg zp>(c&l~-@wQWK9=#cL2mh%sb-%4TPqAH4M=zk9FG?!hsq{Q>jYoGi=bVDG-ZaIL{f zw`+d=n_sckT4g#I$jQ+G!_i1)v#BrgLe#j0U8f-GC5a75UONp9_ zSM@52imHgWc41X6m=GVC*pwo*CE)=h>aCMdjFx?OR~pe;uNuH~oJp2vj7B+mVG%Lq zz=H(3wzeu)pTB}nH+`74>1?dC(pn-&YI@Qybe7BGquL8b;y9&RYig235=W)?g)xs~ z*Z;M{m4)yos8@o;oYg0PH5d=D-f`#dJ(|m_RMSwc^W43E7tspKOEtQOC%p5=At%$2 zufOpUR~sS29IS^lESnXDRW59$ELVlwA0CUfWxqyT!Tu3)xSDAokF~_gZk7?xbgZ28 z&uA=H2&75(Xv~G}wr+RYT;EwIFy42rUE;NuZ|QQaLK;U*W>XQb>>uni?RTYrbR>tz zUHSXpce%GW#O4EBK4m(akc~&2ji+SJ3EmNiLp1>JuYUwG~<$>zv=d%*xs-=hn~BY}I-3g`3nHHJYs!f4GO$l5^CzWJRdnTzXzy%_NR?VOrJ7dQ+&D*jZJY6AO82;n1grexc9+Yywz++{=zAL^w@z1^2`f#( z`*0DrDlE7RMFHb!@kH>q46_Y~Cucm|Khpz-R$J!&M|;{{tMj$jzXEnfKJFtytbf~`@Voa;S&j-en=zTSbh~GCk0w~n zm`_Gp%x5y_9m`qofQOHEN%DuZma8}~crCbmV~1N`{wAZdA&(ADpzzd|tAHRuLSU4a zZa$9*4R;=X$oJm-4$WpAL&Uqc-{t)I4i`2%G^!P*bBFVe+Ol$WXIrdTos_5aEPpW%S<-@QjwmBDa~^Gab0?(E*-!sa&3r3Od6V@`T~ zjHVKXslI>bJ=wW-O~3Z)O#&0*)bRNipQC$JkvM7aV1J}{k1faJkf4-zrYKax0BQ;B z7gn>WMGUBQpem?ioXty3jVGf0kVFA#8l%>7{c49+y+*5*s`ojSIASNg!tD?D=^l1z zwHg?c@WGv3j=MP*+e-ixML};^U_#4rf5JS^35tSQ#gyTc1P~hBJS42N#6)%0D=XT$ zc!Qw&S0)bzq^UtM*i5s6AqBa*hS9tEyHr9HWIO0S|AN81@Wh9|UVPUnAuv|+}Jl0tPb$IoQihHT8 zR|+G`Q%vG#0{$3ik#cNEC7OObXGfDY+oXY6Ra)d`js^rOAQez zDJ6rkWvhLT>sQ*G4s#~+uDpM{hcs6;iA-4oHRW*<2n@$wEDm{+3YX8>v?v)dL0B?6 zz0zz{xq7JuURhnK5`{r&FGa*O%NUGiY_;1c!YnHo42GPIrZ`oqNojWDC18{X)Z+jX z#2AT5s|FLt*xb|JXfiL9y#otsan|CUBNwHxr31O>LJC;H$migQ+cxPn=;7N7-iG=2}YdxQCV+D9sj0oA>^T9`ZC^?_Ga+%J?CQ%d;1q;1% z?@8jAB#tR;d0a;!5*oB#i8vk3^)a$wf*K>J@x*b+WHRN>-2-Y>Lt3eEIvDZ6ZkLVCbF9@u zyee7YL6kHuiHVgoWW814v_C^-glf5yJ&HJkTa-h}9VMth5>{z7o7{gi;KAMrPIFe4 z8{D{lfy)=yX|Fd)l7M>;yM$p(R(SenV*(>Y=@NSfU4HrYA)o!yO

      '+c+'
      '+cap+'
      '; }); }, @@ -149,46 +143,17 @@ }); }, - showButtons : function(n) { - var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y, cls = ed.dom.getAttrib(n, 'class'); - - if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 ) - return; - - vp = ed.dom.getViewPort(ed.getWin()); - p1 = DOM.getPos(ed.getContentAreaContainer()); - p2 = ed.dom.getPos(n); - - X = Math.max(p2.x - vp.x, 0) + p1.x; - Y = Math.max(p2.y - vp.y, 0) + p1.y; - - DOM.setStyles('wp_editbtns', { - 'top' : Y+5+'px', - 'left' : X+5+'px', - 'display' : 'block' - }); - - t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 ); - }, - - hideButtons : function() { - if ( tinymce.DOM.isHidden('wp_editbtns') ) return; - - tinymce.DOM.hide('wp_editbtns'); - window.clearTimeout(this.btnsTout); - }, - _createButtons : function() { - var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, wp_editbtns, wp_editimgbtn, wp_delimgbtn; + var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, editButton, dellButton; DOM.remove('wp_editbtns'); - wp_editbtns = DOM.add(document.body, 'div', { + DOM.add(document.body, 'div', { id : 'wp_editbtns', style : 'display:none;' }); - wp_editimgbtn = DOM.add('wp_editbtns', 'img', { + editButton = DOM.add('wp_editbtns', 'img', { src : t.url+'/img/image.png', id : 'wp_editimgbtn', width : '24', @@ -196,14 +161,13 @@ title : ed.getLang('wpeditimage.edit_img') }); - wp_editimgbtn.onmousedown = function(e) { + tinymce.dom.Event.add(editButton, 'mousedown', function(e) { var ed = tinyMCE.activeEditor; ed.windowManager.bookmark = ed.selection.getBookmark('simple'); ed.execCommand("WP_EditImage"); - this.parentNode.style.display = 'none'; - }; + }); - wp_delimgbtn = DOM.add('wp_editbtns', 'img', { + dellButton = DOM.add('wp_editbtns', 'img', { src : t.url+'/img/delete.png', id : 'wp_delimgbtn', width : '24', @@ -211,7 +175,7 @@ title : ed.getLang('wpeditimage.del_img') }); - wp_delimgbtn.onmousedown = function(e) { + tinymce.dom.Event.add(dellButton, 'mousedown', function(e) { var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p; if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) { @@ -219,13 +183,13 @@ ed.dom.remove(p); else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 ) ed.dom.remove(p); - else ed.dom.remove(el); + else + ed.dom.remove(el); - this.parentNode.style.display = 'none'; ed.execCommand('mceRepaint'); return false; } - }; + }); }, getInfo : function() { diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js index 9c17ed34..df963bf7 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720
      '+k+'
      '+h+"
      "})},_get_shcode:function(a){return a.replace(/
      \s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,"class");if(h.indexOf("mceItem")!=-1||h.indexOf("wpGallery")!=-1){return}a=e.dom.getViewPort(e.getWin());g=i.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;i.setStyles("wp_editbtns",{top:b+5+"px",left:c+5+"px",display:"block"});j.btnsTout=window.setTimeout(function(){e.plugins.wpeditimage.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_editbtns")){return}tinymce.DOM.hide("wp_editbtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove("wp_editbtns");a=e.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});c=e.add("wp_editbtns","img",{src:d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.edit_img")});c.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_EditImage");this.parentNode.style.display="none"};f=e.add("wp_editbtns","img",{src:d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.del_img")});f.onmousedown=function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("mceItem")==-1){if((i=g.dom.getParent(h,"div"))&&g.dom.hasClass(i,"mceTemp")){g.dom.remove(i)}else{if((i=g.dom.getParent(h,"A"))&&i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}this.parentNode.style.display="none";g.execCommand("mceRepaint");return false}}},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720
      '+k+'
      '+h+"
      "})},_get_shcode:function(a){return a.replace(/
      \s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js index 3c9701d4..6f571848 100644 --- a/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js +++ b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js @@ -10,7 +10,8 @@ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...'); ed.addCommand('WP_Gallery', function() { - var el = ed.selection.getNode(), post_id, vp = tinymce.DOM.getViewPort(), H = vp.h - 80, W = ( 640 < vp.w ) ? 640 : vp.w; + var el = ed.selection.getNode(), post_id, vp = tinymce.DOM.getViewPort(), + H = vp.h - 80, W = ( 640 < vp.w ) ? 640 : vp.w; if ( el.nodeName != 'IMG' ) return; if ( ed.dom.getAttrib(el, 'class').indexOf('wpGallery') == -1 ) return; @@ -21,34 +22,9 @@ tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); }); - ed.onInit.add(function(ed) { - tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { - ed.plugins.wpgallery.hideButtons(); - }); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { - ed.plugins.wpgallery.hideButtons(); - }); - - ed.onSaveContent.add(function(ed, o) { - ed.plugins.wpgallery.hideButtons(); - }); - - ed.onMouseUp.add(function(ed, e) { - if ( tinymce.isOpera ) { - if ( e.target.nodeName == 'IMG' ) - ed.plugins.wpgallery.showButtons(e.target); - } - - }); - ed.onMouseDown.add(function(ed, e) { - if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) { - t.hideButtons(); - return; - } - ed.plugins.wpgallery.showButtons(e.target); + if ( e.target.nodeName == 'IMG' && ed.dom.hasClass(e.target, 'wpGallery') ) + ed.plugins.wordpress._showButtons(e.target, 'wp_gallerybtns'); }); ed.onBeforeSetContent.add(function(ed, o) { @@ -84,46 +60,17 @@ }); }, - showButtons : function(n) { - var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; - - if (ed.dom.getAttrib(n, 'class').indexOf('wpGallery') == -1) - return; - - vp = ed.dom.getViewPort(ed.getWin()); - p1 = DOM.getPos(ed.getContentAreaContainer()); - p2 = ed.dom.getPos(n); - - X = Math.max(p2.x - vp.x, 0) + p1.x; - Y = Math.max(p2.y - vp.y, 0) + p1.y; - - DOM.setStyles('wp_gallerybtns', { - 'top' : Y+5+'px', - 'left' : X+5+'px', - 'display' : 'block' - }); - - t.btnsTout = window.setTimeout( function(){ed.plugins.wpgallery.hideButtons();}, 5000 ); - }, - - hideButtons : function() { - if ( tinymce.DOM.isHidden('wp_gallerybtns') ) return; - - tinymce.DOM.hide('wp_gallerybtns'); - window.clearTimeout(this.btnsTout); - }, - _createButtons : function() { - var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, wp_gallerybtns, wp_editgallery, wp_delgallery; + var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, editButton, dellButton; DOM.remove('wp_gallerybtns'); - wp_gallerybtns = DOM.add(document.body, 'div', { + DOM.add(document.body, 'div', { id : 'wp_gallerybtns', style : 'display:none;' }); - wp_editgallery = DOM.add('wp_gallerybtns', 'img', { + editButton = DOM.add('wp_gallerybtns', 'img', { src : t.url+'/img/edit.png', id : 'wp_editgallery', width : '24', @@ -131,14 +78,13 @@ title : ed.getLang('wordpress.editgallery') }); - wp_editgallery.onmousedown = function(e) { + tinymce.dom.Event.add(editButton, 'mousedown', function(e) { var ed = tinyMCE.activeEditor; ed.windowManager.bookmark = ed.selection.getBookmark('simple'); ed.execCommand("WP_Gallery"); - this.parentNode.style.display = 'none'; - }; + }); - wp_delgallery = DOM.add('wp_gallerybtns', 'img', { + dellButton = DOM.add('wp_gallerybtns', 'img', { src : t.url+'/img/delete.png', id : 'wp_delgallery', width : '24', @@ -146,17 +92,16 @@ title : ed.getLang('wordpress.delgallery') }); - wp_delgallery.onmousedown = function(e) { + tinymce.dom.Event.add(dellButton, 'mousedown', function(e) { var ed = tinyMCE.activeEditor, el = ed.selection.getNode(); - if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('wpGallery') != -1 ) { + if ( el.nodeName == 'IMG' && ed.dom.hasClass(el, 'wpGallery') ) { ed.dom.remove(el); - this.parentNode.style.display = 'none'; ed.execCommand('mceRepaint'); return false; } - }; + }); }, getInfo : function() { diff --git a/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js index e924e3dc..0c2824ac 100644 --- a/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js @@ -1 +1 @@ -(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_Gallery",function(){var h=a.selection.getNode(),f,e=tinymce.DOM.getViewPort(),g=e.h-80,d=(640'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:]*>)*(]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"

      ["+tinymce.trim(a(d,"title"))+"]

      "}return e})},showButtons:function(d){var i=this,e=tinyMCE.activeEditor,g,f,a,h=tinymce.DOM,c,b;if(e.dom.getAttrib(d,"class").indexOf("wpGallery")==-1){return}a=e.dom.getViewPort(e.getWin());g=h.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;h.setStyles("wp_gallerybtns",{top:b+5+"px",left:c+5+"px",display:"block"});i.btnsTout=window.setTimeout(function(){e.plugins.wpgallery.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_gallerybtns")){return}tinymce.DOM.hide("wp_gallerybtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,c,f,a;e.remove("wp_gallerybtns");c=e.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});f=e.add("wp_gallerybtns","img",{src:d.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:b.getLang("wordpress.editgallery")});f.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_Gallery");this.parentNode.style.display="none"};a=e.add("wp_gallerybtns","img",{src:d.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:b.getLang("wordpress.delgallery")});a.onmousedown=function(i){var g=tinyMCE.activeEditor,h=g.selection.getNode();if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("wpGallery")!=-1){g.dom.remove(h);this.parentNode.style.display="none";g.execCommand("mceRepaint");return false}}},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})(); \ No newline at end of file +(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_Gallery",function(){var h=a.selection.getNode(),f,e=tinymce.DOM.getViewPort(),g=e.h-80,d=(640'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:]*>)*(]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"

      ["+tinymce.trim(a(d,"title"))+"]

      "}return e})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_gallerybtns");d.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});e=d.add("wp_gallerybtns","img",{src:b.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:a.getLang("wordpress.editgallery")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_Gallery")});c=d.add("wp_gallerybtns","img",{src:b.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:a.getLang("wordpress.delgallery")});tinymce.dom.Event.add(c,"mousedown",function(h){var f=tinyMCE.activeEditor,g=f.selection.getNode();if(g.nodeName=="IMG"&&f.dom.hasClass(g,"wpGallery")){f.dom.remove(g);f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/themes/advanced/about.htm b/wp-includes/js/tinymce/themes/advanced/about.htm index f521bd51..24854fa7 100644 --- a/wp-includes/js/tinymce/themes/advanced/about.htm +++ b/wp-includes/js/tinymce/themes/advanced/about.htm @@ -2,9 +2,9 @@ {#advanced_dlg.about_title} - - - + + +
      diff --git a/wp-includes/js/tinymce/themes/advanced/anchor.htm b/wp-includes/js/tinymce/themes/advanced/anchor.htm index 2928b04f..820f9ab4 100644 --- a/wp-includes/js/tinymce/themes/advanced/anchor.htm +++ b/wp-includes/js/tinymce/themes/advanced/anchor.htm @@ -2,8 +2,8 @@ {#advanced_dlg.anchor_title} - - + + diff --git a/wp-includes/js/tinymce/themes/advanced/charmap.htm b/wp-includes/js/tinymce/themes/advanced/charmap.htm index 42ceaa3a..2e98030a 100644 --- a/wp-includes/js/tinymce/themes/advanced/charmap.htm +++ b/wp-includes/js/tinymce/themes/advanced/charmap.htm @@ -3,8 +3,8 @@ {#advanced_dlg.charmap_title} - - + + diff --git a/wp-includes/js/tinymce/themes/advanced/color_picker.htm b/wp-includes/js/tinymce/themes/advanced/color_picker.htm index 5cdca6ea..5a56e214 100644 --- a/wp-includes/js/tinymce/themes/advanced/color_picker.htm +++ b/wp-includes/js/tinymce/themes/advanced/color_picker.htm @@ -2,9 +2,9 @@ {#advanced_dlg.colorpicker_title} - - - + + + @@ -21,7 +21,7 @@
      {#advanced_dlg.colorpicker_picker_title}
      -  +
      diff --git a/wp-includes/js/tinymce/themes/advanced/image.htm b/wp-includes/js/tinymce/themes/advanced/image.htm index 487227bc..1156b869 100644 --- a/wp-includes/js/tinymce/themes/advanced/image.htm +++ b/wp-includes/js/tinymce/themes/advanced/image.htm @@ -2,10 +2,10 @@ {#advanced_dlg.image_title} - - - - + + + + diff --git a/wp-includes/js/tinymce/themes/advanced/js/link.js b/wp-includes/js/tinymce/themes/advanced/js/link.js index f46137c5..73b9f597 100644 --- a/wp-includes/js/tinymce/themes/advanced/js/link.js +++ b/wp-includes/js/tinymce/themes/advanced/js/link.js @@ -63,8 +63,8 @@ var LinkDialog = { ed.dom.setAttribs(e, { href : f.href.value, title : f.linktitle.value, - target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, - 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null }); } }); @@ -72,8 +72,8 @@ var LinkDialog = { ed.dom.setAttribs(e, { href : f.href.value, title : f.linktitle.value, - target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, - 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null }); } diff --git a/wp-includes/js/tinymce/themes/advanced/link.htm b/wp-includes/js/tinymce/themes/advanced/link.htm index 09ba2a6f..b20fa08d 100644 --- a/wp-includes/js/tinymce/themes/advanced/link.htm +++ b/wp-includes/js/tinymce/themes/advanced/link.htm @@ -2,11 +2,11 @@ {#advanced_dlg.link_title} - - - - - + + + + + diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css index aee70e76..40dfd3e2 100644 --- a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css +++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css @@ -64,13 +64,6 @@ dl.aligncenter { margin: 0; } -img.wpGallery { - border: 1px dotted #cc0000; - background: #ffffcc url("../../../../plugins/wpgallery/img/gallery.png") no-repeat scroll center center; - width: 99%; - height: 250px; -} - body.mceContentBody { font: 13px/19px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; padding: 0.6em; diff --git a/wp-includes/js/tinymce/themes/advanced/source_editor.htm b/wp-includes/js/tinymce/themes/advanced/source_editor.htm index 41d7ed4b..1c4225d8 100644 --- a/wp-includes/js/tinymce/themes/advanced/source_editor.htm +++ b/wp-includes/js/tinymce/themes/advanced/source_editor.htm @@ -2,8 +2,8 @@ {#advanced_dlg.code_title} - - + + diff --git a/wp-includes/js/tinymce/tiny_mce.js b/wp-includes/js/tinymce/tiny_mce.js index 5e2fe090..73ad8b89 100644 --- a/wp-includes/js/tinymce/tiny_mce.js +++ b/wp-includes/js/tinymce/tiny_mce.js @@ -1 +1 @@ -var tinymce={majorVersion:"3",minorVersion:"2.4.1",releaseDate:"2009-05-25",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}g.push(f[c])}c=e.length-b;if(c<=0){return"/"+g.reverse().join("/")+d}return"/"+e.slice(0,c).join("/")+"/"+g.reverse().join("/")+d},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(c){var e=c.each,b=c.is;var d=c.isWebKit,a=c.isIE;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!c.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=c.extend({keep_values:false,hex_colors:1,process_html:1},g);if(c.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}c.addUnload(f.destroy,f)},getRoot:function(){var f=this,g=f.settings;return(g&&f.get(g.root_element))||f.doc.body},getViewPort:function(g){var h,f;g=!g?this.win:g;h=g.document;f=this.boxModel?h.documentElement:h.body;return{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop,w:g.innerWidth||f.clientWidth,h:g.innerHeight||f.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},is:function(g,f){return c.dom.Sizzle.matches(f,g.nodeType?[g]:g).length>0},getParent:function(i,h,g){return this.getParents(i,h,g,false)},getParents:function(p,k,i,m){var h=this,g,j=h.settings,l=[];p=h.get(p);m=m===undefined;if(j.strict_root){i=i||h.getRoot()}if(b(k,"string")){g=k;if(k==="*"){k=function(f){return f.nodeType==1}}else{k=function(f){return h.is(f,g)}}}while(p){if(p==i||!p.nodeType||p.nodeType===9){break}if(!k||k(p)){if(m){l.push(p)}else{return p}}p=p.parentNode}return m?l:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},select:function(h,g){var f=this;return c.dom.Sizzle(h,f.get(g)||f.get(f.settings.root_element)||f.doc,[])},add:function(j,l,f,i,k){var g=this;return this.run(j,function(n){var m,h;m=b(l,"string")?g.doc.createElement(l):l;g.setAttribs(m,f);if(i){if(i.nodeType){m.appendChild(i)}else{g.setHTML(m,i)}}return !k?n.appendChild(m):m})},create:function(i,f,g){return this.add(this.doc.createElement(i),i,f,g,1)},createHTML:function(m,f,j){var l="",i=this,g;l+="<"+m;for(g in f){if(f.hasOwnProperty(g)){l+=" "+g+'="'+i.encode(f[g])+'"'}}if(c.is(j)){return l+">"+j+""}return l+" />"},remove:function(h,f){var g=this;return this.run(h,function(m){var l,k,j;l=m.parentNode;if(!l){return null}if(f){for(j=m.childNodes.length-1;j>=0;j--){g.insertAfter(m.childNodes[j],m)}}if(g.fixPsuedoLeaks){l=m.cloneNode(true);f="IELeakGarbageBin";k=g.get(f)||g.add(g.doc.body,"div",{id:f,style:"display:none"});k.appendChild(m);k.innerHTML="";return l}return l.removeChild(m)})},setStyle:function(i,f,g){var h=this;return h.run(i,function(l){var k,j;k=l.style;f=f.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(h.pixelStyles.test(f)&&(c.is(g,"number")||/^[\-0-9\.]+$/.test(g))){g+="px"}switch(f){case"opacity":if(a){k.filter=g===""?"":"alpha(opacity="+(g*100)+")";if(!i.currentStyle||!i.currentStyle.hasLayout){k.display="inline-block"}}k[f]=k["-moz-opacity"]=k["-khtml-opacity"]=g||"";break;case"float":a?k.styleFloat=g:k.cssFloat=g;break;default:k[f]=g||""}if(h.settings.update_styles){h.setAttrib(l,"mce_style")}})},getStyle:function(i,f,h){i=this.get(i);if(!i){return false}if(this.doc.defaultView&&h){f=f.replace(/[A-Z]/g,function(j){return"-"+j});try{return this.doc.defaultView.getComputedStyle(i,null).getPropertyValue(f)}catch(g){return null}}f=f.replace(/-(\D)/g,function(k,j){return j.toUpperCase()});if(f=="float"){f=a?"styleFloat":"cssFloat"}if(i.currentStyle&&h){return i.currentStyle[f]}return i.style[f]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;e(j,function(k,l){g.setStyle(i,l,k)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){e(f,function(l,m){g.setStyle(k,m,l)});return}if(j.keep_values){if(f&&!g._isRes(f)){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){e(h,function(j,k){f.setAttrib(i,k,j)})})},getAttrib:function(i,j,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(j)){f=i.getAttribute("mce_"+j);if(f){return f}}if(a&&g.props[j]){f=i[g.props[j]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(j,2)}if(j==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(d&&j==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(j){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return j}return h;case"shape":f=f.toLowerCase();break;default:if(j.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(h){var i=this,j=i.settings,k={};if(!h){return k}function f(w,q,v){var o,u,m,n;o=k[w+"-top"+q];if(!o){return}u=k[w+"-right"+q];if(o!=u){return}m=k[w+"-bottom"+q];if(u!=m){return}n=k[w+"-left"+q];if(m!=n){return}k[v]=n;delete k[w+"-top"+q];delete k[w+"-right"+q];delete k[w+"-bottom"+q];delete k[w+"-left"+q]}function g(n,m,l,p){var o;o=k[m];if(!o){return}o=k[l];if(!o){return}o=k[p];if(!o){return}k[n]=k[m]+" "+k[l]+" "+k[p];delete k[m];delete k[l];delete k[p]}h=h.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");e(h.split(";"),function(m){var l,n=[];if(m){m=m.replace(/_MCE_SEMI_/g,";");m=m.replace(/url\([^\)]+\)/g,function(o){n.push(o);return"url("+n.length+")"});m=m.split(":");l=c.trim(m[1]);l=l.replace(/url\(([^\)]+)\)/g,function(p,o){return n[parseInt(o)-1]});l=l.replace(/rgb\([^\)]+\)/g,function(o){return i.toHex(o)});if(j.url_converter){l=l.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(o,p){return"url("+j.url_converter.call(j.url_converter_scope||i,i.decode(p),"style",null)+")"})}k[c.trim(m[0]).toLowerCase()]=l}});f("border","","border");f("border","-width","border-width");f("border","-color","border-color");f("border","-style","border-style");f("padding","","padding");f("margin","","margin");g("border","border-width","border-style","border-color");if(a){if(k.border=="medium none"){k.border=""}}return k},serializeStyle:function(g){var f="";e(g,function(i,h){if(h&&i){if(c.isGecko&&h.indexOf("-moz-")===0){return}switch(h){case"color":case"background-color":i=i.toLowerCase();break}f+=(f?" ":"")+h+": "+i+";"}});return f},loadCSS:function(f){var h=this,i=h.doc,g;if(!f){f=""}g=h.select("head")[0];e(f.split(","),function(j){var k;if(h.files[j]){return}h.files[j]=true;k=h.create("link",{rel:"stylesheet",href:c._addVer(j)});if(a&&i.documentMode){k.onload=function(){i.recalc();k.onload=null}}g.appendChild(k)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=c.trim(j!=" "?j:"")}return k.className})},hasClass:function(g,f){g=this.get(g);if(!g||!f){return false}return(" "+g.className+" ").indexOf(" "+f+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(f){return(!f?"mce_":f)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){try{m.innerHTML="
      "+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="
      "+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/

      <\/p>|]+)><\/p>|/gi,' 

      ')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/

      ]+)>|

      /g,'

      ');g=g.replace(/<\/p>/g,"
      ");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(p,n){var r;if(n!=="mce_tmp"){r=q.getAttribute(n);if(!r&&n==="class"){r=q.className}l.setAttribute(n,r)}});for(h=0;h|]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|]+)>/gi,"<$1i$2>")}else{if(a){j=j.replace(/'/g,"'");j=j.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}j=j.replace(/]+)\/>|/gi,"");if(i.keep_values){if(/)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/]+|)>([\s\S]*?)<\/script>/g,function(h,l,k){if(!l){l=' type="text/javascript"'}l=l.replace(/(type|language)=\"?/,"$&mce-");l=l.replace(/src=\"([^\"]+)\"?/,function(m,n){if(i.url_converter){n=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(n),"src","script"))}return'mce_src="'+n+'"'});if(c.trim(k)){k=""}return""+k+""});j=j.replace(/]+|)>([\s\S]*?)<\/style>/g,function(h,l,k){if(k){k=""}return""+k+""})}j=j.replace(//g,"");j=j.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,l){function k(o,n,q){var p=q;if(h.indexOf("mce_"+n)!=-1){return o}if(n=="style"){if(g._isRes(q)){return o}if(i.hex_colors){p=p.replace(/rgb\([^\)]+\)/g,function(m){return g.toHex(m)})}if(i.url_converter){p=p.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(m,r){return"url("+g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(r),n,l))+")"})}}else{if(n!="coords"&&n!="shape"){if(i.url_converter){p=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(q),n,l))}}}return" "+n+'="'+q+'" mce_'+n+'="'+p+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,k);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,k);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,k)})}return j},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(i,g,j){var f=this;return this.run(i,function(h){var l,k;h=f.get(h);j=j||h.ownerDocument||f.doc;if(a&&h.nodeType==1){h.outerHTML=g}else{k=j.createElement("body");k.innerHTML=g;l=k.lastChild;while(l){f.insertAfter(l.cloneNode(true),h);l=l.previousSibling}f.remove(h)}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(f){return f?(""+f).replace(/[<>&\"]/g,function(h,g){switch(h){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return h}):f},insertAfter:function(h,g){var f=this;g=f.get(g);return this.run(h,function(k){var j,i;j=g.parentNode;i=g.nextSibling;if(i){j.insertBefore(k,i)}else{j.appendChild(k)}return k})},isBlock:function(f){if(f.nodeType&&f.nodeType!==1){return false}f=f.nodeName||f;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(f)},replace:function(i,h,f){var g=this;if(b(h,"array")){i=i.cloneNode(true)}return g.run(h,function(j){if(f){e(j.childNodes,function(k){i.appendChild(k.cloneNode(true))})}if(g.fixPsuedoLeaks&&j.nodeType===1){j.parentNode.insertBefore(i,j);g.remove(j);return i}return j.parentNode.replaceChild(i,j)})},findCommonAncestor:function(h,f){var i=h,g;while(i){g=f;while(g&&i!=g){g=g.parentNode}if(i==g){break}i=i.parentNode}if(!i&&h.ownerDocument){return h.ownerDocument.documentElement}return i},toHex:function(f){var h=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(f);function g(i){i=parseInt(i).toString(16);return i.length>1?i:"0"+i}if(h){f="#"+g(h[1])+g(h[2])+g(h[3]);return f}return f},getClasses:function(){var l=this,g=[],k,m={},n=l.settings.class_filter,j;if(l.classes){return l.classes}function o(f){e(f.imports,function(i){o(i)});e(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){e(i.selectorText.split(","),function(p){p=p.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(p)||!/\.[\w\-]+$/.test(p)){return}j=p;p=p.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(n&&!(p=n(p,j))){return}if(!m[p]){g.push({"class":p});m[p]=1}})}break;case 3:o(i.styleSheet);break}})}try{e(l.doc.styleSheets,o)}catch(h){}if(g.length>0){l.classes=g}return g},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];e(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(g){var f;g=this.get(g);if(!g){return[]}if(a){f=[];if(g.nodeName=="OBJECT"){return g.attributes}g.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(i,h){f.push({specified:1,nodeName:h})});return f}return g.attributes},destroy:function(g){var f=this;if(f.events){f.events.destroy()}f.win=f.doc=f.root=f.events=null;if(!g){c.removeUnload(f.destroy)}},createRng:function(){var f=this.doc;return f.createRange?f.createRange():new c.dom.Range(this)},split:function(l,k,o){var p=this,f=p.createRng(),m,j,n;function g(r,q){r=r[q];if(r&&r[q]&&r[q].nodeType==1&&i(r[q])){p.remove(r[q])}}function i(q){q=p.getOuterHTML(q);q=q.replace(/<(img|hr|table)/gi,"-");q=q.replace(/<[^>]+>/g,"");return q.replace(/[ \t\r\n]+| | /g,"")==""}function h(r){var q=0;while(r.previousSibling){q++;r=r.previousSibling}return q}if(l&&k){f.setStart(l.parentNode,h(l));f.setEnd(k.parentNode,h(k));m=f.extractContents();f=p.createRng();f.setStart(k.parentNode,h(k)+1);f.setEnd(l.parentNode,h(l)+1);j=f.extractContents();n=l.parentNode;g(m,"lastChild");if(!i(m)){n.insertBefore(m,l)}if(o){n.replaceChild(o,k)}else{n.insertBefore(k,l)}g(j,"firstChild");if(!i(j)){n.insertBefore(j,l)}p.remove(l);return o||k}},bind:function(j,f,i,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.add(j,f,i,h||this)},unbind:function(i,f,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.remove(i,f,h)},_isRes:function(f){return/^(top|left|bottom|right|width|height)/i.test(f)||/;\s*(top|left|bottom|right|width|height)/i.test(f)}});c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

      ";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="
      ";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k_';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x=="simple"){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>||<\/html>||]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",bool_attrs:/(checked|disabled|readonly|selected|nowrap)/,valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(
      \s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^
      \s*<\//.test(n)){return""}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t]*>)(.*?)(<\/script>)/g},{pattern:/(]*>)(.*?)(<\/style>)/g},{pattern:/(]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/()/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/

      \s+<\/p>|]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?" 

      ":" 

      ");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(//g,"");j=j.replace(/(type|language)=\"mce-/g,'$1="');if(k.entity_encoding=="raw"){j=j.replace(/

       <\/p>|]+)> <\/p>/g,"\u00a0

      ")}}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+""+p}))});return j},_unprotect:function(i,j){i=i.replace(/\"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,""))}}if(b.stdMode){e+='
      "}else{e+=""}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,""))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,""));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},""+e+"")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);if(document.domain&&j.hostname!=document.domain){f.relaxedDomain=document.domain}i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.language){k.add(f.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!c.urls[q.theme]){c.load(q.theme,"themes/"+q.theme+"/editor_template"+f.suffix+".js")}if(q.plugins){l=d(q.plugins);if(f.inArray(l,"compat2x")!=-1){b.load("compat2x","plugins/compat2x/editor_plugin"+f.suffix+".js")}g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}b.load(r,"plugins/"+r+"/editor_plugin"+f.suffix+".js")}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir';F.iframeHTML+='';if(n.relaxedDomain){F.iframeHTML+=' +handlers[$priority][$id] = array( + 'regex' => $regex, + 'callback' => $callback, + ); + } + + /** + * Unregister a previously registered embed handler. Do not use this function directly, use {@link wp_embed_unregister_handler()} instead. + * + * @param string $id The handler ID that should be removed. + * @param int $priority Optional. The priority of the handler to be removed (default: 10). + */ + function unregister_handler( $id, $priority = 10 ) { + if ( isset($this->handlers[$priority][$id]) ) + unset($this->handlers[$priority][$id]); + } + + /** + * The {@link do_shortcode()} callback function. + * + * Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of the registered embed handlers. + * If none of the regex matches and it's enabled, then the URL will be given to the {@link WP_oEmbed} class. + * + * @uses wp_oembed_get() + * @uses wp_parse_args() + * @uses wp_embed_defaults() + * @uses WP_Embed::maybe_make_link() + * @uses get_option() + * @uses current_user_can() + * @uses wp_cache_get() + * @uses wp_cache_set() + * @uses get_post_meta() + * @uses update_post_meta() + * + * @param array $attr Shortcode attributes. + * @param string $url The URL attempting to be embeded. + * @return string The embed HTML on success, otherwise the original URL. + */ + function shortcode( $attr, $url = '' ) { + global $post; + + if ( empty($url) ) + return ''; + + $rawattr = $attr; + $attr = wp_parse_args( $attr, wp_embed_defaults() ); + + // Look for known internal handlers + ksort( $this->handlers ); + foreach ( $this->handlers as $priority => $handlers ) { + foreach ( $handlers as $id => $handler ) { + if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) { + if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) ) + return apply_filters( 'embed_handler_html', $return, $url, $attr ); + } + } + } + + $post_ID = ( !empty($post->ID) ) ? $post->ID : null; + if ( !empty($this->post_ID) ) // Potentially set by WP_Embed::cache_oembed() + $post_ID = $this->post_ID; + + // Unknown URL format. Let oEmbed have a go. + if ( $post_ID ) { + + // Check for a cached result (stored in the post meta) + $cachekey = '_oembed_' . md5( $url . serialize( $attr ) ); + if ( $this->usecache ) { + $cache = get_post_meta( $post_ID, $cachekey, true ); + + // Failures are cached + if ( '{{unknown}}' === $cache ) + return $this->maybe_make_link( $url ); + + if ( !empty($cache) ) + return apply_filters( 'embed_oembed_html', $cache, $url, $attr ); + } + + // Use oEmbed to get the HTML + $attr['discover'] = ( apply_filters('embed_oembed_discover', false) && author_can( $post_ID, 'unfiltered_html' ) ) ? true : false; + $html = wp_oembed_get( $url, $attr ); + + // Cache the result + $cache = ( $html ) ? $html : '{{unknown}}'; + update_post_meta( $post_ID, $cachekey, $cache ); + + // If there was a result, return it + if ( $html ) + return apply_filters( 'embed_oembed_html', $html, $url, $attr ); + } + + // Still unknown + return $this->maybe_make_link( $url ); + } + + /** + * Delete all oEmbed caches. + * + * @param int $post_ID Post ID to delete the caches for. + */ + function delete_oembed_caches( $post_ID ) { + $post_metas = get_post_custom_keys( $post_ID ); + if ( empty($post_metas) ) + return; + + foreach( $post_metas as $post_meta_key ) { + if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) ) + delete_post_meta( $post_ID, $post_meta_key ); + } + } + + /** + * Triggers a caching of all oEmbed results. + * + * @param int $post_ID Post ID to do the caching for. + */ + function cache_oembed( $post_ID ) { + $post = get_post( $post_ID ); + + if ( empty($post->ID) || !in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', array( 'post', 'page' ) ) ) ) + return; + + // Trigger a caching + if ( !empty($post->post_content) ) { + $this->post_ID = $post->ID; + $this->usecache = false; + + $content = $this->run_shortcode( $post->post_content ); + if ( get_option('embed_autourls') ) + $this->autoembed( $content ); + + $this->usecache = true; + } + } + + /** + * Passes any unlinked URLs that are on their own line to {@link WP_Embed::shortcode()} for potential embedding. + * + * @uses WP_Embed::autoembed_callback() + * + * @param string $content The content to be searched. + * @return string Potentially modified $content. + */ + function autoembed( $content ) { + return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array(&$this, 'autoembed_callback'), $content ); + } + + /** + * Callback function for {@link WP_Embed::autoembed()}. + * + * @uses WP_Embed::shortcode() + * + * @param array $match A regex match array. + * @return string The embed HTML on success, otherwise the original URL. + */ + function autoembed_callback( $match ) { + $oldval = $this->linkifunknown; + $this->linkifunknown = false; + $return = $this->shortcode( array(), $match[1] ); + $this->linkifunknown = $oldval; + + return "\n$return\n"; + } + + /** + * Conditionally makes a hyperlink based on an internal class variable. + * + * @param string $url URL to potentially be linked. + * @return string Linked URL or the original URL. + */ + function maybe_make_link( $url ) { + $output = ( $this->linkifunknown ) ? '' . esc_html($url) . '' : $url; + return apply_filters( 'embed_maybe_make_link', $output, $url ); + } +} +$wp_embed = new WP_Embed(); + +/** + * Register an embed handler. This function should probably only be used for sites that do not support oEmbed. + * + * @since 2.9.0 + * @see WP_Embed::register_handler() + */ +function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) { + global $wp_embed; + $wp_embed->register_handler( $id, $regex, $callback, $priority ); +} + +/** + * Unregister a previously registered embed handler. + * + * @since 2.9.0 + * @see WP_Embed::unregister_handler() + */ +function wp_embed_unregister_handler( $id, $priority = 10 ) { + global $wp_embed; + $wp_embed->unregister_handler( $id, $priority ); +} + +/** + * Create default array of embed parameters. + * + * @since 2.9.0 + * + * @return array Default embed parameters. + */ +function wp_embed_defaults() { + if ( !empty($GLOBALS['content_width']) ) + $theme_width = (int) $GLOBALS['content_width']; + + $width = get_option('embed_size_w'); + + if ( !$width && !empty($theme_width) ) + $width = $theme_width; + + if ( !$width ) + $width = 500; + + return apply_filters( 'embed_defaults', array( + 'width' => $width, + 'height' => 700, + ) ); +} + +/** + * Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height. + * + * @since 2.9.0 + * @uses wp_constrain_dimensions() This function passes the widths and the heights. + * + * @param int $example_width The width of an example embed. + * @param int $example_height The height of an example embed. + * @param int $max_width The maximum allowed width. + * @param int $max_height The maximum allowed height. + * @return array The maximum possible width and height based on the example ratio. + */ +function wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height ) { + $example_width = (int) $example_width; + $example_height = (int) $example_height; + $max_width = (int) $max_width; + $max_height = (int) $max_height; + + return wp_constrain_dimensions( $example_width * 1000000, $example_height * 1000000, $max_width, $max_height ); +} + +/** + * Attempts to fetch the embed HTML for a provided URL using oEmbed. + * + * @since 2.9.0 + * @see WP_oEmbed + * + * @uses _wp_oembed_get_object() + * @uses WP_oEmbed::get_html() + * + * @param string $url The URL that should be embeded. + * @param array $args Addtional arguments and parameters. + * @return string The original URL on failure or the embed HTML on success. + */ +function wp_oembed_get( $url, $args = '' ) { + require_once( 'class-oembed.php' ); + $oembed = _wp_oembed_get_object(); + return $oembed->get_html( $url, $args ); +} + +/** + * Adds a URL format and oEmbed provider URL pair. + * + * @since 2.9.0 + * @see WP_oEmbed + * + * @uses _wp_oembed_get_object() + * + * @param string $format The format of URL that this provider can handle. You can use asterisks as wildcards. + * @param string $provider The URL to the oEmbed provider. + * @param boolean $regex Whether the $format parameter is in a regex format or not. + */ +function wp_oembed_add_provider( $format, $provider, $regex = false ) { + require_once( 'class-oembed.php' ); + $oembed = _wp_oembed_get_object(); + $oembed->providers[$format] = array( $provider, $regex ); +} diff --git a/wp-includes/meta.php b/wp-includes/meta.php new file mode 100644 index 00000000..ad6690ee --- /dev/null +++ b/wp-includes/meta.php @@ -0,0 +1,223 @@ +get_var( $wpdb->prepare( + "SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d", + $meta_key, $object_id ) ) ) + return false; + + $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); + + $wpdb->insert( $table, array( + $column => $object_id, + 'meta_key' => $meta_key, + 'meta_value' => $meta_value + ) ); + + wp_cache_delete($object_id, $meta_type . '_meta'); + + do_action( "added_{$meta_type}_meta", $wpdb->insert_id, $object_id, $meta_key, $meta_value ); + + return true; +} + +function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '') { + if ( !$meta_type || !$meta_key ) + return false; + + if ( ! $table = _get_meta_table($meta_type) ) + return false; + + global $wpdb; + + $column = esc_sql($meta_type . '_id'); + + // expected_slashed ($meta_key) + $meta_key = stripslashes($meta_key); + + if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) ) + return add_metadata($meta_type, $object_id, $meta_key, $meta_value); + + $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); + + $data = compact( 'meta_value' ); + $where = array( $column => $object_id, 'meta_key' => $meta_key ); + + if ( !empty( $prev_value ) ) { + $prev_value = maybe_serialize($prev_value); + $where['meta_value'] = $prev_value; + } + + do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $meta_value ); + + $wpdb->update( $table, $data, $where ); + wp_cache_delete($object_id, $meta_type . '_meta'); + + do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $meta_value ); + + return true; +} + +function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = false) { + if ( !$meta_type || !$meta_key || (!$delete_all && ! (int)$object_id) ) + return false; + + if ( ! $table = _get_meta_table($meta_type) ) + return false; + + global $wpdb; + + $type_column = esc_sql($meta_type . '_id'); + // expected_slashed ($meta_key) + $meta_key = stripslashes($meta_key); + $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); + + $query = $wpdb->prepare( "SELECT meta_id FROM $table WHERE meta_key = %s", $meta_key ); + + if ( !$delete_all ) + $query .= $wpdb->prepare(" AND $type_column = %d", $object_id ); + + if ( $meta_value ) + $query .= $wpdb->prepare(" AND meta_value = %s", $meta_value ); + + $meta_ids = $wpdb->get_col( $query ); + if ( !count( $meta_ids ) ) + return false; + + $query = "DELETE FROM $table WHERE meta_id IN( " . implode( ',', $meta_ids ) . " )"; + + $count = $wpdb->query($query); + + if ( !$count ) + return false; + + wp_cache_delete($object_id, $meta_type . '_meta'); + + do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $meta_value ); + + return true; +} + +function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) { + if ( !$meta_type ) + return false; + + $meta_cache = wp_cache_get($object_id, $meta_type . '_meta'); + + if ( !$meta_cache ) { + update_meta_cache($meta_type, $object_id); + $meta_cache = wp_cache_get($object_id, $meta_type . '_meta'); + } + + if ( ! $meta_key ) + return $meta_cache; + + if ( isset($meta_cache[$meta_key]) ) { + if ( $single ) { + return maybe_unserialize( $meta_cache[$meta_key][0] ); + } else { + return array_map('maybe_unserialize', $meta_cache[$meta_key]); + } + } + + if ($single) + return ''; + else + return array(); +} + +function update_meta_cache($meta_type, $object_ids) { + if ( empty( $meta_type ) || empty( $object_ids ) ) + return false; + + if ( ! $table = _get_meta_table($meta_type) ) + return false; + + $column = esc_sql($meta_type . '_id'); + + global $wpdb; + + if ( !is_array($object_ids) ) { + $object_ids = preg_replace('|[^0-9,]|', '', $object_ids); + $object_ids = explode(',', $object_ids); + } + + $object_ids = array_map('intval', $object_ids); + + $cache_key = $meta_type . '_meta'; + $ids = array(); + foreach ( $object_ids as $id ) { + if ( false === wp_cache_get($id, $cache_key) ) + $ids[] = $id; + } + + if ( empty( $ids ) ) + return false; + + // Get meta info + $id_list = join(',', $ids); + $cache = array(); + $meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list)", + $meta_type), ARRAY_A ); + + if ( !empty($meta_list) ) { + foreach ( $meta_list as $metarow) { + $mpid = intval($metarow[$column]); + $mkey = $metarow['meta_key']; + $mval = $metarow['meta_value']; + + // Force subkeys to be array type: + if ( !isset($cache[$mpid]) || !is_array($cache[$mpid]) ) + $cache[$mpid] = array(); + if ( !isset($cache[$mpid][$mkey]) || !is_array($cache[$mpid][$mkey]) ) + $cache[$mpid][$mkey] = array(); + + // Add a value to the current pid/key: + $cache[$mpid][$mkey][] = $mval; + } + } + + foreach ( $ids as $id ) { + if ( ! isset($cache[$id]) ) + $cache[$id] = array(); + } + + foreach ( array_keys($cache) as $object) + wp_cache_set($object, $cache[$object], $cache_key); + + return $cache; +} + +function _get_meta_table($type) { + global $wpdb; + + $table_name = $type . 'meta'; + + if ( empty($wpdb->$table_name) ) + return false; + + return $wpdb->$table_name; +} +?> diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 128d2dca..0946f8f2 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -99,7 +99,7 @@ function get_currentuserinfo() { return; if ( ! $user = wp_validate_auth_cookie() ) { - if ( empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) { + if ( is_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) { wp_set_current_user(0); return false; } @@ -539,6 +539,9 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') { return false; } + if ( $expiration < time() ) // AJAX/POST grace period set above + $GLOBALS['login_grace_period'] = 1; + do_action('auth_cookie_valid', $cookie_elements, $user); return $user->ID; @@ -750,7 +753,7 @@ function auth_redirect() { } } - if ( $user_id = wp_validate_auth_cookie() ) { + if ( $user_id = wp_validate_auth_cookie( '', apply_filters( 'auth_redirect_scheme', '' ) ) ) { do_action('auth_redirect', $user_id); // If the user wants ssl but the session is not ssl, redirect. @@ -821,7 +824,7 @@ function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) { if ( $query_arg ) $nonce = $_REQUEST[$query_arg]; else - $nonce = $_REQUEST['_ajax_nonce'] ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce']; + $nonce = isset($_REQUEST['_ajax_nonce']) ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce']; $result = wp_verify_nonce( $nonce, $action ); @@ -862,7 +865,7 @@ function wp_redirect($location, $status = 302) { } else { if ( php_sapi_name() != 'cgi-fcgi' ) status_header($status); // This causes problems on IIS and some FastCGI setups - header("Location: $location"); + header("Location: $location", true, $status); } } endif; @@ -973,8 +976,10 @@ function wp_notify_postauthor($comment_id, $comment_type='') { if ('' == $user->user_email) return false; // If there's no email to send the comment to $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); - - $blogname = get_option('blogname'); + + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); if ( empty( $comment_type ) ) $comment_type = 'comment'; @@ -998,7 +1003,7 @@ function wp_notify_postauthor($comment_id, $comment_type='') { $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n"; - /* translators: 1: blog name, 2: post title */ + /* translators: 1: blog name, 2: post title */ $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title ); } elseif ('pingback' == $comment_type) { /* translators: 1: post id, 2: post title */ @@ -1012,8 +1017,11 @@ function wp_notify_postauthor($comment_id, $comment_type='') { $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title ); } $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; - $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n"; - $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n"; + if ( EMPTY_TRASH_DAYS ) + $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n"; + else + $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n"; + $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n"; $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); @@ -1064,7 +1072,11 @@ function wp_notify_moderator($comment_id) { $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'"); - + + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + switch ($comment->comment_type) { case 'trackback': @@ -1092,15 +1104,18 @@ function wp_notify_moderator($comment_id) { break; } - $notify_message .= sprintf( __('Approve it: %s'), admin_url("comment.php?action=mac&c=$comment_id") ) . "\r\n"; - $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n"; - $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n"; + $notify_message .= sprintf( __('Approve it: %s'), admin_url("comment.php?action=approve&c=$comment_id") ) . "\r\n"; + if ( EMPTY_TRASH_DAYS ) + $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n"; + else + $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n"; + $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n"; $notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:', 'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n"; $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n"; - $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title ); + $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title ); $admin_email = get_option('admin_email'); $message_headers = ''; @@ -1127,7 +1142,10 @@ function wp_password_change_notification(&$user) { // but check to see if it's the admin whose password we're changing, and skip this if ( $user->user_email != get_option('admin_email') ) { $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; - wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message); + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), $blogname), $message); } } endif; @@ -1146,12 +1164,16 @@ function wp_new_user_notification($user_id, $plaintext_pass = '') { $user_login = stripslashes($user->user_login); $user_email = stripslashes($user->user_email); + + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); - $message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n"; + $message = sprintf(__('New user registration on your blog %s:'), $blogname) . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n"; - @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message); + @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message); if ( empty($plaintext_pass) ) return; @@ -1160,7 +1182,7 @@ function wp_new_user_notification($user_id, $plaintext_pass = '') { $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n"; $message .= wp_login_url() . "\r\n"; - wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message); + wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message); } endif; @@ -1767,4 +1789,3 @@ function wp_text_diff( $left_string, $right_string, $args = null ) { } endif; -?> diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index a1c7fcf7..29134ac4 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -675,24 +675,30 @@ function _wp_filter_build_unique_id($tag, $function, $priority) { global $wp_filter; static $filter_id_count = 0; - // If function then just skip all of the tests and not overwrite the following. - if ( is_string($function) ) + if ( is_string($function) ) { return $function; - // Object Class Calling - else if (is_object($function[0]) ) { - $obj_idx = get_class($function[0]).$function[1]; - if ( !isset($function[0]->wp_filter_id) ) { - if ( false === $priority ) - return false; - $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : 0; - $function[0]->wp_filter_id = $filter_id_count++; - } else - $obj_idx .= $function[0]->wp_filter_id; - return $obj_idx; - } - // Static Calling - else if ( is_string($function[0]) ) + } else if (is_object($function[0]) ) { + // Object Class Calling + if ( function_exists('spl_object_hash') ) { + return spl_object_hash($function[0]) . $function[1]; + } else { + $obj_idx = get_class($function[0]).$function[1]; + if ( !isset($function[0]->wp_filter_id) ) { + if ( false === $priority ) + return false; + $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : $filter_id_count; + $function[0]->wp_filter_id = $filter_id_count; + ++$filter_id_count; + } else { + $obj_idx .= $function[0]->wp_filter_id; + } + + return $obj_idx; + } + } else if ( is_string($function[0]) ) { + // Static Calling return $function[0].$function[1]; + } } ?> diff --git a/wp-includes/pomo/entry.php b/wp-includes/pomo/entry.php index feb5b34c..eb58f89d 100644 --- a/wp-includes/pomo/entry.php +++ b/wp-includes/pomo/entry.php @@ -2,12 +2,12 @@ /** * Contains Translation_Entry class * - * @version $Id: entry.php 115 2009-05-11 18:56:15Z nbachiyski $ + * @version $Id: entry.php 222 2009-09-07 21:14:23Z nbachiyski $ * @package pomo * @subpackage entry */ - +if ( !class_exists( 'Translation_Entry' ) ): /** * Translation_Entry class encapsulates a translatable string */ @@ -67,4 +67,4 @@ class Translation_Entry { return is_null($this->context)? $this->singular : $this->context.chr(4).$this->singular; } } -?> +endif; \ No newline at end of file diff --git a/wp-includes/pomo/mo.php b/wp-includes/pomo/mo.php index 0630ef28..9b2ac1d0 100644 --- a/wp-includes/pomo/mo.php +++ b/wp-includes/pomo/mo.php @@ -2,7 +2,7 @@ /** * Class for working with MO files * - * @version $Id: mo.php 106 2009-04-23 19:48:22Z nbachiyski $ + * @version $Id: mo.php 293 2009-11-12 15:43:50Z nbachiyski $ * @package pomo * @subpackage mo */ @@ -10,6 +10,7 @@ require_once dirname(__FILE__) . '/translations.php'; require_once dirname(__FILE__) . '/streams.php'; +if ( !class_exists( 'MO' ) ): class MO extends Gettext_Translations { var $_nplurals = 2; @@ -20,10 +21,9 @@ class MO extends Gettext_Translations { * @param string $filename MO file to load */ function import_from_file($filename) { - $reader = new POMO_CachedIntFileReader($filename); - if (isset($reader->error)) { + $reader = new POMO_FileReader($filename); + if (!$reader->is_resource()) return false; - } return $this->import_from_reader($reader); } @@ -95,15 +95,13 @@ class MO extends Gettext_Translations { } function get_byteorder($magic) { - // The magic is 0x950412de // bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565 $magic_little = (int) - 1794895138; $magic_little_64 = (int) 2500072158; // 0xde120495 - $magic_big = ((int) - 569244523) && 0xFFFFFFFF; - + $magic_big = ((int) - 569244523) & 0xFFFFFFFF; if ($magic_little == $magic || $magic_little_64 == $magic) { return 'little'; } else if ($magic_big == $magic) { @@ -114,61 +112,111 @@ class MO extends Gettext_Translations { } function import_from_reader($reader) { - $reader->setEndian('little'); - $endian = MO::get_byteorder($reader->readint32()); - if (false === $endian) { + $endian_string = MO::get_byteorder($reader->readint32()); + if (false === $endian_string) { return false; } - $reader->setEndian($endian); + $reader->setEndian($endian_string); + + $endian = ('big' == $endian_string)? 'N' : 'V'; + + $header = $reader->read(24); + if ($reader->strlen($header) != 24) + return false; + + // parse header + $header = unpack("{$endian}revision/{$endian}total/{$endian}originals_lenghts_addr/{$endian}translations_lenghts_addr/{$endian}hash_length/{$endian}hash_addr", $header); + if (!is_array($header)) + return false; + + extract( $header ); - $revision = $reader->readint32(); - $total = $reader->readint32(); - // get addresses of array of lenghts and offsets for original string and translations - $originals_lenghts_addr = $reader->readint32(); - $translations_lenghts_addr = $reader->readint32(); + // support revision 0 of MO format specs, only + if ($revision != 0) + return false; + // seek to data blocks $reader->seekto($originals_lenghts_addr); - $originals_lenghts = $reader->readint32array($total * 2); // each of - $reader->seekto($translations_lenghts_addr); - $translations_lenghts = $reader->readint32array($total * 2); - - $length = create_function('$i', 'return $i * 2 + 1;'); - $offset = create_function('$i', 'return $i * 2 + 2;'); - - for ($i = 0; $i < $total; ++$i) { - $reader->seekto($originals_lenghts[$offset($i)]); - $original = $reader->read($originals_lenghts[$length($i)]); - $reader->seekto($translations_lenghts[$offset($i)]); - $translation = $reader->read($translations_lenghts[$length($i)]); - if ('' == $original) { + + // read originals' indices + $originals_lengths_length = $translations_lenghts_addr - $originals_lenghts_addr; + if ( $originals_lengths_length != $total * 8 ) + return false; + + $originals = $reader->read($originals_lengths_length); + if ( $reader->strlen( $originals ) != $originals_lengths_length ) + return false; + + // read translations' indices + $translations_lenghts_length = $hash_addr - $translations_lenghts_addr; + if ( $translations_lenghts_length != $total * 8 ) + return false; + + $translations = $reader->read($translations_lenghts_length); + if ( $reader->strlen( $translations ) != $translations_lenghts_length ) + return false; + + // transform raw data into set of indices + $originals = $reader->str_split( $originals, 8 ); + $translations = $reader->str_split( $translations, 8 ); + + // skip hash table + $strings_addr = $hash_addr + $hash_length * 4; + + $reader->seekto($strings_addr); + + $strings = $reader->read_all(); + $reader->close(); + + for ( $i = 0; $i < $total; $i++ ) { + $o = unpack( "{$endian}length/{$endian}pos", $originals[$i] ); + $t = unpack( "{$endian}length/{$endian}pos", $translations[$i] ); + if ( !$o || !$t ) return false; + + // adjust offset due to reading strings to separate space before + $o['pos'] -= $strings_addr; + $t['pos'] -= $strings_addr; + + $original = $reader->substr( $strings, $o['pos'], $o['length'] ); + $translation = $reader->substr( $strings, $t['pos'], $t['length'] ); + + if ('' === $original) { $this->set_headers($this->make_headers($translation)); } else { - $this->add_entry($this->make_entry($original, $translation)); + $entry = &$this->make_entry($original, $translation); + $this->entries[$entry->key()] = &$entry; } } return true; } /** + * Build a Translation_Entry from original string and translation strings, + * found in a MO file + * * @static + * @param string $original original string to translate from MO file. Might contain + * 0x04 as context separator or 0x00 as singular/plural separator + * @param string $translation translation string from MO file. Might contain + * 0x00 as a plural translations separator */ function &make_entry($original, $translation) { - $args = array(); + $entry = & new Translation_Entry(); // look for context $parts = explode(chr(4), $original); if (isset($parts[1])) { $original = $parts[1]; - $args['context'] = $parts[0]; + $entry->context = $parts[0]; } // look for plural original $parts = explode(chr(0), $original); - $args['singular'] = $parts[0]; + $entry->singular = $parts[0]; if (isset($parts[1])) { - $args['plural'] = $parts[1]; + $entry->is_plural = true; + $entry->plural = $parts[1]; } // plural translations are also separated by \0 - $args['translations'] = explode(chr(0), $translation); - $entry = & new Translation_Entry($args); + $entry->translations = explode(chr(0), $translation); return $entry; } @@ -179,7 +227,5 @@ class MO extends Gettext_Translations { function get_plural_forms_count() { return $this->_nplurals; } - - } -?> +endif; \ No newline at end of file diff --git a/wp-includes/pomo/po.php b/wp-includes/pomo/po.php index 6c40c5a4..fb0d8e40 100644 --- a/wp-includes/pomo/po.php +++ b/wp-includes/pomo/po.php @@ -2,7 +2,7 @@ /** * Class for working with PO files * - * @version $Id: po.php 123 2009-05-13 19:35:43Z nbachiyski $ + * @version $Id: po.php 283 2009-09-23 16:21:51Z nbachiyski $ * @package pomo * @subpackage po */ @@ -16,6 +16,7 @@ ini_set('auto_detect_line_endings', 1); /** * Routines for working with PO files */ +if ( !class_exists( 'PO' ) ): class PO extends Gettext_Translations { @@ -316,7 +317,9 @@ class PO extends Gettext_Translations { return false; } } - if (array() == array_filter($entry->translations)) $entry->translations = array(); + if (array() == array_filter($entry->translations, create_function('$t', 'return $t || "0" === $t;'))) { + $entry->translations = array(); + } return array('entry' => $entry, 'lineno' => $lineno); } @@ -357,4 +360,4 @@ class PO extends Gettext_Translations { return $s; } } -?> +endif; \ No newline at end of file diff --git a/wp-includes/pomo/streams.php b/wp-includes/pomo/streams.php index 6710746e..341fee45 100644 --- a/wp-includes/pomo/streams.php +++ b/wp-includes/pomo/streams.php @@ -3,65 +3,186 @@ * Classes, which help reading streams of data from files. * Based on the classes from Danilo Segan * - * @version $Id: streams.php 138 2009-06-23 13:22:09Z nbachiyski $ + * @version $Id: streams.php 293 2009-11-12 15:43:50Z nbachiyski $ * @package pomo * @subpackage streams */ - -/** - * Provides file-like methods for manipulating a string instead - * of a physical file. - */ -class POMO_StringReader { - var $_pos; - var $_str; - - function POMO_StringReader($str = '') { - $this->_str = $str; - $this->_pos = 0; +if ( !class_exists( 'POMO_Reader' ) ): +class POMO_Reader { + + var $endian = 'little'; + var $_post = ''; + + function POMO_Reader() { $this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); + $this->_pos = 0; + } + + /** + * Sets the endianness of the file. + * + * @param $endian string 'big' or 'little' + */ + function setEndian($endian) { + $this->endian = $endian; + } + + /** + * Reads a 32bit Integer from the Stream + * + * @return mixed The integer, corresponding to the next 32 bits from + * the stream of false if there are not enough bytes or on error + */ + function readint32() { + $bytes = $this->read(4); + if (4 != $this->strlen($bytes)) + return false; + $endian_letter = ('big' == $this->endian)? 'N' : 'V'; + $int = unpack($endian_letter, $bytes); + return array_shift($int); } - function _substr($string, $start, $length) { + /** + * Reads an array of 32-bit Integers from the Stream + * + * @param integer count How many elements should be read + * @return mixed Array of integers or false if there isn't + * enough data or on error + */ + function readint32array($count) { + $bytes = $this->read(4 * $count); + if (4*$count != $this->strlen($bytes)) + return false; + $endian_letter = ('big' == $this->endian)? 'N' : 'V'; + return unpack($endian_letter.$count, $bytes); + } + + + function substr($string, $start, $length) { if ($this->is_overloaded) { - return mb_substr($string,$start,$length,'ascii'); + return mb_substr($string, $start, $length, 'ascii'); } else { - return substr($string,$start,$length); + return substr($string, $start, $length); } } - function _strlen($string) { + function strlen($string) { if ($this->is_overloaded) { - return mb_strlen($string,'ascii'); + return mb_strlen($string, 'ascii'); } else { return strlen($string); } } + + function str_split($string, $chunk_size) { + if (!function_exists('str_split')) { + $length = $this->strlen($string); + $out = array(); + for ($i = 0; $i < $length; $i += $chunk_size) + $out[] = $this->substr($string, $i, $chunk_size); + return $out; + } else { + return str_split( $string, $chunk_size ); + } + } + + + function pos() { + return $this->_pos; + } + + function is_resource() { + return true; + } + + function close() { + return true; + } +} +endif; + +if ( !class_exists( 'POMO_FileReader' ) ): +class POMO_FileReader extends POMO_Reader { + function POMO_FileReader($filename) { + parent::POMO_Reader(); + $this->_f = fopen($filename, 'r'); + } + + function read($bytes) { + return fread($this->_f, $bytes); + } + + function seekto($pos) { + if ( -1 == fseek($this->_f, $pos, SEEK_SET)) { + return false; + } + $this->_pos = $pos; + return true; + } + + function is_resource() { + return is_resource($this->_f); + } + + function feof() { + return feof($this->_f); + } + + function close() { + return fclose($this->_f); + } + + function read_all() { + $all = ''; + while ( !$this->feof() ) + $all .= $this->read(4096); + return $all; + } +} +endif; + +if ( !class_exists( 'POMO_StringReader' ) ): +/** + * Provides file-like methods for manipulating a string instead + * of a physical file. + */ +class POMO_StringReader extends POMO_Reader { + + var $_str = ''; + + function POMO_StringReader($str = '') { + parent::POMO_Reader(); + $this->_str = $str; + $this->_pos = 0; + } + function read($bytes) { - $data = $this->_substr($this->_str, $this->_pos, $bytes); + $data = $this->substr($this->_str, $this->_pos, $bytes); $this->_pos += $bytes; - if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str); + if ($this->strlen($this->_str) < $this->_pos) $this->_pos = $this->strlen($this->_str); return $data; } function seekto($pos) { $this->_pos = $pos; - if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str); - return $this->_pos; - } - - function pos() { + if ($this->strlen($this->_str) < $this->_pos) $this->_pos = $this->strlen($this->_str); return $this->_pos; } function length() { - return $this->_strlen($this->_str); + return $this->strlen($this->_str); } + function read_all() { + return $this->substr($this->_str, $this->_pos, $this->strlen($this->_str)); + } + } +endif; +if ( !class_exists( 'POMO_CachedFileReader' ) ): /** * Reads the contents of the file in the beginning. */ @@ -74,64 +195,15 @@ class POMO_CachedFileReader extends POMO_StringReader { $this->_pos = 0; } } +endif; +if ( !class_exists( 'POMO_CachedIntFileReader' ) ): /** - * Allows reading integers from a file. + * Reads the contents of the file in the beginning. */ class POMO_CachedIntFileReader extends POMO_CachedFileReader { - - var $endian = 'little'; - - /** - * Opens a file and caches it. - * - * @param $filename string name of the file to be opened - * @param $endian string endianness of the words in the file, allowed - * values are 'little' or 'big'. Default value is 'little' - */ - function POMO_CachedIntFileReader($filename, $endian = 'little') { - $this->endian = $endian; + function POMO_CachedIntFileReader($filename) { parent::POMO_CachedFileReader($filename); } - - /** - * Sets the endianness of the file. - * - * @param $endian string 'big' or 'little' - */ - function setEndian($endian) { - $this->endian = $endian; - } - - /** - * Reads a 32bit Integer from the Stream - * - * @return mixed The integer, corresponding to the next 32 bits from - * the stream of false if there are not enough bytes or on error - */ - function readint32() { - $bytes = $this->read(4); - if (4 != $this->_strlen($bytes)) - return false; - $endian_letter = ('big' == $this->endian)? 'N' : 'V'; - $int = unpack($endian_letter, $bytes); - return array_shift($int); - } - - /** - * Reads an array of 32-bit Integers from the Stream - * - * @param integer count How many elements should be read - * @return mixed Array of integers or false if there isn't - * enough data or on error - */ - function readint32array($count) { - $bytes = $this->read(4 * $count); - if (4*$count != $this->_strlen($bytes)) - return false; - $endian_letter = ('big' == $this->endian)? 'N' : 'V'; - return unpack($endian_letter.$count, $bytes); - } } - -?> +endif; \ No newline at end of file diff --git a/wp-includes/pomo/translations.php b/wp-includes/pomo/translations.php index a05ae6ce..11f9b845 100644 --- a/wp-includes/pomo/translations.php +++ b/wp-includes/pomo/translations.php @@ -2,13 +2,14 @@ /** * Class for a set of entries for translation and their associated headers * - * @version $Id: translations.php 114 2009-05-11 17:30:38Z nbachiyski $ + * @version $Id: translations.php 291 2009-10-21 05:46:08Z nbachiyski $ * @package pomo * @subpackage translations */ require_once dirname(__FILE__) . '/entry.php'; +if ( !class_exists( 'Translations' ) ): class Translations { var $entries = array(); var $headers = array(); @@ -25,7 +26,7 @@ class Translations { } $key = $entry->key(); if (false === $key) return false; - $this->entries[$key] = $entry; + $this->entries[$key] = &$entry; return true; } @@ -117,29 +118,33 @@ class Gettext_Translations extends Translations { */ function gettext_select_plural_form($count) { if (!isset($this->_gettext_select_plural_form) || is_null($this->_gettext_select_plural_form)) { - $plural_header = $this->get_header('Plural-Forms'); - $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($plural_header); + list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms')); + $this->_nplurals = $nplurals; + $this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression); } return call_user_func($this->_gettext_select_plural_form, $count); } + + function nplurals_and_expression_from_header($header) { + if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches)) { + $nplurals = (int)$matches[1]; + $expression = trim($this->parenthesize_plural_exression($matches[2])); + return array($nplurals, $expression); + } else { + return array(2, 'n != 1'); + } + } /** * Makes a function, which will return the right translation index, according to the * plural forms header */ - function _make_gettext_select_plural_form($plural_header) { - $res = create_function('$count', 'return 1 == $count? 0 : 1;'); - if ($plural_header && (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $plural_header, $matches))) { - $nplurals = (int)$matches[1]; - $this->_nplurals = $nplurals; - $plural_expr = trim($this->_parenthesize_plural_exression($matches[2])); - $plural_expr = str_replace('n', '$n', $plural_expr); - $func_body = " - \$index = (int)($plural_expr); - return (\$index < $nplurals)? \$index : $nplurals - 1;"; - $res = create_function('$n', $func_body); - } - return $res; + function make_plural_form_function($nplurals, $expression) { + $expression = str_replace('n', '$n', $expression); + $func_body = " + \$index = (int)($expression); + return (\$index < $nplurals)? \$index : $nplurals - 1;"; + return create_function('$n', $func_body); } /** @@ -149,7 +154,7 @@ class Gettext_Translations extends Translations { * @param string $expression the expression without parentheses * @return string the expression with parentheses added */ - function _parenthesize_plural_exression($expression) { + function parenthesize_plural_exression($expression) { $expression .= ';'; $res = ''; $depth = 0; @@ -186,14 +191,61 @@ class Gettext_Translations extends Translations { } return $headers; } - + function set_header($header, $value) { parent::set_header($header, $value); - if ('Plural-Forms' == $header) - $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($value); + if ('Plural-Forms' == $header) { + list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms')); + $this->_nplurals = $nplurals; + $this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression); + } } +} +endif; +if ( !class_exists( 'NOOP_Translations' ) ): +/** + * Provides the same interface as Translations, but doesn't do anything + */ +class NOOP_Translations { + var $entries = array(); + var $headers = array(); -} + function add_entry($entry) { + return true; + } + + function set_header($header, $value) { + } -?> + function set_headers(&$headers) { + } + + function get_header($header) { + return false; + } + + function translate_entry(&$entry) { + return false; + } + + function translate($singular, $context=null) { + return $singular; + } + + function select_plural_form($count) { + return 1 == $count? 0 : 1; + } + + function get_plural_forms_count() { + return 2; + } + + function translate_plural($singular, $plural, $count, $context = null) { + return 1 == $count? $singular : $plural; + } + + function merge_with(&$other) { + } +} +endif; diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index c473bdcc..9b6efcda 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -160,10 +160,9 @@ function get_the_guid( $id = 0 ) { * * @param string $more_link_text Optional. Content for when there is more text. * @param string $stripteaser Optional. Teaser content before the more text. - * @param string $more_file Optional. Not used. */ -function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { - $content = get_the_content($more_link_text, $stripteaser, $more_file); +function the_content($more_link_text = null, $stripteaser = 0) { + $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; @@ -176,10 +175,9 @@ function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') * * @param string $more_link_text Optional. Content for when there is more text. * @param string $stripteaser Optional. Teaser content before the more text. - * @param string $more_file Optional. Not used. * @return string */ -function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { +function get_the_content($more_link_text = null, $stripteaser = 0) { global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; if ( null === $more_link_text ) @@ -194,11 +192,6 @@ function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = return $output; } - if ( $more_file != '' ) - $file = $more_file; - else - $file = $pagenow; //$_SERVER['PHP_SELF']; - if ( $page > count($pages) ) // if the requested page doesn't exist $page = count($pages); // give them the highest numbered page that DOES exist @@ -254,7 +247,6 @@ function the_excerpt() { */ function get_the_excerpt($deprecated = '') { global $post; - $output = ''; $output = $post->post_excerpt; if ( post_password_required($post) ) { $output = __('There is no excerpt because this is a protected post.'); @@ -312,6 +304,9 @@ function get_post_class( $class = '', $post_id = null ) { $classes = array(); + if ( empty($post) ) + return $classes; + $classes[] = 'post-' . $post->ID; $classes[] = $post->post_type; @@ -409,7 +404,7 @@ function get_body_class( $class = '' ) { if ( is_author() ) { $author = $wp_query->get_queried_object(); $classes[] = 'author'; - $classes[] = 'author-' . sanitize_html_class($author->user_nicename , $author->user_id); + $classes[] = 'author-' . sanitize_html_class($author->user_nicename , $author->ID); } elseif ( is_category() ) { $cat = $wp_query->get_queried_object(); $classes[] = 'category'; @@ -549,8 +544,6 @@ function sticky_class( $post_id = null ) { * each bookmarks. * 'after' - Default is '

      ' (string). The html or text to append to each * bookmarks. - * 'more_file' - Default is '' (string) Page the links should point to. Defaults - * to the current page. * 'link_before' - Default is '' (string). The html or text to prepend to each * Pages link inside the tag. * 'link_after' - Default is '' (string). The html or text to append to each @@ -568,17 +561,13 @@ function wp_link_pages($args = '') { 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), 'previouspagelink' => __('Previous page'), 'pagelink' => '%', - 'more_file' => '', 'echo' => 1 + 'echo' => 1 ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); global $post, $page, $numpages, $multipage, $more, $pagenow; - if ( $more_file != '' ) - $file = $more_file; - else - $file = $pagenow; $output = ''; if ( $multipage ) { @@ -745,7 +734,7 @@ function wp_list_pages($args = '') { 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title', - 'link_before' => '', 'link_after' => '' + 'link_before' => '', 'link_after' => '', 'walker' => '', ); $r = wp_parse_args( $args, $defaults ); @@ -757,8 +746,9 @@ function wp_list_pages($args = '') { // sanitize, mostly to keep spaces out $r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']); - // Allow plugins to filter an array of excluded pages - $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude']))); + // Allow plugins to filter an array of excluded pages (but don't put a nullstring into the array) + $exclude_array = ( $r['exclude'] ) ? explode(',', $r['exclude']) : array(); + $r['exclude'] = implode( ',', apply_filters('wp_list_pages_excludes', $exclude_array) ); // Query pages. $r['hierarchical'] = 0; @@ -777,7 +767,7 @@ function wp_list_pages($args = '') { $output .= ''; } - $output = apply_filters('wp_list_pages', $output); + $output = apply_filters('wp_list_pages', $output, $r); if ( $r['echo'] ) echo $output; @@ -828,7 +818,7 @@ function wp_page_menu( $args = array() ) { $class = ''; if ( is_front_page() && !is_paged() ) $class = 'class="current_page_item"'; - $menu .= '
    1. ' . $args['link_before'] . $text . $args['link_after'] . '
    2. '; + $menu .= '
    3. ' . $args['link_before'] . $text . $args['link_after'] . '
    4. '; // If the front page is a page, add it to the exclude list if (get_option('show_on_front') == 'page') { if ( !empty( $list_args['exclude'] ) ) { diff --git a/wp-includes/post-thumbnail-template.php b/wp-includes/post-thumbnail-template.php new file mode 100644 index 00000000..5f590405 --- /dev/null +++ b/wp-includes/post-thumbnail-template.php @@ -0,0 +1,76 @@ + \ No newline at end of file diff --git a/wp-includes/post.php b/wp-includes/post.php index 7ae5431b..f0427c16 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -7,6 +7,21 @@ * @since 1.5.0 */ +// +// Post Type Registration +// + +/** + * Creates the initial post types when 'init' action is fired. + */ +function create_initial_post_types() { + register_post_type( 'post', array('exclude_from_search' => false) ); + register_post_type( 'page', array('exclude_from_search' => false) ); + register_post_type( 'attachment', array('exclude_from_search' => false) ); + register_post_type( 'revision', array('exclude_from_search' => true) ); +} +add_action( 'init', 'create_initial_post_types', 0 ); // highest priority + /** * Retrieve attached file path based on attachment ID. * @@ -53,16 +68,33 @@ function update_attached_file( $attachment_id, $file ) { return false; $file = apply_filters( 'update_attached_file', $file, $attachment_id ); + $file = _wp_relative_upload_path($file); + + return update_post_meta( $attachment_id, '_wp_attached_file', $file ); +} + +/** + * Return relative path to an uploaded file. + * + * The path is relative to the current upload dir. + * + * @since 2.9 + * @uses apply_filters() Calls '_wp_relative_upload_path' on file path. + * + * @param string $path Full path to the file + * @return string relative path on success, unchanged path on failure. + */ +function _wp_relative_upload_path( $path ) { + $new_path = $path; - // Make the file path relative to the upload dir - if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { // Get upload directory - if ( 0 === strpos($file, $uploads['basedir']) ) {// Check that the upload base exists in the file path - $file = str_replace($uploads['basedir'], '', $file); // Remove upload dir from the file path - $file = ltrim($file, '/'); + if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { + if ( 0 === strpos($new_path, $uploads['basedir']) ) { + $new_path = str_replace($uploads['basedir'], '', $new_path); + $new_path = ltrim($new_path, '/'); } } - return update_post_meta( $attachment_id, '_wp_attached_file', $file ); + return apply_filters( '_wp_relative_upload_path', $new_path, $path ); } /** @@ -114,11 +146,12 @@ function update_attached_file( $attachment_id, $file ) { * @return array|bool False on failure and the type will be determined by $output parameter. */ function &get_children($args = '', $output = OBJECT) { + $kids = array(); if ( empty( $args ) ) { if ( isset( $GLOBALS['post'] ) ) { $args = array('post_parent' => (int) $GLOBALS['post']->post_parent ); } else { - return false; + return $kids; } } elseif ( is_object( $args ) ) { $args = array('post_parent' => (int) $args->post_parent ); @@ -134,10 +167,9 @@ function &get_children($args = '', $output = OBJECT) { $r = wp_parse_args( $args, $defaults ); $children = get_posts( $r ); - if ( !$children ) { - $kids = false; + + if ( !$children ) return $kids; - } update_post_cache($children); @@ -217,8 +249,8 @@ function &get_post(&$post, $output = OBJECT, $filter = 'raw') { return $null; } elseif ( is_object($post) && empty($post->filter) ) { _get_post_ancestors($post); - wp_cache_add($post->ID, $post, 'posts'); - $_post = &$post; + $_post = sanitize_post($post, 'raw'); + wp_cache_add($post->ID, $_post, 'posts'); } else { if ( is_object($post) ) $post = $post->ID; @@ -228,11 +260,13 @@ function &get_post(&$post, $output = OBJECT, $filter = 'raw') { if ( ! $_post ) return $null; _get_post_ancestors($_post); + $_post = sanitize_post($_post, 'raw'); wp_cache_add($_post->ID, $_post, 'posts'); } } - $_post = sanitize_post($_post, $filter); + if ($filter != 'raw') + $_post = sanitize_post($_post, $filter); if ( $output == OBJECT ) { return $_post; @@ -407,6 +441,80 @@ function get_post_type($post = false) { return false; } +/** + * Get a list of all registered post type objects. + * + * @package WordPress + * @subpackage Post + * @since 2.9.0 + * @uses $wp_post_types + * @see register_post_type + * @see get_post_types + * + * @param array|string $args An array of key => value arguments to match against the post types. + * Only post types having attributes that match all arguments are returned. + * @param string $output The type of output to return, either post type 'names' or 'objects'. 'names' is the default. + * @return array A list of post type names or objects + */ +function get_post_types( $args = array(), $output = 'names' ) { + global $wp_post_types; + + $do_names = false; + if ( 'names' == $output ) + $do_names = true; + + $post_types = array(); + foreach ( (array) $wp_post_types as $post_type ) { + if ( empty($args) ) { + if ( $do_names ) + $post_types[] = $post_type->name; + else + $post_types[] = $post_type; + } elseif ( array_intersect_assoc((array) $post_type, $args) ) { + if ( $do_names ) + $post_types[] = $post_type->name; + else + $post_types[] = $post_type; + } + } + + return $post_types; +} + +/** + * Register a post type. Do not use before init. + * + * A simple function for creating or modifying a post type based on the + * parameters given. The function will accept an array (second optional + * parameter), along with a string for the post type name. + * + * + * Optional $args contents: + * + * exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true. + * + * @package WordPress + * @subpackage Post + * @since 2.9.0 + * @uses $wp_post_types Inserts new post type object into the list + * + * @param string $post_type Name of the post type. + * @param array|string $args See above description. + */ +function register_post_type($post_type, $args = array()) { + global $wp_post_types; + + if (!is_array($wp_post_types)) + $wp_post_types = array(); + + $defaults = array('exclude_from_search' => true); + $args = wp_parse_args($args, $defaults); + + $post_type = sanitize_user($post_type, true); + $args['name'] = $post_type; + $wp_post_types[$post_type] = (object) $args; +} + /** * Updates the post type for the post ID. * @@ -511,28 +619,11 @@ function get_posts($args = null) { * @return bool False for failure. True for success. */ function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { - if ( !$meta_key ) - return false; - - global $wpdb; - // make sure meta is added to the post, not a revision if ( $the_post = wp_is_post_revision($post_id) ) $post_id = $the_post; - // expected_slashed ($meta_key) - $meta_key = stripslashes($meta_key); - - if ( $unique && $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) - return false; - - $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); - - $wpdb->insert( $wpdb->postmeta, compact( 'post_id', 'meta_key', 'meta_value' ) ); - - wp_cache_delete($post_id, 'post_meta'); - - return true; + return add_metadata('post', $post_id, $meta_key, $meta_value, $unique); } /** @@ -552,35 +643,11 @@ function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { * @return bool False for failure. True for success. */ function delete_post_meta($post_id, $meta_key, $meta_value = '') { - global $wpdb; - // make sure meta is added to the post, not a revision if ( $the_post = wp_is_post_revision($post_id) ) $post_id = $the_post; - // expected_slashed ($meta_key, $meta_value) - $meta_key = stripslashes( $meta_key ); - $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); - - if ( !$meta_key ) - return false; - - if ( empty( $meta_value ) ) - $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) ); - else - $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $meta_key, $meta_value ) ); - - if ( !$meta_id ) - return false; - - if ( empty( $meta_value ) ) - $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) ); - else - $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $meta_key, $meta_value ) ); - - wp_cache_delete($post_id, 'post_meta'); - - return true; + return delete_metadata('post', $post_id, $meta_key, $meta_value); } /** @@ -597,27 +664,7 @@ function delete_post_meta($post_id, $meta_key, $meta_value = '') { * is true. */ function get_post_meta($post_id, $key, $single = false) { - if ( !$key ) - return ''; - - $post_id = (int) $post_id; - - $meta_cache = wp_cache_get($post_id, 'post_meta'); - - if ( !$meta_cache ) { - update_postmeta_cache($post_id); - $meta_cache = wp_cache_get($post_id, 'post_meta'); - } - - if ( isset($meta_cache[$key]) ) { - if ( $single ) { - return maybe_unserialize( $meta_cache[$key][0] ); - } else { - return array_map('maybe_unserialize', $meta_cache[$key]); - } - } - - return ''; + return get_metadata('post', $post_id, $key, $single); } /** @@ -639,35 +686,11 @@ function get_post_meta($post_id, $key, $single = false) { * @return bool False on failure, true if success. */ function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') { - global $wpdb; - // make sure meta is added to the post, not a revision if ( $the_post = wp_is_post_revision($post_id) ) $post_id = $the_post; - // expected_slashed ($meta_key) - $meta_key = stripslashes($meta_key); - - if ( !$meta_key ) - return false; - - if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) { - return add_post_meta($post_id, $meta_key, $meta_value); - } - - $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); - - $data = compact( 'meta_value' ); - $where = compact( 'meta_key', 'post_id' ); - - if ( !empty( $prev_value ) ) { - $prev_value = maybe_serialize($prev_value); - $where['meta_value'] = $prev_value; - } - - $wpdb->update( $wpdb->postmeta, $data, $where ); - wp_cache_delete($post_id, 'post_meta'); - return true; + return update_metadata('post', $post_id, $meta_key, $meta_value, $prev_value); } /** @@ -686,7 +709,11 @@ function delete_post_meta_by_key($post_meta_key) { global $wpdb; $post_ids = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key)); if ( $post_ids ) { - $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key)); + $postmetaids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key ) ); + $in = implode( ',', array_fill(1, count($postmetaids), '%d')); + do_action( 'delete_postmeta', $postmetaids ); + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id IN($in)", $postmetaids )); + do_action( 'deleted_postmeta', $postmetaids ); foreach ( $post_ids as $post_id ) wp_cache_delete($post_id, 'post_meta'); return true; @@ -810,12 +837,18 @@ function is_sticky($post_id = null) { */ function sanitize_post($post, $context = 'display') { if ( is_object($post) ) { + // Check if post already filtered for this context + if ( isset($post->filter) && $context == $post->filter ) + return $post; if ( !isset($post->ID) ) $post->ID = 0; foreach ( array_keys(get_object_vars($post)) as $field ) $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); $post->filter = $context; } else { + // Check if post already filtered for this context + if ( isset($post['filter']) && $context == $post['filter'] ) + return $post; if ( !isset($post['ID']) ) $post['ID'] = 0; foreach ( array_keys($post) as $field ) @@ -998,7 +1031,7 @@ function wp_count_posts( $type = 'post', $perm = '' ) { $count = $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A ); - $stats = array( 'publish' => 0, 'private' => 0, 'draft' => 0, 'pending' => 0, 'future' => 0 ); + $stats = array( 'publish' => 0, 'private' => 0, 'draft' => 0, 'pending' => 0, 'future' => 0, 'trash' => 0 ); foreach( (array) $count as $row_num => $row ) { $stats[$row['post_status']] = $row['num_posts']; } @@ -1027,12 +1060,13 @@ function wp_count_attachments( $mime_type = '' ) { global $wpdb; $and = wp_post_mime_type_where( $mime_type ); - $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' $and GROUP BY post_mime_type", ARRAY_A ); + $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A ); $stats = array( ); foreach( (array) $count as $row ) { $stats[$row['post_mime_type']] = $row['num_posts']; } + $stats['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and"); return (object) $stats; } @@ -1132,21 +1166,27 @@ function wp_post_mime_type_where($post_mime_types) { * @uses wp_delete_attachment() if post type is 'attachment'. * * @param int $postid Post ID. + * @param bool $force_delete Whether to bypass trash and force deletion * @return mixed False on failure */ -function wp_delete_post($postid = 0) { +function wp_delete_post( $postid = 0, $force_delete = false ) { global $wpdb, $wp_rewrite; if ( !$post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) ) return $post; - if ( 'attachment' == $post->post_type ) - return wp_delete_attachment($postid); + if ( !$force_delete && ( $post->post_type == 'post' || $post->post_type == 'page') && get_post_status( $postid ) != 'trash' && EMPTY_TRASH_DAYS > 0 ) + return wp_trash_post($postid); + + if ( $post->post_type == 'attachment' ) + return wp_delete_attachment( $postid, $force_delete ); do_action('delete_post', $postid); - /** @todo delete for pluggable post taxonomies too */ - wp_delete_object_term_relationships($postid, array('category', 'post_tag')); + delete_post_meta($postid,'_wp_trash_meta_status'); + delete_post_meta($postid,'_wp_trash_meta_time'); + + wp_delete_object_term_relationships($postid, get_object_taxonomies($post->post_type)); $parent_data = array( 'post_parent' => $post->post_parent ); $parent_where = array( 'post_parent' => $postid ); @@ -1180,11 +1220,25 @@ function wp_delete_post($postid = 0) { // Point all attachments to this post up one level $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) ); - $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_post_ID = %d", $postid )); + $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $postid )); + if ( ! empty($comment_ids) ) { + do_action( 'delete_comment', $comment_ids ); + $in_comment_ids = "'" . implode("', '", $comment_ids) . "'"; + $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_ID IN($in_comment_ids)" ); + do_action( 'deleted_comment', $comment_ids ); + } - $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d", $postid )); + $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $postid )); + if ( !empty($post_meta_ids) ) { + do_action( 'delete_postmeta', $post_meta_ids ); + $in_post_meta_ids = "'" . implode("', '", $post_meta_ids) . "'"; + $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id IN($in_post_meta_ids)" ); + do_action( 'deleted_postmeta', $post_meta_ids ); + } + do_action( 'delete_post', $postid ); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $postid )); + do_action( 'deleted_post', $postid ); if ( 'page' == $post->post_type ) { clean_page_cache($postid); @@ -1204,6 +1258,163 @@ function wp_delete_post($postid = 0) { return $post; } +/** + * Moves a post or page to the Trash + * + * @since 2.9.0 + * @uses do_action() on 'trash_post' before trashing + * @uses do_action() on 'trashed_post' after trashing + * + * @param int $postid Post ID. + * @return mixed False on failure + */ +function wp_trash_post($post_id = 0) { + if ( EMPTY_TRASH_DAYS == 0 ) + return wp_delete_post($post_id); + + if ( !$post = wp_get_single_post($post_id, ARRAY_A) ) + return $post; + + if ( $post['post_status'] == 'trash' ) + return false; + + do_action('trash_post', $post_id); + + add_post_meta($post_id,'_wp_trash_meta_status', $post['post_status']); + add_post_meta($post_id,'_wp_trash_meta_time', time()); + + $post['post_status'] = 'trash'; + wp_insert_post($post); + + wp_trash_post_comments($post_id); + + do_action('trashed_post', $post_id); + + return $post; +} + +/** + * Restores a post or page from the Trash + * + * @since 2.9.0 + * @uses do_action() on 'untrash_post' before undeletion + * @uses do_action() on 'untrashed_post' after undeletion + * + * @param int $postid Post ID. + * @return mixed False on failure + */ +function wp_untrash_post($post_id = 0) { + if ( !$post = wp_get_single_post($post_id, ARRAY_A) ) + return $post; + + if ( $post['post_status'] != 'trash' ) + return false; + + do_action('untrash_post', $post_id); + + $post_status = get_post_meta($post_id, '_wp_trash_meta_status', true); + + $post['post_status'] = $post_status; + + delete_post_meta($post_id, '_wp_trash_meta_status'); + delete_post_meta($post_id, '_wp_trash_meta_time'); + + wp_insert_post($post); + + wp_untrash_post_comments($post_id); + + do_action('untrashed_post', $post_id); + + return $post; +} + +/** + * Moves comments for a post to the trash + * + * @since 2.9.0 + * @uses do_action() on 'trash_post_comments' before trashing + * @uses do_action() on 'trashed_post_comments' after trashing + * + * @param int $post Post ID or object. + * @return mixed False on failure + */ +function wp_trash_post_comments($post = null) { + global $wpdb; + + $post = get_post($post); + if ( empty($post) ) + return; + + $post_id = $post->ID; + + do_action('trash_post_comments', $post_id); + + $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id) ); + if ( empty($comments) ) + return; + + // Cache current status for each comment + $statuses = array(); + foreach ( $comments as $comment ) + $statuses[$comment->comment_ID] = $comment->comment_approved; + add_post_meta($post_id, '_wp_trash_meta_comments_status', $statuses); + + // Set status for all comments to post-trashed + $result = $wpdb->update($wpdb->comments, array('comment_approved' => 'post-trashed'), array('comment_post_ID' => $post_id)); + + clean_comment_cache( array_keys($statuses) ); + + do_action('trashed_post_comments', $post_id, $statuses); + + return $result; +} + +/** + * Restore comments for a post from the trash + * + * @since 2.9.0 + * @uses do_action() on 'untrash_post_comments' before trashing + * @uses do_action() on 'untrashed_post_comments' after trashing + * + * @param int $post Post ID or object. + * @return mixed False on failure + */ +function wp_untrash_post_comments($post = null) { + global $wpdb; + + $post = get_post($post); + if ( empty($post) ) + return; + + $post_id = $post->ID; + + $statuses = get_post_meta($post_id, '_wp_trash_meta_comments_status', true); + + if ( empty($statuses) ) + return true; + + do_action('untrash_post_comments', $post_id); + + // Restore each comment to its original status + $group_by_status = array(); + foreach ( $statuses as $comment_id => $comment_status ) + $group_by_status[$comment_status][] = $comment_id; + + foreach ( $group_by_status as $status => $comments ) { + // Sanity check. This shouldn't happen. + if ( 'post-trashed' == $status ) + $status = '0'; + $comments_in = implode( "', '", $comments ); + $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" ); + } + + clean_comment_cache( array_keys($statuses) ); + + delete_post_meta($post_id, '_wp_trash_meta_comments_status'); + + do_action('untrashed_post_comments', $post_id); +} + /** * Retrieve the list of categories for a post. * @@ -1292,12 +1503,12 @@ function wp_get_recent_posts($num = 10) { // Set the limit clause, if we got a limit $num = (int) $num; - if ($num) { + if ( $num ) { $limit = "LIMIT $num"; } - $sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC $limit"; - $result = $wpdb->get_results($sql,ARRAY_A); + $sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status IN ( 'draft', 'publish', 'future', 'pending', 'private' ) ORDER BY post_date DESC $limit"; + $result = $wpdb->get_results($sql, ARRAY_A); return $result ? $result : array(); } @@ -1398,7 +1609,7 @@ function wp_insert_post($postarr = array(), $wp_error = false) { $previous_status = 'new'; } - if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) ) { + if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) && ('attachment' != $post_type) ) { if ( $wp_error ) return new WP_Error('empty_content', __('Content, title, and excerpt are empty.')); else @@ -1729,6 +1940,8 @@ function check_and_publish_future_post($post_id) { /** * Given the desired slug and some post details computes a unique slug for the post. * + * @global wpdb $wpdb + * @global WP_Rewrite $wp_rewrite * @param string $slug the desired slug (post_name) * @param integer $post_ID * @param string $post_status no uniqueness checks are made if the post is still draft or pending @@ -1739,15 +1952,20 @@ function check_and_publish_future_post($post_id) { function wp_unique_post_slug($slug, $post_ID, $post_status, $post_type, $post_parent) { if ( in_array( $post_status, array( 'draft', 'pending' ) ) ) return $slug; - + global $wpdb, $wp_rewrite; + + $feeds = $wp_rewrite->feeds; + if ( !is_array($feeds) ) + $feeds = array(); + $hierarchical_post_types = apply_filters('hierarchical_post_types', array('page')); if ( 'attachment' == $post_type ) { // Attachment slugs must be unique across all types. $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1"; $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID)); - - if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) { + + if ( $post_name_check || in_array($slug, $feeds) ) { $suffix = 2; do { $alt_post_name = substr($slug, 0, 200-(strlen($suffix)+1)). "-$suffix"; @@ -1759,10 +1977,10 @@ function wp_unique_post_slug($slug, $post_ID, $post_status, $post_type, $post_pa } elseif ( in_array($post_type, $hierarchical_post_types) ) { // Page slugs must be unique within their own trees. Pages are in a // separate namespace than posts so page slugs are allowed to overlap post slugs. - $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", $wpdb->escape($hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1"; + $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", esc_sql($hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1"; $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID, $post_parent)); - - if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) { + + if ( $post_name_check || in_array($slug, $feeds) ) { $suffix = 2; do { $alt_post_name = substr($slug, 0, 200-(strlen($suffix)+1)). "-$suffix"; @@ -1775,7 +1993,7 @@ function wp_unique_post_slug($slug, $post_ID, $post_status, $post_type, $post_pa // Post slugs must be unique across all posts. $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1"; $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_type, $post_ID)); - + if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) { $suffix = 2; do { @@ -2061,8 +2279,8 @@ function get_all_page_ids() { */ function &get_page(&$page, $output = OBJECT, $filter = 'raw') { if ( empty($page) ) { - if ( isset( $GLOBALS['page'] ) && isset( $GLOBALS['page']->ID ) ) { - return get_post($GLOBALS['page'], $output, $filter); + if ( isset( $GLOBALS['post'] ) && isset( $GLOBALS['post']->ID ) ) { + return get_post($GLOBALS['post'], $output, $filter); } else { $page = null; return $page; @@ -2162,24 +2380,50 @@ function &get_page_children($page_id, $pages) { /** * Order the pages with children under parents in a flat list. * + * It uses auxiliary structure to hold parent-children relationships and + * runs in O(N) complexity + * * @since 2.0.0 * * @param array $posts Posts array. * @param int $parent Parent page ID. * @return array A list arranged by hierarchy. Children immediately follow their parents. */ -function get_page_hierarchy($posts, $parent = 0) { - $result = array ( ); - if ($posts) { foreach ( (array) $posts as $post) { - if ($post->post_parent == $parent) { - $result[$post->ID] = $post->post_name; - $children = get_page_hierarchy($posts, $post->ID); - $result += $children; //append $children to $result - } - } } +function &get_page_hierarchy( &$pages, $page_id = 0 ) { + + if ( empty( $pages ) ) + return null; + + $children = array(); + foreach ( (array) $pages as $p ) { + + $parent_id = intval( $p->post_parent ); + $children[ $parent_id ][] = $p; + } + + $result = array(); + _page_traverse_name( $page_id, $children, $result ); + return $result; } +/** + * function to traverse and return all the nested children post names of a root page. + * $children contains parent-chilren relations + * + */ +function _page_traverse_name( $page_id, &$children, &$result ){ + + if ( isset( $children[ $page_id ] ) ){ + + foreach( (array)$children[ $page_id ] as $child ) { + + $result[ $child->ID ] = $child->post_name; + _page_traverse_name( $child->ID, $children, $result ); + } + } +} + /** * Builds URI for a page. * @@ -2342,6 +2586,12 @@ function &get_pages($args = '') { return $pages; } + // Sanitize before caching so it'll only get done once + $num_pages = count($pages); + for ($i = 0; $i < $num_pages; $i++) { + $pages[$i] = sanitize_post($pages[$i], 'raw'); + } + // Update cache. update_page_cache($pages); @@ -2349,16 +2599,14 @@ function &get_pages($args = '') { $pages = & get_page_children($child_of, $pages); if ( !empty($exclude_tree) ) { - $exclude = array(); - $exclude = (int) $exclude_tree; $children = get_page_children($exclude, $pages); $excludes = array(); foreach ( $children as $child ) $excludes[] = $child->ID; $excludes[] = $exclude; - $total = count($pages); - for ( $i = 0; $i < $total; $i++ ) { + $num_pages = count($pages); + for ( $i = 0; $i < $num_pages; $i++ ) { if ( in_array($pages[$i]->ID, $excludes) ) unset($pages[$i]); } @@ -2555,6 +2803,9 @@ function wp_insert_attachment($object, $file = false, $parent = 0) { clean_post_cache($post_ID); + if ( isset($post_parent) && $post_parent < 0 ) + add_post_meta($post_ID, '_wp_attachment_temp_parent', $post_parent, true); + if ( $update) { do_action('edit_attachment', $post_ID); } else { @@ -2576,48 +2827,80 @@ function wp_insert_attachment($object, $file = false, $parent = 0) { * @uses do_action() Calls 'delete_attachment' hook on Attachment ID. * * @param int $postid Attachment ID. + * @param bool $force_delete Whether to bypass trash and force deletion * @return mixed False on failure. Post data on success. */ -function wp_delete_attachment($postid) { +function wp_delete_attachment( $post_id, $force_delete = false ) { global $wpdb; - if ( !$post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) ) + if ( !$post = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id) ) ) return $post; if ( 'attachment' != $post->post_type ) return false; - $meta = wp_get_attachment_metadata( $postid ); - $file = get_attached_file( $postid ); + if ( !$force_delete && EMPTY_TRASH_DAYS && MEDIA_TRASH && 'trash' != $post->post_status ) + return wp_trash_post( $post_id ); - do_action('delete_attachment', $postid); + delete_post_meta($post_id, '_wp_trash_meta_status'); + delete_post_meta($post_id, '_wp_trash_meta_time'); - /** @todo Delete for pluggable post taxonomies too */ - wp_delete_object_term_relationships($postid, array('category', 'post_tag')); + $meta = wp_get_attachment_metadata( $post_id ); + $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true ); + $file = get_attached_file( $post_id ); - $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_post_ID = %d", $postid )); + do_action('delete_attachment', $post_id); - $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d ", $postid )); + wp_delete_object_term_relationships($post_id, array('category', 'post_tag')); + wp_delete_object_term_relationships($post_id, get_object_taxonomies($post->post_type)); - $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $postid )); + $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND meta_value = %d", $post_id )); - $uploadPath = wp_upload_dir(); + $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id )); + if ( ! empty($comment_ids) ) { + do_action( 'delete_comment', $comment_ids ); + $in_comment_ids = "'" . implode("', '", $comment_ids) . "'"; + $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_ID IN($in_comment_ids)" ); + do_action( 'deleted_comment', $comment_ids ); + } + + $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id )); + if ( !empty($post_meta_ids) ) { + do_action( 'delete_postmeta', $post_meta_ids ); + $in_post_meta_ids = "'" . implode("', '", $post_meta_ids) . "'"; + $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id IN($in_post_meta_ids)" ); + do_action( 'deleted_postmeta', $post_meta_ids ); + } + + do_action( 'delete_post', $post_id ); + $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $post_id )); + do_action( 'deleted_post', $post_id ); + + $uploadpath = wp_upload_dir(); if ( ! empty($meta['thumb']) ) { // Don't delete the thumb if another attachment uses it - if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%'.$meta['thumb'].'%', $postid)) ) { + if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $meta['thumb'] . '%', $post_id)) ) { $thumbfile = str_replace(basename($file), $meta['thumb'], $file); $thumbfile = apply_filters('wp_delete_file', $thumbfile); - @ unlink( path_join($uploadPath['basedir'], $thumbfile) ); + @ unlink( path_join($uploadpath['basedir'], $thumbfile) ); } } - // remove intermediate images if there are any + // remove intermediate and backup images if there are any $sizes = apply_filters('intermediate_image_sizes', array('thumbnail', 'medium', 'large')); foreach ( $sizes as $size ) { - if ( $intermediate = image_get_intermediate_size($postid, $size) ) { + if ( $intermediate = image_get_intermediate_size($post_id, $size) ) { $intermediate_file = apply_filters('wp_delete_file', $intermediate['path']); - @ unlink( path_join($uploadPath['basedir'], $intermediate_file) ); + @ unlink( path_join($uploadpath['basedir'], $intermediate_file) ); + } + } + + if ( is_array($backup_sizes) ) { + foreach ( $backup_sizes as $size ) { + $del_file = path_join( dirname($meta['file']), $size['file'] ); + $del_file = apply_filters('wp_delete_file', $del_file); + @ unlink( path_join($uploadpath['basedir'], $del_file) ); } } @@ -2626,7 +2909,7 @@ function wp_delete_attachment($postid) { if ( ! empty($file) ) @ unlink($file); - clean_post_cache($postid); + clean_post_cache($post_id); return $post; } @@ -2646,8 +2929,10 @@ function wp_get_attachment_metadata( $post_id, $unfiltered = false ) { return false; $data = get_post_meta( $post->ID, '_wp_attachment_metadata', true ); + if ( $unfiltered ) return $data; + return apply_filters( 'wp_get_attachment_metadata', $data, $post->ID ); } @@ -3197,56 +3482,7 @@ function update_post_caches(&$posts) { * @return bool|array Returns false if there is nothing to update or an array of metadata. */ function update_postmeta_cache($post_ids) { - global $wpdb; - - if ( empty( $post_ids ) ) - return false; - - if ( !is_array($post_ids) ) { - $post_ids = preg_replace('|[^0-9,]|', '', $post_ids); - $post_ids = explode(',', $post_ids); - } - - $post_ids = array_map('intval', $post_ids); - - $ids = array(); - foreach ( (array) $post_ids as $id ) { - if ( false === wp_cache_get($id, 'post_meta') ) - $ids[] = $id; - } - - if ( empty( $ids ) ) - return false; - - // Get post-meta info - $id_list = join(',', $ids); - $cache = array(); - if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id IN ($id_list)", ARRAY_A) ) { - foreach ( (array) $meta_list as $metarow) { - $mpid = (int) $metarow['post_id']; - $mkey = $metarow['meta_key']; - $mval = $metarow['meta_value']; - - // Force subkeys to be array type: - if ( !isset($cache[$mpid]) || !is_array($cache[$mpid]) ) - $cache[$mpid] = array(); - if ( !isset($cache[$mpid][$mkey]) || !is_array($cache[$mpid][$mkey]) ) - $cache[$mpid][$mkey] = array(); - - // Add a value to the current pid/key: - $cache[$mpid][$mkey][] = $mval; - } - } - - foreach ( (array) $ids as $id ) { - if ( ! isset($cache[$id]) ) - $cache[$id] = array(); - } - - foreach ( (array) array_keys($cache) as $post) - wp_cache_set($post, $cache[$post], 'post_meta'); - - return $cache; + return update_meta_cache('post', $post_ids); } // @@ -3320,9 +3556,13 @@ function _publish_post_hook($post_id) { return; $data = array( 'post_id' => $post_id, 'meta_value' => '1' ); - if ( get_option('default_pingback_flag') ) + if ( get_option('default_pingback_flag') ) { $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_pingme' ) ); + do_action( 'added_postmeta', $wpdb->insert_id, $post_id, '_pingme', 1 ); + } $wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_encloseme' ) ); + do_action( 'added_postmeta', $wpdb->insert_id, $post_id, '_encloseme', 1 ); + wp_schedule_single_event(time(), 'do_pings'); } @@ -3465,7 +3705,7 @@ function _wp_post_revision_fields( $post = null, $autosave = false ) { */ function wp_save_post_revision( $post_id ) { // We do autosaves manually with wp_create_post_autosave() - if ( @constant( 'DOING_AUTOSAVE' ) ) + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; // WP_POST_REVISIONS = 0, false diff --git a/wp-includes/query.php b/wp-includes/query.php index c9f96558..88440cba 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -86,22 +86,6 @@ function wp_reset_query() { * Query type checks. */ -/** - * Whether the current request is in WordPress admin Panel - * - * Does not inform on whether the user is an admin! Use capability checks to - * tell if the user should be accessing a section or not. - * - * @since 1.5.1 - * - * @return bool True if inside WordPress administration pages. - */ -function is_admin () { - if ( defined('WP_ADMIN') ) - return WP_ADMIN; - return false; -} - /** * Is query requesting an archive page. * @@ -254,14 +238,7 @@ function is_tax( $slug = '' ) { if ( empty($slug) ) return true; - $term = $wp_query->get_queried_object(); - - $slug = (array) $slug; - - if ( in_array( $term->slug, $slug ) ) - return true; - - return false; + return in_array( get_query_var('taxonomy'), (array) $slug ); } /** @@ -1431,7 +1408,7 @@ class WP_Query { if ( '' != $qv['tb'] ) $this->is_trackback = true; - if ( '' != $qv['paged'] ) + if ( '' != $qv['paged'] && ( intval($qv['paged']) > 1 ) ) $this->is_paged = true; if ( '' != $qv['comments_popup'] ) @@ -1486,8 +1463,12 @@ class WP_Query { } } - if ( !empty($qv['post_type']) ) - $qv['post_type'] = sanitize_user($qv['post_type'], true); + if ( !empty($qv['post_type']) ) { + if(is_array($qv['post_type'])) + $qv['post_type'] = array_map('sanitize_user', $qv['post_type'], array(true)); + else + $qv['post_type'] = sanitize_user($qv['post_type'], true); + } if ( !empty($qv['post_status']) ) $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']); @@ -1596,7 +1577,7 @@ class WP_Query { if ( $this->is_search ) $q['post_type'] = 'any'; else - $q['post_type'] = 'post'; + $q['post_type'] = ''; } $post_type = $q['post_type']; if ( !isset($q['posts_per_page']) || $q['posts_per_page'] == 0 ) @@ -1747,7 +1728,7 @@ class WP_Query { $q['search_terms'] = array($q['s']); } else { preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches); - $q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]); + $q['search_terms'] = array_map('_search_terms_tidy', $matches[0]); } $n = !empty($q['exact']) ? '' : '%'; $searchand = ''; @@ -1756,7 +1737,7 @@ class WP_Query { $search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))"; $searchand = ' AND '; } - $term = $wpdb->escape($q['s']); + $term = esc_sql($q['s']); if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] ) $search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')"; @@ -1803,14 +1784,8 @@ class WP_Query { } if ( !empty($q['category__not_in']) ) { - if ( $wpdb->has_cap( 'subqueries' ) ) { - $cat_string = "'" . implode("', '", $q['category__not_in']) . "'"; - $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ($cat_string) )"; - } else { - $ids = get_objects_in_term($q['category__not_in'], 'category'); - if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 ) - $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')"; - } + $cat_string = "'" . implode("', '", $q['category__not_in']) . "'"; + $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ($cat_string) )"; } // Category stuff for nice URLs @@ -1893,14 +1868,8 @@ class WP_Query { } if ( !empty($q['tag__not_in']) ) { - if ( $wpdb->has_cap( 'subqueries' ) ) { - $tag_string = "'" . implode("', '", $q['tag__not_in']) . "'"; - $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'post_tag' AND tt.term_id IN ($tag_string) )"; - } else { - $ids = get_objects_in_term($q['tag__not_in'], 'post_tag'); - if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 ) - $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')"; - } + $tag_string = "'" . implode("', '", $q['tag__not_in']) . "'"; + $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'post_tag' AND tt.term_id IN ($tag_string) )"; } // Tag and slug intersections. @@ -2029,7 +1998,7 @@ class WP_Query { $q['orderby'] = ''; } else { // Used to filter values - $allowed_keys = array('author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand'); + $allowed_keys = array('author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count'); if ( !empty($q['meta_key']) ) { $allowed_keys[] = $q['meta_key']; $allowed_keys[] = 'meta_value'; @@ -2056,6 +2025,9 @@ class WP_Query { case 'meta_value': $orderby = "$wpdb->postmeta.meta_value"; break; + case 'comment_count': + $orderby = "$wpdb->posts.comment_count"; + break; default: $orderby = "$wpdb->posts.post_" . $orderby; } @@ -2070,16 +2042,30 @@ class WP_Query { $q['orderby'] = "$wpdb->posts.post_date ".$q['order']; } + if ( is_array($post_type) ) + $post_type_cap = 'multiple_post_type'; + else + $post_type_cap = $post_type; + + $exclude_post_types = ''; + foreach ( get_post_types( array('exclude_from_search' => true) ) as $_wp_post_type ) + $exclude_post_types .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $_wp_post_type); + if ( 'any' == $post_type ) { - $where .= " AND $wpdb->posts.post_type != 'revision'"; + $where .= $exclude_post_types; + } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { + $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')"; + } elseif ( ! empty( $post_type ) ) { + $where .= " AND $wpdb->posts.post_type = '$post_type'"; } elseif ( $this->is_attachment ) { $where .= " AND $wpdb->posts.post_type = 'attachment'"; + $post_type_cap = 'post'; } elseif ($this->is_page) { $where .= " AND $wpdb->posts.post_type = 'page'"; - } elseif ($this->is_single) { - $where .= " AND $wpdb->posts.post_type = 'post'"; + $post_type_cap = 'page'; } else { - $where .= " AND $wpdb->posts.post_type = '$post_type'"; + $where .= " AND $wpdb->posts.post_type = 'post'"; + $post_type_cap = 'post'; } if ( isset($q['post_status']) && '' != $q['post_status'] ) { @@ -2087,18 +2073,25 @@ class WP_Query { $q_status = explode(',', $q['post_status']); $r_status = array(); $p_status = array(); - if ( in_array( 'draft' , $q_status ) ) - $r_status[] = "$wpdb->posts.post_status = 'draft'"; - if ( in_array( 'pending', $q_status ) ) - $r_status[] = "$wpdb->posts.post_status = 'pending'"; - if ( in_array( 'future' , $q_status ) ) - $r_status[] = "$wpdb->posts.post_status = 'future'"; - if ( in_array( 'inherit' , $q_status ) ) - $r_status[] = "$wpdb->posts.post_status = 'inherit'"; - if ( in_array( 'private', $q_status ) ) - $p_status[] = "$wpdb->posts.post_status = 'private'"; - if ( in_array( 'publish', $q_status ) ) - $r_status[] = "$wpdb->posts.post_status = 'publish'"; + if ( $q['post_status'] == 'any' ) { + // @todo Use register_post_status() data to determine which states should be excluded. + $r_status[] = "$wpdb->posts.post_status <> 'trash'"; + } else { + if ( in_array( 'draft' , $q_status ) ) + $r_status[] = "$wpdb->posts.post_status = 'draft'"; + if ( in_array( 'pending', $q_status ) ) + $r_status[] = "$wpdb->posts.post_status = 'pending'"; + if ( in_array( 'future' , $q_status ) ) + $r_status[] = "$wpdb->posts.post_status = 'future'"; + if ( in_array( 'inherit' , $q_status ) ) + $r_status[] = "$wpdb->posts.post_status = 'inherit'"; + if ( in_array( 'private', $q_status ) ) + $p_status[] = "$wpdb->posts.post_status = 'private'"; + if ( in_array( 'publish', $q_status ) ) + $r_status[] = "$wpdb->posts.post_status = 'publish'"; + if ( in_array( 'trash', $q_status ) ) + $r_status[] = "$wpdb->posts.post_status = 'trash'"; + } if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) { $r_status = array_merge($r_status, $p_status); @@ -2106,13 +2099,13 @@ class WP_Query { } if ( !empty($r_status) ) { - if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can("edit_others_{$post_type}s") ) + if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can("edit_others_{$post_type_cap}s") ) $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $r_status ) . "))"; else $statuswheres[] = "(" . join( ' OR ', $r_status ) . ")"; } if ( !empty($p_status) ) { - if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can("read_private_{$post_type}s") ) + if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can("read_private_{$post_type_cap}s") ) $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $p_status ) . "))"; else $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")"; @@ -2131,7 +2124,7 @@ class WP_Query { $where .= " OR $wpdb->posts.post_status = 'future' OR $wpdb->posts.post_status = 'draft' OR $wpdb->posts.post_status = 'pending'"; if ( is_user_logged_in() ) { - $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR $wpdb->posts.post_status = 'private'" : " OR $wpdb->posts.post_author = $user_ID AND $wpdb->posts.post_status = 'private'"; + $where .= current_user_can( "read_private_{$post_type_cap}s" ) ? " OR $wpdb->posts.post_status = 'private'" : " OR $wpdb->posts.post_author = $user_ID AND $wpdb->posts.post_status = 'private'"; } $where .= ')'; @@ -2289,7 +2282,7 @@ class WP_Query { } else { if (in_array($status, array('draft', 'pending')) ) { // User must have edit permissions on the draft to preview. - if (! current_user_can('edit_post', $this->posts[0]->ID)) { + if (! current_user_can("edit_$post_type_cap", $this->posts[0]->ID)) { $this->posts = array(); } else { $this->is_preview = true; @@ -2297,17 +2290,17 @@ class WP_Query { } } else if ('future' == $status) { $this->is_preview = true; - if (!current_user_can('edit_post', $this->posts[0]->ID)) { + if (!current_user_can("edit_$post_type_cap", $this->posts[0]->ID)) { $this->posts = array ( ); } } else { - if (! current_user_can('read_post', $this->posts[0]->ID)) + if (! current_user_can("read_$post_type_cap", $this->posts[0]->ID)) $this->posts = array(); } } } - if ( $this->is_preview && current_user_can( "edit_{$post_type}", $this->posts[0]->ID ) ) + if ( $this->is_preview && current_user_can( "edit_{$post_type_cap}", $this->posts[0]->ID ) ) $this->posts[0] = apply_filters('the_preview', $this->posts[0]); } @@ -2335,7 +2328,17 @@ class WP_Query { // Fetch sticky posts that weren't in the query results if ( !empty($sticky_posts) ) { $stickies__in = implode(',', array_map( 'absint', $sticky_posts )); - $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in)" ); + // honor post type(s) if not set to any + $stickies_where = ''; + if ( 'any' != $post_type && '' != $post_type ) { + if ( is_array( $post_type ) ) { + $post_types = join( "', '", $post_type ); + } else { + $post_types = $post_type; + } + $stickies_where = "AND $wpdb->posts.post_type IN ('" . $post_types . "')"; + } + $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" ); /** @todo Make sure post is published or viewable by the current user */ foreach ( $stickies as $sticky_post ) { if ( 'publish' != $sticky_post->post_status ) @@ -2349,9 +2352,15 @@ class WP_Query { if ( !$q['suppress_filters'] ) $this->posts = apply_filters('the_posts', $this->posts); + $this->post_count = count($this->posts); + + // Sanitize before caching so it'll only get done once + for ($i = 0; $i < $this->post_count; $i++) { + $this->posts[$i] = sanitize_post($this->posts[$i], 'raw'); + } + update_post_caches($this->posts); - $this->post_count = count($this->posts); if ($this->post_count > 0) { $this->post = $this->posts[0]; } @@ -2694,7 +2703,7 @@ function setup_postdata($post) { } do_action_ref_array('the_post', array(&$post)); - + return true; } diff --git a/wp-includes/registration.php b/wp-includes/registration.php index 3dfb672c..6148bb67 100644 --- a/wp-includes/registration.php +++ b/wp-includes/registration.php @@ -164,21 +164,12 @@ function wp_insert_user($userdata) { if ( empty($use_ssl) ) $use_ssl = 0; - if ( empty($jabber) ) - $jabber = ''; - - if ( empty($aim) ) - $aim = ''; - - if ( empty($yim) ) - $yim = ''; - if ( empty($user_registered) ) $user_registered = gmdate('Y-m-d H:i:s'); $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login)); - if ($user_nicename_check) { + if ( $user_nicename_check ) { $suffix = 2; while ($user_nicename_check) { $alt_user_nicename = $user_nicename . "-$suffix"; @@ -203,14 +194,18 @@ function wp_insert_user($userdata) { update_usermeta( $user_id, 'last_name', $last_name); update_usermeta( $user_id, 'nickname', $nickname ); update_usermeta( $user_id, 'description', $description ); - update_usermeta( $user_id, 'jabber', $jabber ); - update_usermeta( $user_id, 'aim', $aim ); - update_usermeta( $user_id, 'yim', $yim ); update_usermeta( $user_id, 'rich_editing', $rich_editing); update_usermeta( $user_id, 'comment_shortcuts', $comment_shortcuts); update_usermeta( $user_id, 'admin_color', $admin_color); update_usermeta( $user_id, 'use_ssl', $use_ssl); + foreach ( _wp_get_user_contactmethods() as $method => $name ) { + if ( empty($$method) ) + $$method = ''; + + update_usermeta( $user_id, $method, $$method ); + } + if ( isset($role) ) { $user = new WP_User($user_id); $user->set_role($role); @@ -288,7 +283,6 @@ function wp_update_user($userdata) { * * @since 2.0.0 * @see wp_insert_user() More complete way to create a new user - * @uses $wpdb Escapes $username and $email parameters * * @param string $username The user's username. * @param string $password The user's password. @@ -296,14 +290,30 @@ function wp_update_user($userdata) { * @return int The new user's ID. */ function wp_create_user($username, $password, $email = '') { - global $wpdb; - - $user_login = $wpdb->escape($username); - $user_email = $wpdb->escape($email); + $user_login = esc_sql( $username ); + $user_email = esc_sql( $email ); $user_pass = $password; $userdata = compact('user_login', 'user_email', 'user_pass'); return wp_insert_user($userdata); } + +/** + * Setup the default contact methods + * + * @access private + * @since + * + * @return array $user_contactmethods Array of contact methods and their labels. + */ +function _wp_get_user_contactmethods() { + $user_contactmethods = array( + 'aim' => __('AIM'), + 'yim' => __('Yahoo IM'), + 'jabber' => __('Jabber / Google Talk') + ); + return apply_filters('user_contactmethods',$user_contactmethods); +} + ?> diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index c04c6a7e..4c8d9e68 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1060,6 +1060,8 @@ class WP_Rewrite { * @return string|bool False if not found. Permalink structure string. */ function get_extra_permastruct($name) { + if ( empty($this->permalink_structure) ) + return false; if ( isset($this->extra_permastructs[$name]) ) return $this->extra_permastructs[$name]; return false; @@ -1442,10 +1444,10 @@ class WP_Rewrite { $subcommentquery = $subquery . '&cpage=' . $this->preg_index(2); //do endpoints for attachments - if ( !empty($endpoint) ) { foreach ( (array) $ep_query_append as $regex => $ep ) { + if ( !empty($endpoints) ) { foreach ( (array) $ep_query_append as $regex => $ep ) { if ($ep[0] & EP_ATTACHMENT) { - $rewrite[$sub1 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); - $rewrite[$sub2 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); + $rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2); + $rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2); } } } @@ -1607,11 +1609,11 @@ class WP_Rewrite { * @return array Rewrite rules. */ function wp_rewrite_rules() { - $this->rules = get_transient('rewrite_rules'); + $this->rules = get_option('rewrite_rules'); if ( empty($this->rules) ) { $this->matches = 'matches'; $this->rewrite_rules(); - set_transient('rewrite_rules', $this->rules); + update_option('rewrite_rules', $this->rules); } return $this->rules; @@ -1715,19 +1717,37 @@ class WP_Rewrite { * * @return string */ - function iis7_url_rewrite_rules(){ + function iis7_url_rewrite_rules($add_parent_tags = false, $indent = " ", $end_of_line = "\n") { if ( ! $this->using_permalinks()) { return ''; } - $rules = "\n"; - $rules .= " \n"; - $rules .= " \n"; - $rules .= " \n"; - $rules .= " \n"; - $rules .= " \n"; - $rules .= " \n"; - $rules .= ""; + + $rules = ''; + $extra_indent = ''; + if ( $add_parent_tags ) { + $rules .= "".$end_of_line; + $rules .= $indent."".$end_of_line; + $rules .= $indent.$indent."".$end_of_line; + $rules .= $indent.$indent.$indent."".$end_of_line; + $extra_indent = $indent.$indent.$indent.$indent; + } + + $rules .= $extra_indent."".$end_of_line; + $rules .= $extra_indent.$indent."".$end_of_line; + $rules .= $extra_indent.$indent.$indent."".$end_of_line; + $rules .= $extra_indent.$indent.$indent.$indent."".$end_of_line; + $rules .= $extra_indent.$indent.$indent.$indent."".$end_of_line; + $rules .= $extra_indent.$indent.$indent."".$end_of_line; + $rules .= $extra_indent.$indent."".$end_of_line; + $rules .= $extra_indent.""; + + if ( $add_parent_tags ) { + $rules .= $end_of_line.$indent.$indent.$indent."".$end_of_line; + $rules .= $indent.$indent."".$end_of_line; + $rules .= $indent."".$end_of_line; + $rules .= ""; + } $rules = apply_filters('iis7_url_rewrite_rules', $rules); @@ -1822,10 +1842,10 @@ class WP_Rewrite { * * @since 2.0.1 * @access public - * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard). + * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard). */ function flush_rules($hard = true) { - delete_transient('rewrite_rules'); + delete_option('rewrite_rules'); $this->wp_rewrite_rules(); if ( $hard && function_exists('save_mod_rewrite_rules') ) save_mod_rewrite_rules(); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index f3f6bf2b..863bf457 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -8,8 +8,9 @@ * file. * * Several constants are used to manage the loading, concatenating and compression of scripts and CSS: - * define('SCRIPT_DEBUG', true); loads the development (non-minified) versions of all scripts and disables compression and concatenation - * define('CONCATENATE_SCRIPTS', false); disables compression and concatenation, + * define('SCRIPT_DEBUG', true); loads the development (non-minified) versions of all scripts and disables compression and concatenation, + * define('STYLE_DEBUG', true); loads the development (non-minified) versions of all CSS and disables compression and concatenation, + * define('CONCATENATE_SCRIPTS', false); disables compression and concatenation of scripts and CSS, * define('COMPRESS_SCRIPTS', false); disables compression of scripts, * define('COMPRESS_CSS', false); disables compression of CSS, * define('ENFORCE_GZIP', true); forces gzip for compression (default is deflate). @@ -60,10 +61,10 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' ); - $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090609' ); + $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20091212' ); $scripts->add_data( 'common', 'group', 1 ); $scripts->localize( 'common', 'commonL10n', array( - 'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), + 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), 'l10n_print_after' => 'try{convertEntities(commonL10n);}catch(e){};' ) ); @@ -86,11 +87,11 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' ); - $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", false, '20090503' ); + $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", false, '20091124' ); $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); - $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), '20090128' ); + $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), '20091119' ); $scripts->add_data( 'wp-ajax-response', 'group', 1 ); $scripts->localize( 'wp-ajax-response', 'wpAjax', array( 'noPerm' => __('You do not have permission to do that.'), @@ -98,14 +99,11 @@ function wp_default_scripts( &$scripts ) { 'l10n_print_after' => 'try{convertEntities(wpAjax);}catch(e){};' ) ); - $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090526' ); + $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20091012' ); $scripts->add_data( 'autosave', 'group', 1 ); - $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20090504' ); + $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20091128' ); $scripts->add_data( 'wp-lists', 'group', 1 ); - $scripts->localize( 'wp-lists', 'wpListL10n', array( - 'url' => admin_url('admin-ajax.php') - ) ); $scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.8.0'); $scripts->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.8.0'); @@ -116,6 +114,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.8.0'); $scripts->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.8.0'); + // not used in core, replaced by Jcrop.js $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118'); $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.3.2'); @@ -144,12 +143,14 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.7.1' ); $scripts->add_data( 'jquery-ui-dialog', 'group', 1 ); + // deprecated, not used in core, most functionality is included in jQuery 1.3 $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '2.02m'); $scripts->add_data( 'jquery-form', 'group', 1 ); $scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color$suffix.js", array('jquery'), '2.0-4561m'); $scripts->add_data( 'jquery-color', 'group', 1 ); + // deprecated, not used in core $scripts->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' ); $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20090125'); @@ -164,8 +165,17 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102' ); $scripts->add_data( 'jquery-table-hotkeys', 'group', 1 ); - $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20090123'); + $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20091124'); $scripts->add_data( 'thickbox', 'group', 1 ); + $scripts->localize( 'thickbox', 'thickboxL10n', array( + 'next' => __('Next >'), + 'prev' => __('< Prev'), + 'image' => __('Image'), + 'of' => __('of'), + 'close' => __('Close'), + 'l10n_print_after' => 'try{convertEntities(thickboxL10n);}catch(e){};' + ) ); + $scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop$suffix.js", array('jquery'), '0.9.8'); @@ -183,11 +193,14 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'swfupload-all', '/wp-includes/js/swfupload/swfupload-all.js', array(), '2201'); } - $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20090515'); + $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20091208'); + $max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) < (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post; + if ( empty($max_upload_size) ) + $max_upload_size = __('not configured'); // these error messages came from the sample swfupload js, they might need changing. $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', array( 'queue_limit_exceeded' => __('You have attempted to queue too many files.'), - 'file_exceeds_size_limit' => sprintf(__('This file is too big. Your php.ini upload_max_filesize is %s.'), @ini_get('upload_max_filesize')), + 'file_exceeds_size_limit' => sprintf( __('This file is too big. The maximum upload size for your server is %s.'), $max_upload_size ), 'zero_byte_file' => __('This file is empty. Please try another.'), 'invalid_filetype' => __('This file type is not allowed. Please try another.'), 'default_error' => __('An error occurred in the upload. Please try again later.'), @@ -201,12 +214,17 @@ function wp_default_scripts( &$scripts ) { 'upload_stopped' => __('Upload stopped.'), 'dismiss' => __('Dismiss'), 'crunching' => __('Crunching…'), - 'deleted' => __('Deleted'), + 'deleted' => __('moved to the trash.'), 'l10n_print_after' => 'try{convertEntities(swfuploadL10n);}catch(e){};' ) ); $scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", false, '20090102'); + $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", false, '20090817'); + + $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.1' ); + $scripts->add_data( 'imgareaselect', 'group', 1 ); + if ( is_admin() ) { $scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' ); $scripts->add_data( 'ajaxcat', 'group', 1 ); @@ -216,11 +234,16 @@ function wp_default_scripts( &$scripts ) { 'l10n_print_after' => 'try{convertEntities(catL10n);}catch(e){};' ) ); - $scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), '20090207' ); + $scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), '20091201' ); $scripts->add_data( 'admin-categories', 'group', 1 ); - $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('wp-lists'), '20090211' ); + $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery'), '20090623' ); $scripts->add_data( 'admin-tags', 'group', 1 ); + $scripts->localize( 'admin-tags', 'tagsl10n', array( + 'noPerm' => __('You do not have permission to do that.'), + 'broken' => __('An unidentified error has occurred.'), + 'l10n_print_after' => 'try{convertEntities(tagsl10n);}catch(e){};' + )); $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' ); $scripts->add_data( 'admin-custom-fields', 'group', 1 ); @@ -240,7 +263,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20090514' ); $scripts->add_data( 'user-profile', 'group', 1 ); - $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090627' ); + $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20091129' ); $scripts->add_data( 'admin-comments', 'group', 1 ); $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( 'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']), @@ -249,28 +272,17 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", false, '3517m' ); - $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090618' ); + $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20091012' ); $scripts->add_data( 'postbox', 'group', 1 ); - $scripts->localize( 'postbox', 'postboxL10n', array( - 'requestFile' => admin_url('admin-ajax.php') - ) ); - $scripts->add( 'slug', "/wp-admin/js/slug$suffix.js", array('jquery'), '20090207' ); - $scripts->add_data( 'slug', 'group', 1 ); - $scripts->localize( 'slug', 'slugL10n', array( - 'requestFile' => admin_url('admin-ajax.php'), - 'save' => __('Save'), - 'cancel' => __('Cancel'), - 'l10n_print_after' => 'try{convertEntities(slugL10n);}catch(e){};' - ) ); - - $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'slug'), '20090624' ); + $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20091208' ); $scripts->add_data( 'post', 'group', 1 ); $scripts->localize( 'post', 'postL10n', array( 'tagsUsed' => __('Tags used on this post:'), 'add' => esc_attr(__('Add')), 'addTag' => esc_attr(__('Add new tag')), 'separate' => __('Separate tags with commas'), + 'ok' => __('OK'), 'cancel' => __('Cancel'), 'edit' => __('Edit'), 'publishOn' => __('Publish on:'), @@ -280,7 +292,8 @@ function wp_default_scripts( &$scripts ) { 'endcomm' => __('No more comments found.'), 'publish' => __('Publish'), 'schedule' => __('Schedule'), - 'update' => __('Update Post'), + 'updatePost' => __('Update Post'), + 'updatePage' => __('Update Page'), 'savePending' => __('Save as Pending'), 'saveDraft' => __('Save Draft'), 'private' => __('Private'), @@ -292,33 +305,10 @@ function wp_default_scripts( &$scripts ) { 'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};' ) ); - $scripts->add( 'page', "/wp-admin/js/page$suffix.js", array('jquery', 'slug', 'wp-lists', 'postbox'), '20090526' ); - $scripts->add_data( 'page', 'group', 1 ); - $scripts->localize( 'page', 'postL10n', array( - 'cancel' => __('Cancel'), - 'edit' => __('Edit'), - 'publishOn' => __('Publish on:'), - 'publishOnFuture' => __('Schedule for:'), - 'publishOnPast' => __('Published on:'), - 'showcomm' => __('Show more comments'), - 'endcomm' => __('No more comments found.'), - 'publish' => __('Publish'), - 'schedule' => __('Schedule'), - 'update' => __('Update Page'), - 'savePending' => __('Save as Pending'), - 'saveDraft' => __('Save Draft'), - 'private' => __('Private'), - 'public' => __('Public'), - 'password' => __('Password Protected'), - 'privatelyPublished' => __('Privately Published'), - 'published' => __('Published'), - 'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};' - ) ); - $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array('wp-lists', 'postbox'), '20090506' ); $scripts->add_data( 'link', 'group', 1 ); - $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array('jquery'), '20090102' ); + $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array('jquery'), '20091202' ); $scripts->add_data( 'comment', 'group', 1 ); $scripts->localize( 'comment', 'commentL10n', array( 'cancel' => __('Cancel'), @@ -329,10 +319,10 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ), '20090516' ); - $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20090114' ); + $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20091023' ); $scripts->add_data( 'media-upload', 'group', 1 ); - $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20090601' ); + $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20090824' ); $scripts->add_data( 'admin-widgets', 'group', 1 ); $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), '20090422' ); @@ -342,7 +332,7 @@ function wp_default_scripts( &$scripts ) { 'l10n_print_after' => 'try{convertEntities(wordCountL10n);}catch(e){};' )); - $scripts->add( 'wp-gears', "/wp-admin/js/wp-gears$suffix.js", false, '20090102' ); + $scripts->add( 'wp-gears', "/wp-admin/js/wp-gears$suffix.js", false, '20090717' ); $scripts->localize( 'wp-gears', 'wpGearsL10n', array( 'updateCompleted' => __('Update completed.'), 'error' => __('Error:'), @@ -352,7 +342,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090319' ); $scripts->add_data( 'theme-preview', 'group', 1 ); - $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery-form', 'suggest' ), '20090125' ); + $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), '20091202' ); $scripts->add_data( 'inline-edit-post', 'group', 1 ); $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 'error' => __('Error while saving the changes.'), @@ -361,7 +351,7 @@ function wp_default_scripts( &$scripts ) { 'l10n_print_after' => 'try{convertEntities(inlineEditL10n);}catch(e){};' ) ); - $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery-form' ), '20090211' ); + $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), '20090623' ); $scripts->add_data( 'inline-edit-tax', 'group', 1 ); $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array( 'error' => __('Error while saving the changes.'), @@ -388,6 +378,19 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'codepress', '/wp-includes/js/codepress/codepress.js', false, '0.9.6' ); $scripts->add_data( 'codepress', 'group', 1 ); + + $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20091111' ); + $scripts->add_data( 'image-edit', 'group', 1 ); + + $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091210b' ); + $scripts->add_data( 'set-post-thumbnail', 'group', 1 ); + $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( + 'setThumbnail' => __( 'Use as thumbnail' ), + 'saving' => __( 'Saving...' ), + 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), + 'done' => __( 'Done' ) + ) ); + } } @@ -418,39 +421,42 @@ function wp_default_styles( &$styles ) { $styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr'; $styles->default_dirs = array('/wp-admin/'); + $suffix = defined('STYLE_DEBUG') && STYLE_DEBUG ? '.dev' : ''; + $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' ); // all colors stylesheets need to have the same query strings (cache manifest compat) - $colors_version = '20090625'; + $colors_version = '20091217'; - $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090625' ); - $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); + $styles->add( 'wp-admin', "/wp-admin/wp-admin$suffix.css", array(), '20091217' ); + $styles->add_data( 'wp-admin', 'rtl', "/wp-admin/rtl$suffix.css" ); - $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090630' ); + $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20091217' ); $styles->add_data( 'ie', 'conditional', 'lte IE 7' ); // Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string. $styles->add( 'colors', true, array(), $colors_version ); - + // do not refer to these directly, the right one is queued by the above "meta" colors handle - $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css', array(), $colors_version); + $styles->add( 'colors-fresh', "/wp-admin/css/colors-fresh$suffix.css", array(), $colors_version); $styles->add_data( 'colors-fresh', 'rtl', true ); - $styles->add( 'colors-classic', '/wp-admin/css/colors-classic.css', array(), $colors_version); + $styles->add( 'colors-classic', "/wp-admin/css/colors-classic$suffix.css", array(), $colors_version); $styles->add_data( 'colors-classic', 'rtl', true ); - $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090630' ); - $styles->add( 'media', '/wp-admin/css/media.css', array(), '20090516' ); - $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20090603' ); - $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20090514' ); - $styles->add( 'install', '/wp-admin/css/install.css', array(), '20090514' ); - $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css', array(), '20090625' ); - $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20090514' ); + $styles->add( 'global', "/wp-admin/css/global$suffix.css", array(), '20091217' ); + $styles->add( 'media', "/wp-admin/css/media$suffix.css", array(), '20091029' ); + $styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20091118' ); + $styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20091211' ); + $styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20090514' ); + $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20090625' ); + $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20091022' ); $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' ); - $styles->add( 'login', '/wp-admin/css/login.css', array(), '20090514' ); - $styles->add( 'plugin-install', '/wp-admin/css/plugin-install.css', array(), '20090514' ); - $styles->add( 'theme-install', '/wp-admin/css/theme-install.css', array(), '20090610' ); + $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20091010' ); + $styles->add( 'plugin-install', "/wp-admin/css/plugin-install$suffix.css", array(), '20090514' ); + $styles->add( 'theme-install', "/wp-admin/css/theme-install$suffix.css", array(), '20090610' ); $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' ); $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' ); + $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' ); foreach ( $rtl_styles as $rtl_style ) $styles->add_data( $rtl_style, 'rtl', true ); @@ -528,15 +534,22 @@ function wp_style_loader_src( $src, $handle ) { if ( 'colors' == $handle || 'colors-rtl' == $handle ) { global $_wp_admin_css_colors; $color = get_user_option('admin_color'); + if ( empty($color) || !isset($_wp_admin_css_colors[$color]) ) $color = 'fresh'; + $color = $_wp_admin_css_colors[$color]; $parsed = parse_url( $src ); $url = $color->url; + + if ( defined('STYLE_DEBUG') && STYLE_DEBUG ) + $url = preg_replace('/.css$|.css(?=\?)/', '.dev.css', $url); + if ( isset($parsed['query']) && $parsed['query'] ) { wp_parse_str( $parsed['query'], $qv ); $url = add_query_arg( $qv, $url ); } + return $url; } diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 6ced1816..bad91c14 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -175,6 +175,7 @@ function get_shortcode_regex() { $tagnames = array_keys($shortcode_tags); $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); + // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcodes() return '(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)'; } @@ -289,7 +290,7 @@ function strip_shortcodes( $content ) { $pattern = get_shortcode_regex(); - return preg_replace('/'.$pattern.'/s', '', $content); + return preg_replace('/'.$pattern.'/s', '$1$6', $content); } add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() diff --git a/wp-includes/streams.php b/wp-includes/streams.php deleted file mode 100644 index 60b617de..00000000 --- a/wp-includes/streams.php +++ /dev/null @@ -1,191 +0,0 @@ -. - - This file is part of PHP-gettext. - - PHP-gettext is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - PHP-gettext is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with PHP-gettext; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - */ - - -// Simple class to wrap file streams, string streams, etc. -// seek is essential, and it should be byte stream -class StreamReader { - // should return a string [FIXME: perhaps return array of bytes?] - function read($bytes) { - return false; - } - - // should return new position - function seekto($position) { - return false; - } - - // returns current position - function currentpos() { - return false; - } - - // returns length of entire stream (limit for seekto()s) - function length() { - return false; - } -} - -class StringReader { - var $_pos; - var $_str; - - function StringReader($str='') { - $this->_str = $str; - $this->_pos = 0; - // If string functions are overloaded, we need to use the mb versions - $this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); - } - - function _substr($string, $start, $length) { - if ($this->is_overloaded) { - return mb_substr($string,$start,$length,'ascii'); - } else { - return substr($string,$start,$length); - } - } - - function _strlen($string) { - if ($this->is_overloaded) { - return mb_strlen($string,'ascii'); - } else { - return strlen($string); - } - } - - function read($bytes) { - $data = $this->_substr($this->_str, $this->_pos, $bytes); - $this->_pos += $bytes; - if ($this->_strlen($this->_str)<$this->_pos) - $this->_pos = $this->_strlen($this->_str); - - return $data; - } - - function seekto($pos) { - $this->_pos = $pos; - if ($this->_strlen($this->_str)<$this->_pos) - $this->_pos = $this->_strlen($this->_str); - return $this->_pos; - } - - function currentpos() { - return $this->_pos; - } - - function length() { - return $this->_strlen($this->_str); - } -} - - -class FileReader { - var $_pos; - var $_fd; - var $_length; - - function FileReader($filename) { - if (file_exists($filename)) { - - $this->_length=filesize($filename); - $this->_pos = 0; - $this->_fd = fopen($filename,'rb'); - if (!$this->_fd) { - $this->error = 3; // Cannot read file, probably permissions - return false; - } - } else { - $this->error = 2; // File doesn't exist - return false; - } - } - - function read($bytes) { - if ($bytes) { - fseek($this->_fd, $this->_pos); - - // PHP 5.1.1 does not read more than 8192 bytes in one fread() - // the discussions at PHP Bugs suggest it's the intended behaviour - while ($bytes > 0) { - $chunk = fread($this->_fd, $bytes); - $data .= $chunk; - $bytes -= strlen($chunk); - } - $this->_pos = ftell($this->_fd); - - return $data; - } else return ''; - } - - function seekto($pos) { - fseek($this->_fd, $pos); - $this->_pos = ftell($this->_fd); - return $this->_pos; - } - - function currentpos() { - return $this->_pos; - } - - function length() { - return $this->_length; - } - - function close() { - fclose($this->_fd); - } - -} - -// Preloads entire file in memory first, then creates a StringReader -// over it (it assumes knowledge of StringReader internals) -class CachedFileReader extends StringReader { - function CachedFileReader($filename) { - parent::StringReader(); - - if (file_exists($filename)) { - - $length=filesize($filename); - $fd = fopen($filename,'rb'); - - if (!$fd) { - $this->error = 3; // Cannot read file, probably permissions - return false; - } - $this->_str = fread($fd, $length); - fclose($fd); - - } else { - $this->error = 2; // File doesn't exist - return false; - } - } -} - - -?> diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 12f86a37..98282027 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -301,6 +301,7 @@ function get_objects_in_term( $terms, $taxonomies, $args = array() ) { */ function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { global $wpdb; + $null = null; if ( empty($term) ) { $error = new WP_Error('invalid_term', __('Empty Term')); @@ -321,6 +322,8 @@ function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { $term = (int) $term; if ( ! $_term = wp_cache_get($term, $taxonomy) ) { $_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %s LIMIT 1", $taxonomy, $term) ); + if ( ! $_term ) + return $null; wp_cache_add($term, $_term, $taxonomy); } } @@ -1078,7 +1081,9 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) { foreach ( (array) $taxonomies as $taxonomy ) { $tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids'); $in_tt_ids = "'" . implode("', '", $tt_ids) . "'"; + do_action( 'delete_term_relationships', $object_id, $tt_ids ); $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id) ); + do_action( 'deleted_term_relationships', $object_id, $tt_ids ); wp_update_term_count($tt_ids, $taxonomy); } } @@ -1137,7 +1142,10 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) { return $term_obj; $parent = $term_obj->parent; + $edit_tt_ids = $wpdb->get_col( "SELECT `term_taxonomy_id` FROM $wpdb->term_taxonomy WHERE `parent` = " . (int)$term_obj->term_id ); + do_action( 'edit_term_taxonomies', $edit_tt_ids ); $wpdb->update( $wpdb->term_taxonomy, compact( 'parent' ), array( 'parent' => $term_obj->term_id) + compact( 'taxonomy' ) ); + do_action( 'edited_term_taxonomies', $edit_tt_ids ); } $objects = $wpdb->get_col( $wpdb->prepare( "SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tt_id ) ); @@ -1155,7 +1163,9 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) { wp_set_object_terms($object, $terms, $taxonomy); } + do_action( 'delete_term_taxonomy', $tt_id ); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $tt_id ) ); + do_action( 'deleted_term_taxonomy', $tt_id ); // Delete the term if no taxonomies use it. if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) ) @@ -1377,7 +1387,9 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { } else { // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; + do_action( 'edit_terms', $alias->term_id ); $wpdb->update($wpdb->terms, compact('term_group'), array('term_id' => $alias->term_id) ); + do_action( 'edited_terms', $alias->term_id ); } } @@ -1396,7 +1408,9 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { if ( empty($slug) ) { $slug = sanitize_title($slug, $term_id); + do_action( 'edit_terms', $term_id ); $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); + do_action( 'edited_terms', $term_id ); } $tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id ) ); @@ -1407,14 +1421,14 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { $wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent') + array( 'count' => 0 ) ); $tt_id = (int) $wpdb->insert_id; - do_action("create_term", $term_id, $tt_id); + do_action("create_term", $term_id, $tt_id, $taxonomy); do_action("create_$taxonomy", $term_id, $tt_id); $term_id = apply_filters('term_id_filter', $term_id, $tt_id); clean_term_cache($term_id, $taxonomy); - do_action("created_term", $term_id, $tt_id); + do_action("created_term", $term_id, $tt_id, $taxonomy); do_action("created_$taxonomy", $term_id, $tt_id); return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id); @@ -1474,7 +1488,9 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { if ( $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $object_id, $tt_id ) ) ) continue; + do_action( 'add_term_relationship', $object_id, $tt_id ); $wpdb->insert( $wpdb->term_relationships, array( 'object_id' => $object_id, 'term_taxonomy_id' => $tt_id ) ); + do_action( 'added_term_relationship', $object_id, $tt_id ); } wp_update_term_count($tt_ids, $taxonomy); @@ -1483,7 +1499,9 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { $delete_terms = array_diff($old_tt_ids, $tt_ids); if ( $delete_terms ) { $in_delete_terms = "'" . implode("', '", $delete_terms) . "'"; + do_action( 'delete_term_relationships', $object_id, $delete_terms ); $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_delete_terms)", $object_id) ); + do_action( 'deleted_term_relationships', $object_id, $delete_terms ); wp_update_term_count($delete_terms, $taxonomy); } } @@ -1500,7 +1518,7 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); } - do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append); + do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids); return $tt_ids; } @@ -1646,7 +1664,9 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) { } else { // The alias isn't in a group, so let's create a new one and firstly add the alias term to it. $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1; + do_action( 'edit_terms', $alias->term_id ); $wpdb->update( $wpdb->terms, compact('term_group'), array( 'term_id' => $alias->term_id ) ); + do_action( 'edited_terms', $alias->term_id ); } } @@ -1660,26 +1680,27 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) { else return new WP_Error('duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug)); } - + do_action( 'edit_terms', $term_id ); $wpdb->update($wpdb->terms, compact( 'name', 'slug', 'term_group' ), compact( 'term_id' ) ); - if ( empty($slug) ) { $slug = sanitize_title($name, $term_id); $wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) ); } + do_action( 'edited_terms', $term_id ); $tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id) ); - + do_action( 'edit_term_taxonomy', $tt_id ); $wpdb->update( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ), array( 'term_taxonomy_id' => $tt_id ) ); + do_action( 'edited_term_taxonomy', $tt_id ); - do_action("edit_term", $term_id, $tt_id); + do_action("edit_term", $term_id, $tt_id, $taxonomy); do_action("edit_$taxonomy", $term_id, $tt_id); $term_id = apply_filters('term_id_filter', $term_id, $tt_id); clean_term_cache($term_id, $taxonomy); - do_action("edited_term", $term_id, $tt_id); + do_action("edited_term", $term_id, $tt_id, $taxonomy); do_action("edited_$taxonomy", $term_id, $tt_id); return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id); @@ -1771,7 +1792,9 @@ function wp_update_term_count_now( $terms, $taxonomy ) { // Default count updater foreach ( (array) $terms as $term) { $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term) ); + do_action( 'edit_term_taxonomy', $term ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); + do_action( 'edited_term_taxonomy', $term ); } } @@ -2153,7 +2176,9 @@ function _update_post_term_count( $terms ) { foreach ( (array) $terms as $term ) { $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term ) ); + do_action( 'edit_term_taxonomy', $term ); $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); + do_action( 'edited_term_taxonomy', $term ); } } @@ -2191,7 +2216,7 @@ function get_term_link( $term, $taxonomy ) { $slug = $term->slug; if ( empty($termlink) ) { - $file = get_option('home') . '/'; + $file = trailingslashit( get_option('home') ); $t = get_taxonomy($taxonomy); if ( $t->query_var ) $termlink = "$file?$t->query_var=$slug"; diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 2c800535..ddea5cb8 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -34,8 +34,10 @@ function get_stylesheet() { */ function get_stylesheet_directory() { $stylesheet = get_stylesheet(); - $stylesheet_dir = get_theme_root() . "/$stylesheet"; - return apply_filters('stylesheet_directory', $stylesheet_dir, $stylesheet); + $theme_root = get_theme_root( $stylesheet ); + $stylesheet_dir = "$theme_root/$stylesheet"; + + return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root ); } /** @@ -47,8 +49,10 @@ function get_stylesheet_directory() { */ function get_stylesheet_directory_uri() { $stylesheet = get_stylesheet(); - $stylesheet_dir_uri = get_theme_root_uri() . "/$stylesheet"; - return apply_filters('stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet); + $theme_root_uri = get_theme_root_uri( $stylesheet ); + $stylesheet_dir_uri = "$theme_root_uri/$stylesheet"; + + return apply_filters( 'stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet, $theme_root_uri ); } /** @@ -123,8 +127,10 @@ function get_template() { */ function get_template_directory() { $template = get_template(); - $template_dir = get_theme_root() . "/$template"; - return apply_filters('template_directory', $template_dir, $template); + $theme_root = get_theme_root( $template ); + $template_dir = "$theme_root/$template"; + + return apply_filters( 'template_directory', $template_dir, $template, $theme_root ); } /** @@ -137,8 +143,10 @@ function get_template_directory() { */ function get_template_directory_uri() { $template = get_template(); - $template_dir_uri = get_theme_root_uri() . "/$template"; - return apply_filters('template_directory_uri', $template_dir_uri, $template); + $theme_root_uri = get_theme_root_uri( $template ); + $template_dir_uri = "$theme_root_uri/$template"; + + return apply_filters( 'template_directory_uri', $template_dir_uri, $template, $theme_root_uri ); } /** @@ -162,6 +170,18 @@ function get_template_directory_uri() { * @return array Theme data. */ function get_theme_data( $theme_file ) { + $default_headers = array( + 'Name' => 'Theme Name', + 'URI' => 'Theme URI', + 'Description' => 'Description', + 'Author' => 'Author', + 'AuthorURI' => 'Author URI', + 'Version' => 'Version', + 'Template' => 'Template', + 'Status' => 'Status', + 'Tags' => 'Tags' + ); + $themes_allowed_tags = array( 'a' => array( 'href' => array(),'title' => array() @@ -177,59 +197,41 @@ function get_theme_data( $theme_file ) { 'strong' => array() ); - $theme_data = implode( '', file( $theme_file ) ); - $theme_data = str_replace ( '\r', '\n', $theme_data ); - if ( preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name ) ) - $name = $theme = wp_kses( _cleanup_header_comment($theme_name[1]), $themes_allowed_tags ); - else - $name = $theme = ''; + $theme_data = get_file_data( $theme_file, $default_headers, 'theme' ); - if ( preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ) ) - $theme_uri = esc_url( _cleanup_header_comment($theme_uri[1]) ); - else - $theme_uri = ''; + $theme_data['Name'] = $theme_data['Title'] = wp_kses( $theme_data['Name'], $themes_allowed_tags ); - if ( preg_match( '|Description:(.*)$|mi', $theme_data, $description ) ) - $description = wptexturize( wp_kses( _cleanup_header_comment($description[1]), $themes_allowed_tags ) ); - else - $description = ''; + $theme_data['URI'] = esc_url( $theme_data['URI'] ); - if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) ) - $author_uri = esc_url( _cleanup_header_comment($author_uri[1]) ); - else - $author_uri = ''; + $theme_data['Description'] = wptexturize( wp_kses( $theme_data['Description'], $themes_allowed_tags ) ); - if ( preg_match( '|Template:(.*)$|mi', $theme_data, $template ) ) - $template = wp_kses( _cleanup_header_comment($template[1]), $themes_allowed_tags ); - else - $template = ''; + $theme_data['AuthorURI'] = esc_url( $theme_data['AuthorURI'] ); - if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) - $version = wp_kses( _cleanup_header_comment($version[1]), $themes_allowed_tags ); - else - $version = ''; + $theme_data['Template'] = wp_kses( $theme_data['Template'], $themes_allowed_tags ); - if ( preg_match('|Status:(.*)|i', $theme_data, $status) ) - $status = wp_kses( _cleanup_header_comment($status[1]), $themes_allowed_tags ); + $theme_data['Version'] = wp_kses( $theme_data['Version'], $themes_allowed_tags ); + + if ( $theme_data['Status'] == '' ) + $theme_data['Status'] = 'publish'; else - $status = 'publish'; + $theme_data['Status'] = wp_kses( $theme_data['Status'], $themes_allowed_tags ); - if ( preg_match('|Tags:(.*)|i', $theme_data, $tags) ) - $tags = array_map( 'trim', explode( ',', wp_kses( _cleanup_header_comment($tags[1]), array() ) ) ); + if ( $theme_data['Tags'] == '' ) + $theme_data['Tags'] = array(); else - $tags = array(); + $theme_data['Tags'] = array_map( 'trim', explode( ',', wp_kses( $theme_data['Tags'], array() ) ) ); - if ( preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ) ) { - if ( empty( $author_uri ) ) { - $author = wp_kses( _cleanup_header_comment($author_name[1]), $themes_allowed_tags ); + if ( $theme_data['Author'] == '' ) { + $theme_data['Author'] = __('Anonymous'); + } else { + if ( empty( $theme_data['AuthorURI'] ) ) { + $theme_data['Author'] = wp_kses( $theme_data['Author'], $themes_allowed_tags ); } else { - $author = sprintf( '%3$s', $author_uri, __( 'Visit author homepage' ), wp_kses( _cleanup_header_comment($author_name[1]), $themes_allowed_tags ) ); + $theme_data['Author'] = sprintf( '%3$s', $theme_data['AuthorURI'], __( 'Visit author homepage' ), wp_kses( $theme_data['Author'], $themes_allowed_tags ) ); } - } else { - $author = __('Anonymous'); } - return array( 'Name' => $name, 'Title' => $theme, 'URI' => $theme_uri, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Status' => $status, 'Tags' => $tags ); + return $theme_data; } /** @@ -253,65 +255,20 @@ function get_themes() { if ( isset($wp_themes) ) return $wp_themes; - $themes = array(); - $wp_broken_themes = array(); - $theme_loc = $theme_root = get_theme_root(); - if ( '/' != WP_CONTENT_DIR ) // don't want to replace all forward slashes, see Trac #4541 - $theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root); + /* Register the default root as a theme directory */ + register_theme_directory( get_theme_root() ); - // Files in wp-content/themes directory and one subdir down - $themes_dir = @ opendir($theme_root); - if ( !$themes_dir ) + if ( !$theme_files = search_theme_directories() ) return false; - while ( ($theme_dir = readdir($themes_dir)) !== false ) { - if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { - if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) - continue; - $stylish_dir = @ opendir($theme_root . '/' . $theme_dir); - $found_stylesheet = false; - while ( ($theme_file = readdir($stylish_dir)) !== false ) { - if ( $theme_file == 'style.css' ) { - $theme_files[] = $theme_dir . '/' . $theme_file; - $found_stylesheet = true; - break; - } - } - @closedir($stylish_dir); - if ( !$found_stylesheet ) { // look for themes in that dir - $subdir = "$theme_root/$theme_dir"; - $subdir_name = $theme_dir; - $theme_subdir = @ opendir( $subdir ); - while ( ($theme_dir = readdir($theme_subdir)) !== false ) { - if ( is_dir( $subdir . '/' . $theme_dir) && is_readable($subdir . '/' . $theme_dir) ) { - if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) - continue; - $stylish_dir = @ opendir($subdir . '/' . $theme_dir); - $found_stylesheet = false; - while ( ($theme_file = readdir($stylish_dir)) !== false ) { - if ( $theme_file == 'style.css' ) { - $theme_files[] = $subdir_name . '/' . $theme_dir . '/' . $theme_file; - $found_stylesheet = true; - break; - } - } - @closedir($stylish_dir); - } - } - @closedir($theme_subdir); - $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.')); - } - } - } - if ( is_dir( $theme_dir ) ) - @closedir( $theme_dir ); - - if ( !$themes_dir || !$theme_files ) - return $themes; + asort( $theme_files ); - sort($theme_files); + $wp_themes = array(); foreach ( (array) $theme_files as $theme_file ) { + $theme_root = $theme_file['theme_root']; + $theme_file = $theme_file['theme_file']; + if ( !is_readable("$theme_root/$theme_file") ) { $wp_broken_themes[$theme_file] = array('Name' => $theme_file, 'Title' => $theme_file, 'Description' => __('File not readable.')); continue; @@ -341,22 +298,34 @@ function get_themes() { } if ( empty($template) ) { - if ( file_exists(dirname("$theme_root/$theme_file/index.php")) ) - $template = dirname($theme_file); + if ( file_exists("$theme_root/$stylesheet/index.php") ) + $template = $stylesheet; else continue; } - $template = trim($template); + $template = trim( $template ); if ( !file_exists("$theme_root/$template/index.php") ) { $parent_dir = dirname(dirname($theme_file)); if ( file_exists("$theme_root/$parent_dir/$template/index.php") ) { $template = "$parent_dir/$template"; + $template_directory = "$theme_root/$template"; } else { - $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); - continue; + /** + * The parent theme doesn't exist in the current theme's folder or sub folder + * so lets use the theme root for the parent template. + */ + if ( isset($theme_files[$template]) && file_exists( $theme_files[$template]['theme_root'] . "/$template/index.php" ) ) { + $template_directory = $theme_files[$template]['theme_root'] . "/$template"; + } else { + $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); + continue; + } + } + } else { + $template_directory = trim( $theme_root . '/' . $template ); } $stylesheet_files = array(); @@ -367,28 +336,30 @@ function get_themes() { while ( ($file = $stylesheet_dir->read()) !== false ) { if ( !preg_match('|^\.+$|', $file) ) { if ( preg_match('|\.css$|', $file) ) - $stylesheet_files[] = "$theme_loc/$stylesheet/$file"; + $stylesheet_files[] = "$theme_root/$stylesheet/$file"; elseif ( preg_match('|\.php$|', $file) ) - $template_files[] = "$theme_loc/$stylesheet/$file"; + $template_files[] = "$theme_root/$stylesheet/$file"; } } @ $stylesheet_dir->close(); } - $template_dir = @ dir("$theme_root/$template"); + $template_dir = @ dir("$template_directory"); if ( $template_dir ) { while ( ($file = $template_dir->read()) !== false ) { if ( preg_match('|^\.+$|', $file) ) continue; if ( preg_match('|\.php$|', $file) ) { - $template_files[] = "$theme_loc/$template/$file"; - } elseif ( is_dir("$theme_root/$template/$file") ) { - $template_subdir = @ dir("$theme_root/$template/$file"); + $template_files[] = "$template_directory/$file"; + } elseif ( is_dir("$template_directory/$file") ) { + $template_subdir = @ dir("$template_directory/$file"); + if ( !$template_subdir ) + continue; while ( ($subfile = $template_subdir->read()) !== false ) { if ( preg_match('|^\.+$|', $subfile) ) continue; if ( preg_match('|\.php$|', $subfile) ) - $template_files[] = "$theme_loc/$template/$file/$subfile"; + $template_files[] = "$template_directory/$file/$subfile"; } @ $template_subdir->close(); } @@ -396,6 +367,10 @@ function get_themes() { @ $template_dir->close(); } + //Make unique and remove duplicates when stylesheet and template are the same i.e. most themes + $template_files = array_unique($template_files); + $stylesheet_files = array_unique($stylesheet_files); + $template_dir = dirname($template_files[0]); $stylesheet_dir = dirname($stylesheet_files[0]); @@ -408,41 +383,62 @@ function get_themes() { // a new theme directory and the theme header is not updated. Whichever // theme is first keeps the name. Subsequent themes get a suffix applied. // The Default and Classic themes always trump their pretenders. - if ( isset($themes[$name]) ) { + if ( isset($wp_themes[$name]) ) { if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) && ('default' == $stylesheet || 'classic' == $stylesheet) ) { // If another theme has claimed to be one of our default themes, move // them aside. - $suffix = $themes[$name]['Stylesheet']; + $suffix = $wp_themes[$name]['Stylesheet']; $new_name = "$name/$suffix"; - $themes[$new_name] = $themes[$name]; - $themes[$new_name]['Name'] = $new_name; + $wp_themes[$new_name] = $wp_themes[$name]; + $wp_themes[$new_name]['Name'] = $new_name; } else { $name = "$name/$stylesheet"; } } - $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags']); + $theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $theme_root ); + $wp_themes[$name] = array( 'Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags'], 'Theme Root' => $theme_root, 'Theme Root URI' => str_replace( WP_CONTENT_DIR, content_url(), $theme_root ) ); } - // Resolve theme dependencies. - $theme_names = array_keys($themes); + unset($theme_files); + + /* Store theme roots in the DB */ + if ( get_site_transient( 'theme_roots' ) != $theme_roots ) + set_site_transient( 'theme_roots', $theme_roots, 7200 ); // cache for two hours + unset($theme_roots); + /* Resolve theme dependencies. */ + $theme_names = array_keys( $wp_themes ); foreach ( (array) $theme_names as $theme_name ) { - $themes[$theme_name]['Parent Theme'] = ''; - if ( $themes[$theme_name]['Stylesheet'] != $themes[$theme_name]['Template'] ) { + $wp_themes[$theme_name]['Parent Theme'] = ''; + if ( $wp_themes[$theme_name]['Stylesheet'] != $wp_themes[$theme_name]['Template'] ) { foreach ( (array) $theme_names as $parent_theme_name ) { - if ( ($themes[$parent_theme_name]['Stylesheet'] == $themes[$parent_theme_name]['Template']) && ($themes[$parent_theme_name]['Template'] == $themes[$theme_name]['Template']) ) { - $themes[$theme_name]['Parent Theme'] = $themes[$parent_theme_name]['Name']; + if ( ($wp_themes[$parent_theme_name]['Stylesheet'] == $wp_themes[$parent_theme_name]['Template']) && ($wp_themes[$parent_theme_name]['Template'] == $wp_themes[$theme_name]['Template']) ) { + $wp_themes[$theme_name]['Parent Theme'] = $wp_themes[$parent_theme_name]['Name']; break; } } } } - $wp_themes = $themes; + return $wp_themes; +} - return $themes; +/** + * Retrieve theme roots. + * + * @since 2.9.0 + * + * @return array Theme roots + */ +function get_theme_roots() { + $theme_roots = get_site_transient( 'theme_roots' ); + if ( false === $theme_roots ) { + get_themes(); + $theme_roots = get_site_transient( 'theme_roots' ); // this is set in get_theme() + } + return $theme_roots; } /** @@ -498,18 +494,140 @@ function get_current_theme() { return $current_theme; } +/** + * Register a directory that contains themes. + * + * @since 2.9.0 + * + * @param string $directory Either the full filesystem path to a theme folder or a folder within WP_CONTENT_DIR + * @return bool + */ +function register_theme_directory( $directory) { + global $wp_theme_directories; + + /* If this folder does not exist, return and do not register */ + if ( !file_exists( $directory ) ) + /* Try prepending as the theme directory could be relative to the content directory */ + $registered_directory = WP_CONTENT_DIR . '/' . $directory; + else + $registered_directory = $directory; + + /* If this folder does not exist, return and do not register */ + if ( !file_exists( $registered_directory ) ) + return false; + + $wp_theme_directories[] = $registered_directory; + + return true; +} + +/** + * Search all registered theme directories for complete and valid themes. + * + * @since 2.9.0 + * + * @return array Valid themes found + */ +function search_theme_directories() { + global $wp_theme_directories, $wp_broken_themes; + if ( empty( $wp_theme_directories ) ) + return false; + + $theme_files = array(); + $wp_broken_themes = array(); + + /* Loop the registered theme directories and extract all themes */ + foreach ( (array) $wp_theme_directories as $theme_root ) { + $theme_loc = $theme_root; + + /* We don't want to replace all forward slashes, see Trac #4541 */ + if ( '/' != WP_CONTENT_DIR ) + $theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root); + + /* Files in the root of the current theme directory and one subdir down */ + $themes_dir = @ opendir($theme_root); + + if ( !$themes_dir ) + return false; + + while ( ($theme_dir = readdir($themes_dir)) !== false ) { + if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { + if ( $theme_dir{0} == '.' || $theme_dir == 'CVS' ) + continue; + + $stylish_dir = @opendir($theme_root . '/' . $theme_dir); + $found_stylesheet = false; + + while ( ($theme_file = readdir($stylish_dir)) !== false ) { + if ( $theme_file == 'style.css' ) { + $theme_files[$theme_dir] = array( 'theme_file' => $theme_dir . '/' . $theme_file, 'theme_root' => $theme_root ); + $found_stylesheet = true; + break; + } + } + @closedir($stylish_dir); + + if ( !$found_stylesheet ) { // look for themes in that dir + $subdir = "$theme_root/$theme_dir"; + $subdir_name = $theme_dir; + $theme_subdirs = @opendir( $subdir ); + + $found_subdir_themes = false; + while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) { + if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) { + if ( $theme_subdir{0} == '.' || $theme_subdir == 'CVS' ) + continue; + + $stylish_dir = @opendir($subdir . '/' . $theme_subdir); + $found_stylesheet = false; + + while ( ($theme_file = readdir($stylish_dir)) !== false ) { + if ( $theme_file == 'style.css' ) { + $theme_files["$theme_dir/$theme_subdir"] = array( 'theme_file' => $subdir_name . '/' . $theme_subdir . '/' . $theme_file, 'theme_root' => $theme_root ); + $found_stylesheet = true; + $found_subdir_themes = true; + break; + } + } + @closedir($stylish_dir); + } + } + @closedir($theme_subdir); + if ( !$found_subdir_themes ) + $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.')); + } + } + } + if ( is_dir( $theme_dir ) ) + @closedir( $theme_dir ); + } + return $theme_files; +} + /** * Retrieve path to themes directory. * * Does not have trailing slash. * * @since 1.5.0 + * @param $stylesheet_or_template The stylesheet or template name of the theme * @uses apply_filters() Calls 'theme_root' filter on path. * * @return string Theme path. */ -function get_theme_root() { - return apply_filters('theme_root', WP_CONTENT_DIR . "/themes"); +function get_theme_root( $stylesheet_or_template = false ) { + if ($stylesheet_or_template) { + $theme_roots = get_theme_roots(); + + if ( $theme_roots[$stylesheet_or_template] ) + $theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template]; + else + $theme_root = WP_CONTENT_DIR . '/themes'; + } else { + $theme_root = WP_CONTENT_DIR . '/themes'; + } + + return apply_filters( 'theme_root', $theme_root ); } /** @@ -518,11 +636,19 @@ function get_theme_root() { * Does not have trailing slash. * * @since 1.5.0 + * @param $stylesheet_or_template The stylesheet or template name of the theme * * @return string Themes URI. */ -function get_theme_root_uri() { - return apply_filters('theme_root_uri', content_url('themes'), get_option('siteurl')); +function get_theme_root_uri( $stylesheet_or_template = false ) { + $theme_roots = get_theme_roots(); + + if ( $theme_roots[$stylesheet_or_template] ) + $theme_root_uri = content_url( $theme_roots[$stylesheet_or_template] ); + else + $theme_root_uri = content_url( 'themes' ); + + return apply_filters( 'theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template ); } /** @@ -590,9 +716,9 @@ function get_author_template() { /** * Retrieve path of category template in current or parent template. * - * Works by retrieving the current category ID, for example 'category-1.php' and - * will fallback to category.php template, if the ID category file doesn't - * exist. + * Works by first retrieving the current slug for example 'category-default.php' and then + * trying category ID, for example 'category-1.php' and will finally fallback to category.php + * template, if those files don't exist. * * @since 1.5.0 * @uses apply_filters() Calls 'category_template' on file path of category template. @@ -600,15 +726,27 @@ function get_author_template() { * @return string */ function get_category_template() { - $template = locate_template(array("category-" . absint( get_query_var('cat') ) . '.php', 'category.php')); + $cat_ID = absint( get_query_var('cat') ); + $category = get_category( $cat_ID ); + + $templates = array(); + + if ( !is_wp_error($category) ) + $templates[] = "category-{$category->slug}.php"; + + $templates[] = "category-$cat_ID.php"; + $templates[] = "category.php"; + + $template = locate_template($templates); return apply_filters('category_template', $template); } /** * Retrieve path of tag template in current or parent template. * - * Works by retrieving the current tag name, for example 'tag-wordpress.php' and will - * fallback to tag.php template, if the name tag file doesn't exist. + * Works by first retrieving the current tag name, for example 'tag-wordpress.php' and then + * trying tag ID, for example 'tag-1.php' and will finally fallback to tag.php + * template, if those files don't exist. * * @since 2.3.0 * @uses apply_filters() Calls 'tag_template' on file path of tag template. @@ -616,7 +754,18 @@ function get_category_template() { * @return string */ function get_tag_template() { - $template = locate_template(array("tag-" . get_query_var('tag') . '.php', 'tag.php')); + $tag_id = absint( get_query_var('tag_id') ); + $tag_name = get_query_var('tag'); + + $templates = array(); + + if ( $tag_name ) + $templates[] = "tag-$tag_name.php"; + if ( $tag_id ) + $templates[] = "tag-$tag_id.php"; + $templates[] = "tag.php"; + + $template = locate_template($templates); return apply_filters('tag_template', $template); } @@ -682,9 +831,9 @@ function get_home_template() { /** * Retrieve path of page template in current or parent template. * - * First attempt is to look for the file in the '_wp_page_template' page meta - * data. The second attempt, if the first has a file and is not empty, is to - * look for 'page.php'. + * Will first look for the specifically assigned page template + * The will search for 'page-{slug}.php' followed by 'page-id.php' + * and finally 'page.php' * * @since 1.5.0 * @@ -695,6 +844,7 @@ function get_page_template() { $id = (int) $wp_query->post->ID; $template = get_post_meta($id, '_wp_page_template', true); + $pagename = get_query_var('pagename'); if ( 'default' == $template ) $template = ''; @@ -702,7 +852,10 @@ function get_page_template() { $templates = array(); if ( !empty($template) && !validate_file($template) ) $templates[] = $template; - + if ( $pagename ) + $templates[] = "page-$pagename.php"; + if ( $id ) + $templates[] = "page-$id.php"; $templates[] = "page.php"; return apply_filters('page_template', locate_template($templates)); @@ -861,7 +1014,7 @@ function locale_stylesheet() { * Will only preform task if the user has permissions and template and preview * query variables exist. * - * @since 2.5.0 + * @since 2.6.0 */ function preview_theme() { if ( ! (isset($_GET['template']) && isset($_GET['preview'])) ) @@ -893,7 +1046,10 @@ add_action('setup_theme', 'preview_theme'); /** * Private function to modify the current template when previewing a theme - * + * + * @since 2.9.0 + * @access private + * * @return string */ function _preview_theme_template_filter() { @@ -902,7 +1058,10 @@ function _preview_theme_template_filter() { /** * Private function to modify the current stylesheet when previewing a theme - * + * + * @since 2.9.0 + * @access private + * * @return string */ function _preview_theme_stylesheet_filter() { @@ -912,7 +1071,7 @@ function _preview_theme_stylesheet_filter() { /** * Callback function for ob_start() to capture all links in the theme. * - * @since unknown + * @since 2.6.0 * @access private * * @param string $content @@ -927,7 +1086,7 @@ function preview_theme_ob_filter( $content ) { * * Callback function for preg_replace_callback() to accept and filter matches. * - * @since unknown + * @since 2.6.0 * @access private * * @param array $matches @@ -1152,4 +1311,75 @@ function add_custom_image_header($header_callback, $admin_header_callback) { add_action('admin_menu', array(&$GLOBALS['custom_image_header'], 'init')); } +/** + * Allows a theme to register its support of a certain feature + * + * Must be called in the themes functions.php file to work. + * + * @author Mark Jaquith + * @since 2.9 + * @param string $feature the feature being added + */ +function add_theme_support( $feature ) { + global $_wp_theme_features; + + if ( func_num_args() == 1 ) + $_wp_theme_features[$feature] = true; + else + $_wp_theme_features[$feature] = array_slice( func_get_args(), 1 ); +} + +/** + * Checks a theme's support for a given feature + * + * @author Mark Jaquith + * @since 2.9 + * @param string $feature the feature being checked + * @return boolean + */ + +function current_theme_supports( $feature ) { + global $_wp_theme_features; + + if ( !isset( $_wp_theme_features[$feature] ) ) + return false; + + // If no args passed then no extra checks need be performed + if ( func_num_args() <= 1 ) + return true; + + $args = array_slice( func_get_args(), 1 ); + + // @todo Allow pluggable arg checking + switch ( $feature ) { + case 'post-thumbnails': + // post-thumbnails can be registered for only certain content/post types by passing + // an array of types to add_theme_support(). If no array was passed, then + // any type is accepted + if ( true === $_wp_theme_features[$feature] ) // Registered for all types + return true; + $content_type = $args[0]; + if ( in_array($content_type, $_wp_theme_features[$feature][0]) ) + return true; + else + return false; + break; + } + + return true; +} + +/** + * Checks a theme's support for a given feature before loading the functions which implement it. + * + * @author Peter Westwood + * @since 2.9 + * @param string $feature the feature being checked + * @param string $include the file containing the functions that implement the feature + */ +function require_if_theme_supports( $feature, $include) { + if ( current_theme_supports( $feature ) ) + require ( $include ); +} + ?> diff --git a/wp-includes/update.php b/wp-includes/update.php index 141cecfe..3b710569 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -40,14 +40,14 @@ function wp_version_check() { set_transient( 'update_core', $current ); if ( method_exists( $wpdb, 'db_version' ) ) - $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version($wpdb->users)); + $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version()); else $mysql_version = 'N/A'; $local_package = isset( $wp_local_package )? $wp_local_package : ''; $url = "http://api.wordpress.org/core/version-check/1.3/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package"; $options = array( - 'timeout' => 3, + 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); @@ -146,7 +146,7 @@ function wp_update_plugins() { $to_send = (object)compact('plugins', 'active'); $options = array( - 'timeout' => 3, + 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3), 'body' => array( 'plugins' => serialize( $to_send ) ), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); @@ -201,27 +201,46 @@ function wp_update_themes( ) { $timeout = 'load-themes.php' == current_filter() ? 3600 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours $time_not_changed = isset( $current_theme->last_checked ) && $timeout > ( time( ) - $current_theme->last_checked ); - if( $time_not_changed ) - return false; - - // Update last_checked for current to prevent multiple blocking requests if request hangs - $current_theme->last_checked = time(); - set_transient( 'update_themes', $current_theme ); - - $current_theme->template = get_option( 'template' ); - - $themes = array( ); + $themes = array(); + $checked = array(); $themes['current_theme'] = (array) $current_theme; foreach( (array) $installed_themes as $theme_title => $theme ) { - $themes[$theme['Stylesheet']] = array( ); + $themes[$theme['Stylesheet']] = array(); + $checked[$theme['Stylesheet']] = $theme['Version']; foreach( (array) $theme as $key => $value ) { $themes[$theme['Stylesheet']][$key] = $value; } } + $theme_changed = false; + foreach ( $checked as $slug => $v ) { + $new_option->checked[ $slug ] = $v; + + if ( !isset( $current_theme->checked[ $slug ] ) || strval($current_theme->checked[ $slug ]) !== strval($v) ) + $theme_changed = true; + } + + if ( isset ( $current_theme->response ) && is_array( $current_theme->response ) ) { + foreach ( $current_theme->response as $slug => $update_details ) { + if ( ! isset($checked[ $slug ]) ) { + $theme_changed = true; + break; + } + } + } + + if( $time_not_changed && !$theme_changed ) + return false; + + // Update last_checked for current to prevent multiple blocking requests if request hangs + $current_theme->last_checked = time(); + set_transient( 'update_themes', $current_theme ); + + $current_theme->template = get_option( 'template' ); + $options = array( - 'timeout' => 3, + 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3), 'body' => array( 'themes' => serialize( $themes ) ), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); @@ -235,8 +254,10 @@ function wp_update_themes( ) { return false; $response = unserialize( $raw_response['body'] ); - if( $response ) + if( $response ) { + $new_option->checked = $checked; $new_option->response = $response; + } set_transient( 'update_themes', $new_option ); } @@ -285,7 +306,7 @@ function _maybe_update_themes( ) { if( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) ) return; - wp_update_themes( ); + wp_update_themes(); } add_action( 'admin_init', '_maybe_update_core' ); @@ -293,6 +314,7 @@ add_action( 'wp_version_check', 'wp_version_check' ); add_action( 'load-plugins.php', 'wp_update_plugins' ); add_action( 'load-update.php', 'wp_update_plugins' ); +add_action( 'load-update-core.php', 'wp_update_plugins' ); add_action( 'admin_init', '_maybe_update_plugins' ); add_action( 'wp_update_plugins', 'wp_update_plugins' ); diff --git a/wp-includes/user.php b/wp-includes/user.php index 483b3bcc..74955889 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -153,7 +153,7 @@ function wp_authenticate_cookie($user, $username, $password) { function get_profile($field, $user = false) { global $wpdb; if ( !$user ) - $user = $wpdb->escape($_COOKIE[USER_COOKIE]); + $user = esc_sql( $_COOKIE[USER_COOKIE] ); return $wpdb->get_var( $wpdb->prepare("SELECT $field FROM $wpdb->users WHERE user_login = %s", $user) ); } @@ -307,6 +307,11 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { $meta_value = serialize($meta_value); $meta_value = trim( $meta_value ); + $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); + + if ( $cur && $cur->umeta_id ) + do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + if ( ! empty($meta_value) ) $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) ); else @@ -314,6 +319,9 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { wp_cache_delete($user_id, 'users'); + if ( $cur && $cur->umeta_id ) + do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + return true; } @@ -399,6 +407,10 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) { } $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); + + if ( $cur ) + do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + if ( !$cur ) $wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') ); else if ( $cur->meta_value != $meta_value ) @@ -408,6 +420,11 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) { wp_cache_delete($user_id, 'users'); + if ( !$cur ) + do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value ); + else + do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + return true; } @@ -431,15 +448,15 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) { * @global string $user_pass_md5 MD5 of the user's password * @global string $user_identity The display name of the user * - * @param int $user_id Optional. User ID to setup global data. + * @param int $for_user_id Optional. User ID to setup global data. */ -function setup_userdata($user_id = '') { +function setup_userdata($for_user_id = '') { global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity; - if ( '' == $user_id ) + if ( '' == $for_user_id ) $user = wp_get_current_user(); else - $user = new WP_User($user_id); + $user = new WP_User($for_user_id); if ( 0 == $user->ID ) return; @@ -447,7 +464,7 @@ function setup_userdata($user_id = '') { $userdata = $user->data; $user_login = $user->user_login; $user_level = (int) isset($user->user_level) ? $user->user_level : 0; - $user_ID = (int) $user->ID; + $user_ID = (int) $user->ID; $user_email = $user->user_email; $user_url = $user->user_url; $user_pass_md5 = md5($user->user_pass); @@ -600,4 +617,121 @@ function _fill_user( &$user ) { wp_cache_add($user->user_nicename, $user->ID, 'userslugs'); } +/** + * Sanitize every user field. + * + * If the context is 'raw', then the user object or array will get minimal santization of the int fields. + * + * @since 2.3.0 + * @uses sanitize_user_field() Used to sanitize the fields. + * + * @param object|array $user The User Object or Array + * @param string $context Optional, default is 'display'. How to sanitize user fields. + * @return object|array The now sanitized User Object or Array (will be the same type as $user) + */ +function sanitize_user_object($user, $context = 'display') { + if ( is_object($user) ) { + if ( !isset($user->ID) ) + $user->ID = 0; + if ( isset($user->data) ) + $vars = get_object_vars( $user->data ); + else + $vars = get_object_vars($user); + foreach ( array_keys($vars) as $field ) { + if ( is_array($user->$field) ) + continue; + $user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context); + } + $user->filter = $context; + } else { + if ( !isset($user['ID']) ) + $user['ID'] = 0; + foreach ( array_keys($user) as $field ) + $user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context); + $user['filter'] = $context; + } + + return $user; +} + +/** + * Sanitize user field based on context. + * + * Possible context values are: 'raw', 'edit', 'db', 'display', 'attribute' and 'js'. The + * 'display' context is used by default. 'attribute' and 'js' contexts are treated like 'display' + * when calling filters. + * + * @since 2.3.0 + * @uses apply_filters() Calls 'edit_$field' and '${field_no_prefix}_edit_pre' passing $value and + * $user_id if $context == 'edit' and field name prefix == 'user_'. + * + * @uses apply_filters() Calls 'edit_user_$field' passing $value and $user_id if $context == 'db'. + * @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'user_'. + * @uses apply_filters() Calls '${field}_pre' passing $value if $context == 'db' and field name prefix != 'user_'. + * + * @uses apply_filters() Calls '$field' passing $value, $user_id and $context if $context == anything + * other than 'raw', 'edit' and 'db' and field name prefix == 'user_'. + * @uses apply_filters() Calls 'user_$field' passing $value if $context == anything other than 'raw', + * 'edit' and 'db' and field name prefix != 'user_'. + * + * @param string $field The user Object field name. + * @param mixed $value The user Object value. + * @param int $user_id user ID. + * @param string $context How to sanitize user fields. Looks for 'raw', 'edit', 'db', 'display', + * 'attribute' and 'js'. + * @return mixed Sanitized value. + */ +function sanitize_user_field($field, $value, $user_id, $context) { + $int_fields = array('ID'); + if ( in_array($field, $int_fields) ) + $value = (int) $value; + + if ( 'raw' == $context ) + return $value; + + if ( is_array($value) ) + return $value; + + $prefixed = false; + if ( false !== strpos($field, 'user_') ) { + $prefixed = true; + $field_no_prefix = str_replace('user_', '', $field); + } + + if ( 'edit' == $context ) { + if ( $prefixed ) { + $value = apply_filters("edit_$field", $value, $user_id); + } else { + $value = apply_filters("edit_user_$field", $value, $user_id); + } + + if ( 'description' == $field ) + $value = esc_html($value); + else + $value = esc_attr($value); + } else if ( 'db' == $context ) { + if ( $prefixed ) { + $value = apply_filters("pre_$field", $value); + } else { + $value = apply_filters("pre_user_$field", $value); + } + } else { + // Use display filters by default. + if ( $prefixed ) + $value = apply_filters($field, $value, $user_id, $context); + else + $value = apply_filters("user_$field", $value, $user_id, $context); + } + + if ( 'user_url' == $field ) + $value = esc_url($value); + + if ( 'attribute' == $context ) + $value = esc_attr($value); + else if ( 'js' == $context ) + $value = esc_js($value); + + return $value; +} + ?> diff --git a/wp-includes/vars.php b/wp-includes/vars.php index b66b3131..ec2be5e4 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -37,22 +37,24 @@ if ( is_admin() ) { // Simple browser detection $is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false; -if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) { - $is_lynx = true; -} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) { - $is_chrome = true; -} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) { - $is_safari = true; -} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) { - $is_gecko = true; -} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false) { - $is_winIE = true; -} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) { - $is_macIE = true; -} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) { - $is_opera = true; -} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false) { - $is_NS4 = true; +if ( isset($_SERVER['HTTP_USER_AGENT']) ) { + if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false ) { + $is_lynx = true; + } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) { + $is_chrome = true; + } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) { + $is_safari = true; + } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ) { + $is_gecko = true; + } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false ) { + $is_winIE = true; + } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false ) { + $is_macIE = true; + } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false ) { + $is_opera = true; + } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false ) { + $is_NS4 = true; + } } if ( $is_safari && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') !== false ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 401a3a95..627c0002 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -8,21 +8,21 @@ * * @global string $wp_version */ -$wp_version = '2.8.5'; +$wp_version = '2.9'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * * @global int $wp_db_version */ -$wp_db_version = 11548; +$wp_db_version = 12329; /** * Holds the TinyMCE version * * @global string $tinymce_version */ -$tinymce_version = '3241-1141'; +$tinymce_version = '327-1235'; /** * Holds the cache manifest version @@ -30,3 +30,17 @@ $tinymce_version = '3241-1141'; * @global string $manifest_version */ $manifest_version = '20090616'; + +/** + * Holds the required PHP version + * + * @global string $required_php_version + */ +$required_php_version = '4.3'; + +/** + * Holds the required MySQL version + * + * @global string $required_mysql_version + */ +$required_mysql_version = '4.1.2'; diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 2f0280d7..47c0e6fc 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -126,20 +126,24 @@ class WP_Widget { function _register() { $settings = $this->get_settings(); + $empty = true; - if ( empty($settings) ) { - // If there are none, we register the widget's existance with a - // generic template - $this->_set(1); - $this->_register_one(); - } elseif ( is_array($settings) ) { + if ( is_array($settings) ) { foreach ( array_keys($settings) as $number ) { if ( is_numeric($number) ) { $this->_set($number); $this->_register_one($number); + $empty = false; } } } + + if ( $empty ) { + // If there are none, we register the widget's existance with a + // generic template + $this->_set(1); + $this->_register_one(); + } } function _set($number) { @@ -544,6 +548,7 @@ function register_sidebar($args = array()) { $defaults = array( 'name' => sprintf(__('Sidebar %d'), $i ), 'id' => "sidebar-$i", + 'description' => '', 'before_widget' => '
    5. ', 'after_widget' => "
    6. \n", 'before_title' => '

      ', @@ -650,6 +655,28 @@ function wp_widget_description( $id ) { return esc_html( $wp_registered_widgets[$id]['description'] ); } +/** + * Retrieve description for a sidebar. + * + * When registering sidebars a 'description' parameter can be included that + * describes the sidebar for display on the widget administration panel. + * + * @since 2.9.0 + * + * @param int|string $id sidebar ID. + * @return string Sidebar description, if available. Null on failure to retrieve description. + */ +function wp_sidebar_description( $id ) { + if ( !is_scalar($id) ) + return; + + global $wp_registered_sidebars; + + if ( isset($wp_registered_sidebars[$id]['description']) ) + return esc_html( $wp_registered_sidebars[$id]['description'] ); +} + + /** * Remove widget from sidebar. * @@ -970,7 +997,7 @@ function wp_get_sidebars_widgets($deprecated = true) { $sidebars_widgets = get_option('sidebars_widgets', array()); $_sidebars_widgets = array(); - if ( isset($sidebars_widgets['wp_inactive_widgets']) ) + if ( isset($sidebars_widgets['wp_inactive_widgets']) || empty($sidebars_widgets) ) $sidebars_widgets['array_version'] = 3; elseif ( !isset($sidebars_widgets['array_version']) ) $sidebars_widgets['array_version'] = 1; diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index a4ff757c..d2f79a63 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -208,6 +208,15 @@ class wpdb { */ var $postmeta; + /** + * WordPress Comment Metadata table + * + * @since 2.9 + * @access public + * @var string + */ + var $commentmeta; + /** * WordPress User Metadata table * @@ -252,7 +261,17 @@ class wpdb { * @var array */ var $tables = array('users', 'usermeta', 'posts', 'categories', 'post2cat', 'comments', 'links', 'link2cat', 'options', - 'postmeta', 'terms', 'term_taxonomy', 'term_relationships'); + 'postmeta', 'terms', 'term_taxonomy', 'term_relationships', 'commentmeta'); + + /** + * List of deprecated WordPress tables + * + * @since 2.9.0 + * @access private + * @var array + */ + var $old_tables = array('categories', 'post2cat', 'link2cat'); + /** * Format specifiers for DB columns. Columns not listed here default to %s. Initialized in wp-settings.php. @@ -295,6 +314,15 @@ class wpdb { */ var $real_escape = false; + /** + * Database Username + * + * @since 2.9.0 + * @access private + * @var string + */ + var $dbuser; + /** * Connects to the database server and selects a database * @@ -329,7 +357,7 @@ class wpdb { function __construct($dbuser, $dbpassword, $dbname, $dbhost) { register_shutdown_function(array(&$this, "__destruct")); - if ( defined('WP_DEBUG') and WP_DEBUG == true ) + if ( WP_DEBUG ) $this->show_errors(); if ( defined('DB_CHARSET') ) @@ -338,6 +366,8 @@ class wpdb { if ( defined('DB_COLLATE') ) $this->collate = DB_COLLATE; + $this->dbuser = $dbuser; + $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true); if (!$this->dbh) { $this->bail(sprintf(/*WP_I18N_DB_CONN_ERROR*/" @@ -349,23 +379,21 @@ class wpdb {
    7. Are you sure that the database server is running?
    8. If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

      -"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost)); +"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost), 'db_connect_fail'); return; } $this->ready = true; - if ( $this->has_cap( 'collation' ) ) { - if ( !empty($this->charset) ) { - if ( function_exists('mysql_set_charset') ) { - mysql_set_charset($this->charset, $this->dbh); - $this->real_escape = true; - } else { - $collation_query = "SET NAMES '{$this->charset}'"; - if ( !empty($this->collate) ) - $collation_query .= " COLLATE '{$this->collate}'"; - $this->query($collation_query); - } + if ( !empty($this->charset) ) { + if ( function_exists('mysql_set_charset') ) { + mysql_set_charset($this->charset, $this->dbh); + $this->real_escape = true; + } else { + $collation_query = "SET NAMES '{$this->charset}'"; + if ( !empty($this->collate) ) + $collation_query .= " COLLATE '{$this->collate}'"; + $this->query($collation_query); } } @@ -436,7 +464,7 @@ class wpdb {
    9. Does the user %2$s have permission to use the %1$s database?
    10. On some systems the name of your database is prefixed with your username, so it would be like username_%1$s. Could that be the problem?
    11. -

      If you don\'t know how to setup a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

      '/*/WP_I18N_DB_SELECT_DB*/, $db, DB_USER)); +

      If you don\'t know how to setup a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

      '/*/WP_I18N_DB_SELECT_DB*/, $db, $this->dbuser), 'db_select_fail'); return; } } @@ -996,13 +1024,14 @@ class wpdb { * * @since 1.5.0 * - * @param string $message + * @param string $message The Error message + * @param string $error_code (optional) A Computer readable string to identify the error. * @return false|void */ - function bail($message) { + function bail($message, $error_code = '500') { if ( !$this->show_errors ) { if ( class_exists('WP_Error') ) - $this->error = new WP_Error('500', $message); + $this->error = new WP_Error($error_code, $message); else $this->error = $message; return false; @@ -1021,9 +1050,9 @@ class wpdb { function check_database_version() { global $wp_version; - // Make sure the server has MySQL 4.0 - if ( version_compare($this->db_version(), '4.0.0', '<') ) - return new WP_Error('database_version',sprintf(__('ERROR: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); + // Make sure the server has MySQL 4.1.2 + if ( version_compare($this->db_version(), '4.1.2', '<') ) + return new WP_Error('database_version',sprintf(__('ERROR: WordPress %s requires MySQL 4.1.2 or higher'), $wp_version)); } /** @@ -1035,8 +1064,7 @@ class wpdb { * * @return bool True if collation is supported, false if version does not */ - function supports_collation() - { + function supports_collation() { return $this->has_cap( 'collation' ); } diff --git a/wp-login.php b/wp-login.php index 5378204d..a20e6ffe 100644 --- a/wp-login.php +++ b/wp-login.php @@ -39,7 +39,7 @@ if ( force_ssl_admin() && !is_ssl() ) { * @param WP_Error $wp_error Optional. WordPress Error Object */ function login_header($title = 'Log In', $message = '', $wp_error = '') { - global $error, $is_iphone; + global $error, $is_iphone, $interim_login; // Don't index any of these forms add_filter( 'pre_option_blog_public', create_function( '$a', 'return 0;' ) ); @@ -53,18 +53,22 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { <?php bloginfo('name'); ?> › <?php echo $title; ?> - - - - + + @@ -163,7 +167,11 @@ function retrieve_password() { $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n"; $message .= site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n"; - $title = sprintf(__('[%s] Password Reset'), get_option('blogname')); + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + + $title = sprintf(__('[%s] Password Reset'), $blogname); $title = apply_filters('retrieve_password_title', $title); $message = apply_filters('retrieve_password_message', $message, $key); @@ -208,7 +216,11 @@ function reset_password($key, $login) { $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n"; $message .= site_url('wp-login.php', 'login') . "\r\n"; - $title = sprintf(__('[%s] Your new password'), get_option('blogname')); + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + + $title = sprintf(__('[%s] Your new password'), $blogname); $title = apply_filters('password_reset_title', $title); $message = apply_filters('password_reset_message', $message, $new_pass); @@ -254,7 +266,7 @@ function register_new_user($user_login, $user_email) { do_action('register_post', $user_login, $user_email, $errors); - $errors = apply_filters( 'registration_errors', $errors ); + $errors = apply_filters( 'registration_errors', $errors, $user_login, $user_email ); if ( $errors->get_error_code() ) return $errors; @@ -282,7 +294,7 @@ if ( isset($_GET['key']) ) $action = 'resetpass'; // validate action so as to default to the login screen -if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action) ) +if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login'), true) && false === has_filter('login_form_' . $action) ) $action = 'login'; nocache_headers(); @@ -347,7 +359,7 @@ case 'retrievepassword' :

      -

      +


      -

      +

      ' . __('You have logged in successfully.') . '

      '; + login_header( '', $message ); ?> + +

      +

      + +has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) $redirect_to = admin_url('profile.php'); @@ -489,11 +511,18 @@ default: $errors->add('test_cookie', __("ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.")); // Some parts of this script use the main login form to display a message - if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) $errors->add('loggedout', __('You are now logged out.'), 'message'); - elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $errors->add('registerdisabled', __('User registration is currently not allowed.')); - elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); - elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); - elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); + if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) + $errors->add('loggedout', __('You are now logged out.'), 'message'); + elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) + $errors->add('registerdisabled', __('User registration is currently not allowed.')); + elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) + $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); + elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) + $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); + elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) + $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); + elseif ( $interim_login ) + $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message'); login_header(__('Log In'), '', $errors); @@ -514,13 +543,18 @@ default:

      - + + + + +

      + - -

      + +

      '+j.renderHTML()+""+j.renderHTML()+"