From 492aa4ee7086ed94cb2f37a2bce3b52905841659 Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 9 Mar 2007 15:17:25 +0000 Subject: WP Merge to rev 5007 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@909 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- app.php | 4 +- wp-admin/admin-functions.php | 27 +- wp-admin/admin-header.php | 2 +- wp-admin/cat.js | 10 + wp-admin/custom-header.php | 6 +- wp-admin/dbx-admin-key.js | 47 ++ wp-admin/edit-comments.php | 14 +- wp-admin/edit-form-advanced.php | 2 +- wp-admin/edit-link-form.php | 6 +- wp-admin/edit.php | 8 +- wp-admin/import/blogger.php | 4 +- wp-admin/link-add.php | 2 +- wp-admin/menu.php | 4 +- wp-admin/moderation.php | 2 +- wp-admin/options-general.php | 16 +- wp-admin/options-misc.php | 2 +- wp-admin/options-writing.php | 2 +- wp-admin/options.php | 2 +- wp-admin/page.php | 4 +- wp-admin/plugins.php | 2 +- wp-admin/post.php | 4 +- wp-admin/setup-config.php | 6 +- wp-admin/templates.php | 2 +- wp-admin/themes.php | 10 +- wp-admin/upgrade-functions.php | 16 +- wp-admin/upload-functions.php | 2 +- wp-admin/upload.js | 273 +++++++++ wp-blog-header.php | 2 +- wp-config-sample.php | 5 +- wp-content/themes/default/functions.php | 4 +- wp-content/themes/default/searchform.php | 2 +- wp-content/themes/default/sidebar.php | 10 +- wp-includes/bookmark-template.php | 8 +- wp-includes/classes.php | 8 +- wp-includes/comment-template.php | 26 +- wp-includes/cron.php | 14 +- wp-includes/feed.php | 2 +- wp-includes/formatting.php | 9 +- wp-includes/functions.php | 34 +- wp-includes/general-template.php | 65 ++- wp-includes/js/autosave.js | 158 +++++ wp-includes/js/jquery/jquery.form.js | 644 +++++++++++++++++++++ wp-includes/js/jquery/jquery.js | 3 +- wp-includes/js/list-manipulation.js | 295 ++++++++++ .../spellchecker/classes/TinyGoogleSpell.class.php | 91 ++- .../spellchecker/classes/TinyPspellShell.class.php | 29 +- .../js/tinymce/plugins/spellchecker/config.php | 21 +- .../tinymce/plugins/spellchecker/css/content.css | 1 - .../plugins/spellchecker/css/spellchecker.css | 1 + .../tinymce/plugins/spellchecker/editor_plugin.js | 574 +----------------- .../js/tinymce/plugins/spellchecker/langs/en.js | 3 +- .../js/tinymce/plugins/spellchecker/tinyspell.php | 41 +- .../js/tinymce/plugins/wordpress/wordpress.css | 1 - wp-includes/js/tinymce/wp-mce-help.php | 2 +- wp-includes/js/wp-ajax.js | 100 ++++ wp-includes/link-template.php | 6 +- wp-includes/pluggable.php | 2 +- wp-includes/post.php | 4 +- wp-includes/query.php | 170 +++--- wp-includes/rewrite.php | 10 +- wp-includes/rss.php | 4 +- wp-includes/script-loader.php | 144 ++++- wp-includes/theme.php | 3 +- wp-includes/vars.php | 4 +- wp-includes/wp-db.php | 2 +- wp-login.php | 14 +- wp-settings.php | 57 +- xmlrpc.php | 51 +- 68 files changed, 2153 insertions(+), 950 deletions(-) create mode 100644 wp-admin/cat.js create mode 100644 wp-admin/dbx-admin-key.js create mode 100644 wp-admin/upload.js create mode 100644 wp-includes/js/autosave.js create mode 100644 wp-includes/js/jquery/jquery.form.js create mode 100644 wp-includes/js/list-manipulation.js create mode 100644 wp-includes/js/wp-ajax.js diff --git a/app.php b/app.php index b22bbd2..08fd3d1 100644 --- a/app.php +++ b/app.php @@ -192,7 +192,7 @@ class AtomParser { $this->in_content = array(); } else { $endtag = $this->ns_to_prefix($name); - if(strstr($this->in_content[count($this->in_content)-1], "<$endtag")) { + if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) { array_push($this->in_content, "/>"); } else { array_push($this->in_content, ""); @@ -220,7 +220,7 @@ class AtomParser { #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n"; if(!empty($this->in_content)) { // handle self-closing tags (case: text node found, need to close element started) - if(strstr($this->in_content[count($this->in_content)-1], "<")) { + if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { array_push($this->in_content, ">"); } array_push($this->in_content, $this->xml_escape($data)); diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 7e89d3b..79fe7e4 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1156,7 +1156,7 @@ function insert_with_markers( $filename, $marker, $insertion ) { if ( $markerdata ) { $state = true; foreach ( $markerdata as $n => $markerline ) { - if ( strstr( $markerline, "# BEGIN {$marker}" )) + if (strpos($markerline, '# BEGIN ' . $marker) !== false) $state = false; if ( $state ) { if ( $n + 1 < count( $markerdata ) ) @@ -1164,7 +1164,7 @@ function insert_with_markers( $filename, $marker, $insertion ) { else fwrite( $f, "{$markerline}" ); } - if ( strstr( $markerline, "# END {$marker}" ) ) { + if (strpos($markerline, '# END ' . $marker) !== false) { fwrite( $f, "# BEGIN {$marker}\n" ); if ( is_array( $insertion )) foreach ( $insertion as $insertline ) @@ -1202,11 +1202,11 @@ function extract_from_markers( $filename, $marker ) { { $state = false; foreach ( $markerdata as $markerline ) { - if ( strstr( $markerline, "# END {$marker}" )) + if (strpos($markerline, '# END ' . $marker) !== false) $state = false; if ( $state ) $result[] = $markerline; - if ( strstr( $markerline, "# BEGIN {$marker}" )) + if (strpos($markerline, '# BEGIN ' . $marker) !== false) $state = true; } } @@ -1558,6 +1558,14 @@ function add_theme_page( $page_title, $menu_title, $access_level, $file, $functi return add_submenu_page( 'themes.php', $page_title, $menu_title, $access_level, $file, $function ); } +function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { + if ( current_user_can('edit_users') ) + $parent = 'users.php'; + else + $parent = 'profile.php'; + return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function ); +} + function validate_file( $file, $allowed_files = '' ) { if ( false !== strpos( $file, './' )) return 1; @@ -1771,7 +1779,8 @@ function browse_happy() {

Browse Happy

'; } -if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'MSIE' )) + +if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) add_action( 'admin_footer', 'browse_happy' ); function documentation_link( $for ) { @@ -1932,14 +1941,14 @@ function wp_import_cleanup( $id ) { function wp_import_upload_form( $action ) { $size = strtolower( ini_get( 'upload_max_filesize' ) ); $bytes = 0; - if ( strstr( $size, 'k' ) ) + if (strpos($size, 'k') !== false) $bytes = $size * 1024; - if ( strstr( $size, 'm' ) ) + if (strpos($size, 'm') !== false) $bytes = $size * 1024 * 1024; - if ( strstr( $size, 'g' ) ) + if (strpos($size, 'g') !== false) $bytes = $size * 1024 * 1024 * 1024; ?> -
+

( ) diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 30afb3a..34f6d7d 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -44,7 +44,7 @@ do_action('admin_head');

%s.'), $user_identity) ?> [, ]

diff --git a/wp-admin/cat.js b/wp-admin/cat.js new file mode 100644 index 0000000..ab94d4c --- /dev/null +++ b/wp-admin/cat.js @@ -0,0 +1,10 @@ +addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;}); +addLoadEvent(newCatAddIn); +function newCatAddIn() { + var jaxcat = $('jaxcat'); + if ( !jaxcat ) + return false; + Element.update(jaxcat,'' + catL10n.how + ''); + $('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); }; + $('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); }; +} diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 1b913c2..5daad1e 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -174,7 +174,7 @@ Event.observe( window, 'load', hide_text );

%1$d x %2$d pixels will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?>

- +

@@ -188,7 +188,7 @@ Event.observe( window, 'load', hide_text );

- +
@@ -240,7 +240,7 @@ Event.observe( window, 'load', hide_text );
-
+

diff --git a/wp-admin/dbx-admin-key.js b/wp-admin/dbx-admin-key.js new file mode 100644 index 0000000..9ea666c --- /dev/null +++ b/wp-admin/dbx-admin-key.js @@ -0,0 +1,47 @@ +addLoadEvent( function() {var manager = new dbxManager( dbxL10n.mananger );} ); + +addLoadEvent( function() +{ + //create new docking boxes group + var meta = new dbxGroup( + 'grabit', // container ID [/-_a-zA-Z0-9/] + 'vertical', // orientation ['vertical'|'horizontal'] + '10', // drag threshold ['n' pixels] + 'no', // restrict drag movement to container axis ['yes'|'no'] + '10', // animate re-ordering [frames per transition, or '0' for no effect] + 'yes', // include open/close toggle buttons ['yes'|'no'] + 'closed', // default state ['open'|'closed'] + dbxL10n.open, // word for "open", as in "open this box" + dbxL10n.close, // word for "close", as in "close this box" + dbxL10n.moveMouse, // sentence for "move this box" by mouse + dbxL10n.toggleMouse, // pattern-match sentence for "(open|close) this box" by mouse + dbxL10n.moveKey, // sentence for "move this box" by keyboard + dbxL10n.toggleKey, // pattern-match sentence-fragment for "(open|close) this box" by keyboard + '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts + ); + + // Boxes are closed by default. Open the Category box if the cookie isn't already set. + var catdiv = document.getElementById('categorydiv'); + if ( catdiv ) { + var button = catdiv.getElementsByTagName('A')[0]; + if ( dbx.cookiestate == null && /dbx\-toggle\-closed/.test(button.className) ) + meta.toggleBoxState(button, true); + } + + var advanced = new dbxGroup( + 'advancedstuff', + 'vertical', + '10', + 'yes', // restrict drag movement to container axis ['yes'|'no'] + '10', + 'yes', + 'closed', + dbxL10n.open, + dbxL10n.close, + dbxL10n.moveMouse, + dbxL10n.toggleMouse, + dbxL10n.moveKey, + dbxL10n.toggleKey, + '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts + ); +}); diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 5d1d8f5..4ba2479 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -101,7 +101,7 @@ $total_pages = ceil( $total / 20 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : @@ -111,7 +111,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? FALSE : $page_num; - $r .= '' . ( $page_num ) . "\n"; + $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; @@ -122,7 +122,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { } if ( ( $page ) * 20 < $total || -1 == $total ) { $args['apage'] = $page + 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } echo ""; ?> @@ -153,7 +153,7 @@ $start = " start='$offset'"; -

— [ +

— [ comment_post_ID) ) { echo " " . __('Edit') . ''; @@ -248,7 +248,7 @@ $total_pages = ceil( $total / 20 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : @@ -258,7 +258,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? FALSE : $page_num; - $r .= '' . ( $page_num ) . "\n"; + $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; @@ -269,7 +269,7 @@ if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { } if ( ( $page ) * 20 < $total || -1 == $total ) { $args['apage'] = $page + 1; - $r .= '' . "\n"; + $r .= '' . "\n"; } echo "

"; ?> diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 1426ece..520bfbd 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -244,7 +244,7 @@ list_meta($metadata);
-post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> +post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 3935584..41381d9 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -22,9 +22,9 @@ function xfn_check($class, $value = '', $type = 'check') { } if ('' == $value) { - if ('family' == $class && !strstr($link_rel, 'child') && !strstr($link_rel, 'parent') && !strstr($link_rel, 'sibling') && !strstr($link_rel, 'spouse') && !strstr($link_rel, 'kin')) echo ' checked="checked"'; - if ('friendship' == $class && !strstr($link_rel, 'friend') && !strstr($link_rel, 'acquaintance') && !strstr($link_rel, 'contact') ) echo ' checked="checked"'; - if ('geographical' == $class && !strstr($link_rel, 'co-resident') && !strstr($link_rel, 'neighbor') ) echo ' checked="checked"'; + 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"'; } } diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 6b47fe4..44a3ddb 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -21,14 +21,14 @@ if ($drafts || $other_drafts) { foreach ($drafts as $draft) { if (0 != $i) echo ', '; - $draft->post_title = stripslashes($draft->post_title); + $draft->post_title = apply_filters('the_title', stripslashes($draft->post_title)); if ($draft->post_title == '') $draft->post_title = sprintf(__('Post #%s'), $draft->ID); echo "$draft->post_title"; ++$i; } ?> - .

+.

@@ -38,7 +38,7 @@ if ($drafts || $other_drafts) { foreach ($other_drafts as $draft) { if (0 != $i) echo ', '; - $draft->post_title = stripslashes($draft->post_title); + $draft->post_title = apply_filters('the_title', stripslashes($draft->post_title)); if ($draft->post_title == '') $draft->post_title = sprintf(__('Post #%s'), $draft->ID); echo "$draft->post_title"; @@ -177,7 +177,7 @@ foreach($posts_columns as $column_name=>$column_display_name) { case 'date': ?> - post_modified ) _e('Unpublished'); else the_time(_('Y-m-d \<\b\r \/\> g:i:s a')); ?> + post_modified ) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?> in_content = array(); } else { $endtag = $this->ns_to_prefix($name); - if(strstr($this->in_content[count($this->in_content)-1], "<$endtag")) { + if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) { array_push($this->in_content, "/>"); } else { array_push($this->in_content, ""); @@ -969,7 +969,7 @@ class AtomParser { #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n"; if(!empty($this->in_content)) { // handle self-closing tags (case: text node found, need to close element started) - if(strstr($this->in_content[count($this->in_content)-1], "<")) { + if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { array_push($this->in_content, ">"); } array_push($this->in_content, $this->xml_escape($data)); diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php index fca6c3e..1e48fe8 100644 --- a/wp-admin/link-add.php +++ b/wp-admin/link-add.php @@ -28,7 +28,7 @@ require('admin-header.php'); diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 8c67b4a..37e9714 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -6,11 +6,11 @@ // The URL of the item's file $menu[0] = array(__('Dashboard'), 'read', 'index.php'); -if ( strstr($_SERVER['REQUEST_URI'], 'edit-pages.php') ) +if (strpos($_SERVER['REQUEST_URI'], 'edit-pages.php') !== false) $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php'); else $menu[5] = array(__('Write'), 'edit_posts', 'post-new.php'); -if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') ) +if (strpos($_SERVER['REQUEST_URI'], 'page-new.php') !== false) $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php'); else $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php'); diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php index e6d735b..e24a9a1 100644 --- a/wp-admin/moderation.php +++ b/wp-admin/moderation.php @@ -121,7 +121,7 @@ $i = 0; ?>

comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

-

— [ — [ comment_ID.'">' . __('Edit') . ' | '; echo " comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\">" . __('Delete') . " | "; ?> 1 ) { +if( is_array( $lang_files ) && count($lang_files) >= 1 ) { ?> - - - + Default"; while( list( $key, $val ) = each( $lang_files ) ) { $l = basename( $val, ".mo" ); echo "

/> -

+

diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index 59e1c49..1f70b74 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -41,7 +41,7 @@ endforeach; - + "; + if (strpos($value, "\n") !== false) echo ""; else echo ""; echo " diff --git a/wp-admin/page.php b/wp-admin/page.php index d5bb932..4a29c37 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -149,8 +149,8 @@ case 'delete': } $sendback = wp_get_referer(); - if (strstr($sendback, 'page.php')) $sendback = get_option('siteurl') .'/wp-admin/page.php'; - elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; + if (strpos($sendback, 'page.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/page.php'; + elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index bd80c2e..b2d9be3 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -123,7 +123,7 @@ if (empty($plugins)) { if ( $style != '' ) $style = 'class="' . $style . '"'; - if ( is_writable(ABSPATH . 'wp-content/plugins/' . $plugin_file) ) + if ( is_writable(ABSPATH . PLUGINDIR . '/' . $plugin_file) ) $edit = "".__('Edit').""; else $edit = ''; diff --git a/wp-admin/post.php b/wp-admin/post.php index 163e220..b191661 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -160,8 +160,8 @@ case 'delete': } $sendback = wp_get_referer(); - if (strstr($sendback, 'post.php')) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; - elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; + if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; + elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 17846d6..41e9787 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -158,13 +158,13 @@ switch($step) { foreach ($configFile as $line_num => $line) { switch (substr($line,0,16)) { case "define('DB_NAME'": - fwrite($handle, str_replace("wordpress", $dbname, $line)); + fwrite($handle, str_replace("putyourdbnamehere", $dbname, $line)); break; case "define('DB_USER'": - fwrite($handle, str_replace("'username'", "'$uname'", $line)); + fwrite($handle, str_replace("'usernamehere'", "'$uname'", $line)); break; case "define('DB_PASSW": - fwrite($handle, str_replace("'password'", "'$passwrd'", $line)); + fwrite($handle, str_replace("'yourpasswordhere'", "'$passwrd'", $line)); break; case "define('DB_HOST'": fwrite($handle, str_replace("localhost", $dbhost, $line)); diff --git a/wp-admin/templates.php b/wp-admin/templates.php index 7453992..7f9063f 100644 --- a/wp-admin/templates.php +++ b/wp-admin/templates.php @@ -53,7 +53,7 @@ default: if ( ! current_user_can('edit_files') ) wp_die('

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

'); - if ( strstr( $file, 'wp-config.php' ) ) + if (strpos($file, 'wp-config.php') !== false) wp_die('

'.__('The config file cannot be edited or viewed through the web interface. Sorry!').'

'); update_recently_edited($file); diff --git a/wp-admin/themes.php b/wp-admin/themes.php index ee244db..af7791f 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -61,7 +61,7 @@ require_once('admin-header.php');

-

View site »'), get_bloginfo('home') . '/'); ?>

+

View site »'), get_bloginfo('url') . '/'); ?>

@@ -69,9 +69,9 @@ require_once('admin-header.php');

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

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

+

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

description; ?>

@@ -98,11 +98,11 @@ foreach ($theme_names as $theme_name) { $activate_link = wp_nonce_url("themes.php?action=activate&template=$template&stylesheet=$stylesheet", 'switch-theme_' . $template); ?>
-

+

- + diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index e0c347c..b7a1f93 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -451,7 +451,7 @@ function upgrade_160() { if ( 0 == $wpdb->get_var("SELECT SUM(category_count) FROM $wpdb->categories") ) { // Create counts $categories = $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories"); foreach ( $categories as $cat_id ) { - $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat, $wpdb->posts WHERE $wpdb->posts.ID=$wpdb->post2cat.post_id AND post_type='post' AND post_status='publish' AND category_id = '$cat_id'"); + $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat, $wpdb->posts WHERE $wpdb->posts.ID=$wpdb->post2cat.post_id AND post_status='publish' AND category_id = '$cat_id'"); $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'"); } } @@ -931,7 +931,7 @@ function make_site_theme_from_oldschool($theme_name, $template) { if ($oldfile == 'index.php') { // Check to make sure it's not a new index $index = implode('', file("$oldpath/$oldfile")); - if ( strstr( $index, 'WP_USE_THEMES' ) ) { + if (strpos($index, 'WP_USE_THEMES') !== false) { if (! @copy(ABSPATH . 'wp-content/themes/default/index.php', "$site_dir/$newfile")) return false; continue; // Don't copy anything @@ -1003,12 +1003,12 @@ function make_site_theme_from_default($theme_name, $template) { $f = fopen("$site_dir/style.css", 'w'); foreach ($stylelines as $line) { - if (strstr($line, "Theme Name:")) $line = "Theme Name: $theme_name"; - elseif (strstr($line, "Theme URI:")) $line = "Theme URI: " . __get_option('siteurl'); - elseif (strstr($line, "Description:")) $line = "Description: Your theme"; - elseif (strstr($line, "Version:")) $line = "Version: 1"; - elseif (strstr($line, "Author:")) $line = "Author: You"; - fwrite($f, "{$line}\n"); + if (strpos($line, 'Theme Name:') !== false) $line = 'Theme Name: ' . $theme_name; + elseif (strpos($line, 'Theme URI:') !== false) $line = 'Theme URI: ' . __get_option('url'); + elseif (strpos($line, 'Description:') !== false) $line = 'Description: Your theme.'; + elseif (strpos($line, 'Version:') !== false) $line = 'Version: 1'; + elseif (strpos($line, 'Author:') !== false) $line = 'Author: You'; + fwrite($f, $line . "\n"); } fclose($f); } diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index c2b5519..1f79fb7 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -18,7 +18,7 @@ function wp_upload_display( $dims = false, $href = '' ) { the_title(); $post_title = attribute_escape(ob_get_contents()); ob_end_clean(); - $post_content = apply_filters( 'content_edit_pre', $post->post_content ); + $post_content = attribute_escape(apply_filters( 'content_edit_pre', $post->post_content )); $class = 'text'; $innerHTML = get_attachment_innerHTML( $id, false, $dims ); diff --git a/wp-admin/upload.js b/wp-admin/upload.js new file mode 100644 index 0000000..a77e9d1 --- /dev/null +++ b/wp-admin/upload.js @@ -0,0 +1,273 @@ +addLoadEvent( function() { + theFileList = { + currentImage: {ID: 0}, + nonce: '', + tab: '', + postID: 0, + + initializeVars: function() { + this.urlData = document.location.href.split('?'); + this.params = this.urlData[1].toQueryParams(); + this.postID = this.params['post_id']; + this.tab = this.params['tab']; + this.style = this.params['style']; + this.ID = this.params['ID']; + if ( !this.style ) + this.style = 'default'; + var nonceEl = $('nonce-value'); + if ( nonceEl ) + this.nonce = nonceEl.value; + if ( this.ID ) { + this.grabImageData( this.ID ); + this.imageView( this.ID ); + } + }, + + initializeLinks: function() { + if ( this.ID ) + return; + $$('a.file-link').each( function(i) { + var id = i.id.split('-').pop(); + i.onclick = function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); } + } ); + }, + + grabImageData: function(id) { + if ( id == this.currentImage.ID ) + return; + var thumbEl = $('attachment-thumb-url-' + id); + if ( thumbEl ) { + this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value ); + this.currentImage.thumbBase = ( 0 == id ? '' : $('attachment-thumb-url-base-' + id).value ); + } else { + this.currentImage.thumb = false; + } + this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value ); + this.currentImage.srcBase = ( 0 == id ? '' : $('attachment-url-base-' + id).value ); + this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value ); + this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value ); + this.currentImage.description = ( 0 == id ? '' : $('attachment-description-' + id).value ); + var widthEl = $('attachment-width-' + id); + if ( widthEl ) { + this.currentImage.width = ( 0 == id ? '' : widthEl.value ); + this.currentImage.height = ( 0 == id ? '' : $('attachment-height-' + id).value ); + } else { + this.currentImage.width = false; + this.currentImage.height = false; + } + this.currentImage.isImage = ( 0 == id ? 0 : $('attachment-is-image-' + id).value ); + this.currentImage.ID = id; + }, + + imageView: function(id, e) { + this.prepView(id); + var h = ''; + + h += "
" + if ( this.ID ) { + var params = $H(this.params); + params.ID = ''; + params.action = ''; + h += "" + this.back + ""; + h += "
" + if ( 0 == this.currentImage.isImage ) + h += "

" + this.currentImage.title + "

"; + else + h += "

" + this.currentImage.title + "

"; + h += " — "; + h += "" + this.edit + "" + h += ""; + h += '
' + h += "
"; + if ( 1 == this.currentImage.isImage ) { + h += ""; + h += "" + this.currentImage.title + ""; + h += ""; + } else + h += ' '; + h += "
"; + + h += ""; + h += ""; + var display = []; + var checked = 'display-title'; + if ( 1 == this.currentImage.isImage ) { + checked = 'display-full'; + if ( this.currentImage.thumb ) { + display.push("
"); + checked = 'display-thumb'; + } + display.push(""); + } else if ( this.currentImage.thumb ) { + display.push(""); + } + if ( display.length ) { + display.push("
"); + h += ""; + } + + h += ""; + + h += "
" + this.show + ""; + $A(display).each( function(i) { h += i; } ); + h += "
" + this.link + ""; + h += "
"; + h += "
"; + h += ""; + h += "

"; + h += ""; + h += "

"; + h += ""; + + h += "
"; + + new Insertion.Top('upload-content', h); + var displayEl = $(checked); + if ( displayEl ) + displayEl.checked = true; + + if (e) Event.stop(e); + return false; + }, + + editView: function(id, e) { + this.prepView(id); + var h = ''; + + var action = 'upload.php?style=' + this.style + '&tab=upload'; + if ( this.postID ) + action += '&post_id=' + this.postID; + + h += "
"; + if ( this.ID ) { + var params = $H(this.params); + params.ID = ''; + params.action = ''; + h += "" + this.back + ""; + h += "
" + if ( 0 == this.currentImage.isImage ) + h += "

" + this.currentImage.title + "

"; + else + h += "

" + this.currentImage.title + "

"; + h += " — "; + h += "" + this.insert + ""; + h += ""; + h += '
' + h += "
"; + if ( 1 == this.currentImage.isImage ) { + h += ""; + h += "" + this.currentImage.title + ""; + h += ""; + } else + h += ' '; + h += "
"; + + + h += ""; + h += ""; + h += ""; + h += ""; + h += ""; + h += ""; + h += ""; + h += ""; + h += ""; + h += "
"; + h += ""; + h += ""; + h += ""; + h += ""; + h += "
"; + h += "
"; + + new Insertion.Top('upload-content', h); + if (e) Event.stop(e); + return false; + }, + + prepView: function(id) { + this.cancelView( true ); + var filesEl = $('upload-files'); + if ( filesEl ) + filesEl.hide(); + var navEl = $('current-tab-nav'); + if ( navEl ) + navEl.hide(); + this.grabImageData(id); + }, + + cancelView: function( prep ) { + if ( !prep ) { + var filesEl = $('upload-files'); + if ( filesEl ) + Element.show(filesEl); + var navEl = $('current-tab-nav'); + if ( navEl ) + Element.show(navEl); + } + if ( !this.ID ) + this.grabImageData(0); + var div = $('upload-file'); + if ( div ) + Element.remove(div); + return false; + }, + + sendToEditor: function(id) { + this.grabImageData(id); + var link = ''; + var display = ''; + var h = ''; + + link = $A(document.forms.uploadoptions.elements.link).detect( function(i) { return i.checked; } ).value; + displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } ) + if ( displayEl ) + display = displayEl.value; + else if ( 1 == this.currentImage.isImage ) + display = 'full'; + + if ( 'none' != link ) + h += ""; + if ( display && 'title' != display ) + h += "" + this.currentImage.title + ""; + else + h += this.currentImage.title; + if ( 'none' != link ) + h += ""; + + var win = window.opener ? window.opener : window.dialogArguments; + if ( !win ) + win = top; + tinyMCE = win.tinyMCE; + if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) { + tinyMCE.selectedInstance.getWin().focus(); + tinyMCE.execCommand('mceInsertContent', false, h); + } else + win.edInsertContent(win.edCanvas, h); + if ( !this.ID ) + this.cancelView(); + return false; + }, + + deleteFile: function(id) { + if ( confirm( this.confirmText.replace(/%title%/g, this.currentImage.title) ) ) { + $('action-value').value = 'delete'; + $('upload-file').submit(); + return true; + } + return false; + } + + }; + Object.extend( theFileList, uploadL10n ); + theFileList.initializeVars(); + theFileList.initializeLinks(); +} ); diff --git a/wp-blog-header.php b/wp-blog-header.php index 18863b6..b7ab2ef 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -2,7 +2,7 @@ if (! isset($wp_did_header)): if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) { - if ( strstr( $_SERVER['PHP_SELF'], 'wp-admin') ) $path = ''; + if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = ''; else $path = 'wp-admin/'; include( "index-install.php" ); // install WPMU! die(); diff --git a/wp-config-sample.php b/wp-config-sample.php index 8e93ea1..b968f59 100644 --- a/wp-config-sample.php +++ b/wp-config-sample.php @@ -12,9 +12,8 @@ $base = 'BASE'; // double check $base if( $base == 'BASE' ) die( 'Problem in wp-config.php - $base is set to BASE when it should be the path like "/" or "/blogs/"! Please fix it!' ); - -// Change the prefix if you want to have multiple blogs in a single database. -$table_prefix = 'wp_'; // example: 'wp_' or 'b2' or 'mylogin_' +// You can have multiple installations in one database if you give each a unique prefix +$table_prefix = 'wp_'; // Only numbers, letters, and underscores please! // Change this to localize WordPress. A corresponding MO file for the // chosen language must be installed to wp-includes/languages. diff --git a/wp-content/themes/default/functions.php b/wp-content/themes/default/functions.php index 5a6400e..5079fce 100644 --- a/wp-content/themes/default/functions.php +++ b/wp-content/themes/default/functions.php @@ -25,7 +25,7 @@ function kubrick_header_image() { } function kubrick_upper_color() { - if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { + if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { parse_str(substr($url, strpos($url, '?') + 1), $q); return $q['upper']; } else @@ -33,7 +33,7 @@ function kubrick_upper_color() { } function kubrick_lower_color() { - if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { + if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { parse_str(substr($url, strpos($url, '?') + 1), $q); return $q['lower']; } else diff --git a/wp-content/themes/default/searchform.php b/wp-content/themes/default/searchform.php index c6f7140..2282083 100644 --- a/wp-content/themes/default/searchform.php +++ b/wp-content/themes/default/searchform.php @@ -1,4 +1,4 @@ -
+
diff --git a/wp-content/themes/default/sidebar.php b/wp-content/themes/default/sidebar.php index 5e6745b..6834dbc 100644 --- a/wp-content/themes/default/sidebar.php +++ b/wp-content/themes/default/sidebar.php @@ -25,23 +25,23 @@

You are currently browsing the archives for the category.

-

You are currently browsing the weblog archives +

You are currently browsing the weblog archives for the day .

-

You are currently browsing the weblog archives +

You are currently browsing the weblog archives for .

-

You are currently browsing the weblog archives +

You are currently browsing the weblog archives for the year .

-

You have searched the weblog archives +

You have searched the weblog 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 weblog archives.

+

You are currently browsing the weblog archives.

diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index e73edd7..54b6d15 100644 --- a/wp-includes/bookmark-template.php +++ b/wp-includes/bookmark-template.php @@ -326,15 +326,13 @@ function wp_list_bookmarks($args = '') { $output = ''; - if ( is_array($class) ) - $class = trim(join(' ', $class)); - if ( $categorize ) { //Split the bookmarks into ul's for each category $cats = get_categories("type=link&category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0"); foreach ( (array) $cats as $cat ) { - $bookmarks = get_bookmarks("limit=$limit&category={$cat->cat_ID}&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_invisible&show_updated=$show_updated"); + $params = array_merge($r, array('category'=>$cat->cat_ID)); + $bookmarks = get_bookmarks($params); if ( empty($bookmarks) ) continue; $output .= str_replace(array('%id', '%class'), array("linkcat-$cat->cat_ID", $class), $category_before); @@ -344,7 +342,7 @@ function wp_list_bookmarks($args = '') { } } else { //output one single list using title_li for the title - $bookmarks = get_bookmarks("limit=$limit&category=$category&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_invisible&show_updated=$show_updated"); + $bookmarks = get_bookmarks($r); if ( !empty($bookmarks) ) { if ( !empty( $title_li ) ){ diff --git a/wp-includes/classes.php b/wp-includes/classes.php index e8563ec..8c8dcd0 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -58,7 +58,7 @@ class WP { // front. For path info requests, this leaves us with the requesting // filename, if any. For 404 requests, this leaves us with the // requested permalink. - $req_uri = str_replace($pathinfo, '', urldecode($req_uri)); + $req_uri = str_replace($pathinfo, '', rawurldecode($req_uri)); $req_uri = trim($req_uri, '/'); $req_uri = preg_replace("|^$home_path|", '', $req_uri); $req_uri = trim($req_uri, '/'); @@ -120,14 +120,14 @@ class WP { } // If req_uri is empty or if it is a request for ourself, unset error. - if ( empty($request) || $req_uri == $self || strstr($_SERVER['PHP_SELF'], 'wp-admin/') ) { + if (empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) { if (isset($_GET['error'])) unset($_GET['error']); if (isset($error)) unset($error); - if ( isset($perma_query_vars) && strstr($_SERVER['PHP_SELF'], 'wp-admin/') ) + if (isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) unset($perma_query_vars); $this->did_permalink = false; @@ -148,6 +148,8 @@ class WP { $this->query_vars[$wpvar] = $_GET[$wpvar]; elseif (!empty($perma_query_vars[$wpvar])) $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; + + $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; } foreach ($this->private_query_vars as $var) { diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 0782f33..ea3ce15 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -239,19 +239,19 @@ function trackback_url( $display = true ) { function trackback_rdf($timezone = 0) { global $id; - if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) { - echo ' - \n"; - echo ''; + if (strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) { + echo ' + \n"; + echo ''; } } diff --git a/wp-includes/cron.php b/wp-includes/cron.php index 40004ca..e9a6462 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -83,8 +83,18 @@ function spawn_cron() { $cron_url = get_option( 'siteurl' ) . '/wp-cron.php'; $parts = parse_url( $cron_url ); - - $argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 ); + + if ($parts['scheme'] == 'https') { + // support for SSL was added in 4.3.0 + if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) { + $argyle = @fsockopen('ssl://' . $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01); + } else { + return false; + } + } else { + $argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 ); + } + if ( $argyle ) fputs( $argyle, "GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n" diff --git a/wp-includes/feed.php b/wp-includes/feed.php index f7db8bf..687a304 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -165,7 +165,7 @@ function the_category_rss($type = 'rss') { function html_type_rss() { $type = get_bloginfo('html_type'); - if ( strstr( $type, 'xhtml' ) ) + if (strpos($type, 'xhtml') !== false) $type = 'xhtml'; else $type = 'html'; diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index daafba3..718a217 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -29,10 +29,9 @@ function wptexturize($text) { if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag // static strings $curl = str_replace($static_characters, $static_replacements, $curl); - // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); - } elseif ( strstr($curl, ']*>)\s*
!', "$1", $pee); $pee = preg_replace('!
(\s*]*>)!', '$1', $pee); - if ( strstr( $pee, ')(.*?)!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '' ", $pee); $pee = preg_replace( "|\n

$|", '

', $pee ); @@ -658,7 +657,7 @@ function convert_smilies($text) { function is_email($user_email) { $chars = "/^([a-z0-9+_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,6}\$/i"; - if(strstr($user_email, '@') && strstr($user_email, '.')) { + if (strpos($user_email, '@') !== false && strpos($user_email, '.') !== false) { if (preg_match($chars, $user_email)) { return true; } else { @@ -1072,7 +1071,7 @@ function clean_url( $url, $protocols = null ) { $strip = array('%0d', '%0a'); $url = str_replace($strip, '', $url); $url = str_replace(';//', '://', $url); - $url = (!strstr($url, '://')) ? 'http://'.$url : $url; + $url = (strpos($url, '://') === false) ? 'http://'.$url : $url; $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); if ( !is_array($protocols) ) $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 19eaa81..d843b39 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -797,7 +797,7 @@ function add_query_arg() { $protocol = ''; } - if ( strstr($uri, '?') ) { + if (strpos($uri, '?') !== false) { $parts = explode('?', $uri, 2); if ( 1 == count($parts) ) { $base = '?'; @@ -806,7 +806,7 @@ function add_query_arg() { $base = $parts[0] . '?'; $query = $parts[1]; } - } else if ( !empty($protocol) || strstr($uri, '/') ) { + } elseif (!empty($protocol) || strpos($uri, '/') !== false) { $base = $uri . '?'; $query = ''; } else { @@ -1134,17 +1134,28 @@ function wp_upload_bits($name, $type, $bits, $overwrite = false) { $ext = ''; else $ext = ".$ext"; - while ( file_exists($upload['path'] . "/$filename") && !$overwrite ) { + while ( file_exists($upload['path'] . "/$filename") ) { if ( '' == "$number$ext" ) $filename = $filename . ++$number . $ext; else $filename = str_replace("$number$ext", ++$number . $ext, $filename); } - $new_file = $upload['path'] . "/$filename"; - if ( ! wp_mkdir_p( dirname($new_file) ) ) { - $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), dirname($new_file)); - return array('error' => $message); + // If we are asked to over write the file then make sure + // the $name has the complete path and is writable. + if($overwrite) { + if(!is_writable($name)) { + return(array("error" => __("Can not over write file."))); + } + $new_file = $name; + $filename = basename($name); + } + else { + $new_file = $upload['path'] . "/$filename"; + if ( ! wp_mkdir_p( dirname($new_file) ) ) { + $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), dirname($new_file)); + return array('error' => $message); + } } $ifp = @ fopen($new_file, 'wb'); @@ -1159,8 +1170,11 @@ function wp_upload_bits($name, $type, $bits, $overwrite = false) { $perms = $perms & 0000666; @ chmod($new_file, $perms); - // Compute the URL + // Compute the URL if this is a new file. $url = $upload['url'] . "/$filename"; + if($overwrite) { + $url = $name; + } return array('file' => $new_file, 'url' => $url, 'error' => false); } @@ -1289,7 +1303,7 @@ function wp_nonce_ays($action) { $adminurl = get_option('siteurl') . '/wp-admin'; if ( wp_get_referer() ) - $adminurl = wp_specialchars(wp_get_referer(), 1); + $adminurl = attribute_escape(wp_get_referer()); $title = __('WordPress Confirmation'); // Remove extra layer of slashes. @@ -1342,7 +1356,7 @@ function wp_die( $message, $title = '' ) { if ( empty($title) ) $title = __('WordPress › Error'); - if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) + if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $admin_dir = ''; else $admin_dir = 'wp-admin/'; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index b0fd238..81d696c 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -60,9 +60,11 @@ function wp_meta() { function bloginfo($show='') { $info = get_bloginfo($show); - if (!strstr($show, 'url') && //don't filter URLs - !strstr($show, 'directory') && - !strstr($show, 'home')) { + + // Don't filter URL's. + if (strpos($show, 'url') === false || + strpos($show, 'directory') === false || + strpos($show, 'home') === false) { $info = apply_filters('bloginfo', $info, $show); $info = convert_chars($info); } else { @@ -72,13 +74,18 @@ function bloginfo($show='') { echo $info; } - +/** + * Note: some of these values are DEPRECATED. Meaning they could be + * taken out at any time and shouldn't be relied upon. Options + * without "// DEPRECATED" are the preferred and recommended ways + * to get the information. + */ function get_bloginfo($show='') { switch($show) { case 'url' : - case 'home' : - case 'siteurl' : + case 'home' : // DEPRECATED + case 'siteurl' : // DEPRECATED $output = get_option('home'); break; case 'wpurl' : @@ -149,8 +156,7 @@ function get_bloginfo($show='') { function wp_title($sep = '»', $display = true) { - global $wpdb; - global $m, $year, $monthnum, $day, $category_name, $wp_locale, $posts; + global $wpdb, $wp_locale, $wp_query; $cat = get_query_var('cat'); $p = get_query_var('p'); @@ -158,6 +164,10 @@ function wp_title($sep = '»', $display = true) { $category_name = get_query_var('category_name'); $author = get_query_var('author'); $author_name = get_query_var('author_name'); + $m = get_query_var('m'); + $year = get_query_var('year'); + $monthnum = get_query_var('monthnum'); + $day = get_query_var('day'); $title = ''; // If there's a category @@ -165,8 +175,7 @@ function wp_title($sep = '»', $display = true) { // category exclusion if ( !stristr($cat,'-') ) $title = apply_filters('single_cat_title', get_the_category_by_ID($cat)); - } - if ( !empty($category_name) ) { + } elseif ( !empty($category_name) ) { if ( stristr($category_name,'/') ) { $category_name = explode('/',$category_name); if ( $category_name[count($category_name)-1] ) @@ -198,14 +207,15 @@ function wp_title($sep = '»', $display = true) { if ( !empty($year) ) { $title = $year; if ( !empty($monthnum) ) - $title .= " $sep ".$wp_locale->get_month($monthnum); + $title .= " $sep " . $wp_locale->get_month($monthnum); if ( !empty($day) ) - $title .= " $sep ".zeroise($day, 2); + $title .= " $sep " . zeroise($day, 2); } // If there is a post if ( is_single() || is_page() ) { - $title = strip_tags($posts[0]->post_title); + $post = $wp_query->get_queried_object(); + $title = strip_tags($post->post_title); $title = apply_filters('single_post_title', $title); } @@ -258,7 +268,12 @@ function single_cat_title($prefix = '', $display = true ) { function single_month_title($prefix = '', $display = true ) { - global $m, $monthnum, $wp_locale, $year; + global $wp_locale; + + $m = get_query_var('m'); + $year = get_query_var('year'); + $monthnum = get_query_var('monthnum'); + if ( !empty($monthnum) && !empty($year) ) { $my_year = $year; $my_month = $wp_locale->get_month($monthnum); @@ -336,12 +351,12 @@ function wp_get_archives($args = '') { $add_hours = intval(get_option('gmt_offset')); $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours)); + //filters + $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r ); + $join = apply_filters('getarchives_join', "", $r); + if ( 'monthly' == $type ) { - $arcresults = wp_cache_get( md5('archives' . $type . $limit), 'general'); - if ( !$arcresults ) { - $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); - wp_cache_set( md5('archives' . $type . $limit), $arcresults, 'general', 86400 ); - } + $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); if ( $arcresults ) { $afterafter = $after; foreach ( $arcresults as $arcresult ) { @@ -353,7 +368,7 @@ function wp_get_archives($args = '') { } } } elseif ('yearly' == $type) { - $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts WHERE post_type ='post' AND post_status = 'publish' GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit); + $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit); if ($arcresults) { $afterafter = $after; foreach ($arcresults as $arcresult) { @@ -365,7 +380,7 @@ function wp_get_archives($args = '') { } } } elseif ( 'daily' == $type ) { - $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit); + $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit); if ( $arcresults ) { $afterafter = $after; foreach ( $arcresults as $arcresult ) { @@ -379,7 +394,7 @@ function wp_get_archives($args = '') { } } elseif ( 'weekly' == $type ) { $start_of_week = get_option('start_of_week'); - $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC" . $limit); + $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC" . $limit); $arc_w_last = ''; $afterafter = $after; if ( $arcresults ) { @@ -400,7 +415,7 @@ function wp_get_archives($args = '') { } } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { ('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC "; - $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY $orderby $limit"); + $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where $orderby $limit"); if ( $arcresults ) { foreach ( $arcresults as $arcresult ) { if ( $arcresult->post_date != '0000-00-00 00:00:00' ) { @@ -552,9 +567,7 @@ function get_calendar($initial = true) { $daywithpost = array(); } - - - if ( strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') ) + if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false) $ak_title_separator = "\n"; else $ak_title_separator = ', '; diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js new file mode 100644 index 0000000..ae2c105 --- /dev/null +++ b/wp-includes/js/autosave.js @@ -0,0 +1,158 @@ +var autosaveLast = ''; +var autosavePeriodical; + +function autosave_start_timer() { + var form = $('post'); + autosaveLast = form.post_title.value+form.content.value; + // Keep autosave_interval in sync with edit_post(). + autosavePeriodical = new PeriodicalExecuter(autosave, autosaveL10n.autosaveInterval); + //Disable autosave after the form has been submitted + if(form.addEventListener) { + form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false); + } + if(form.attachEvent) { + form.save ? form.save.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; + form.submit ? form.submit.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; + form.publish ? form.publish.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; + form.deletepost ? form.deletepost.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; + } +} +addLoadEvent(autosave_start_timer) + +function autosave_cur_time() { + var now = new Date(); + return "" + ((now.getHours() >12) ? now.getHours() -12 : now.getHours()) + + ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes() + + ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds(); +} + +function autosave_update_nonce() { + var response = nonceAjax.response; + document.getElementsByName('_wpnonce')[0].value = response; +} + +function autosave_update_post_ID() { + var response = autosaveAjax.response; + var res = parseInt(response); + var message; + + if(isNaN(res)) { + message = autosaveL10n.errorText.replace(/%response%/g, response); + } else { + message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time()); + $('post_ID').name = "post_ID"; + $('post_ID').value = res; + // We need new nonces + nonceAjax = new sack(); + nonceAjax.element = null; + nonceAjax.setVar("action", "autosave-generate-nonces"); + nonceAjax.setVar("post_ID", res); + nonceAjax.setVar("cookie", document.cookie); + nonceAjax.setVar("post_type", $('post_type').value); + nonceAjax.requestFile = autosaveL10n.requestFile; + nonceAjax.onCompletion = autosave_update_nonce; + nonceAjax.method = "POST"; + nonceAjax.runAJAX(); + $('hiddenaction').value = 'editpost'; + } + $('autosave').innerHTML = message; + autosave_enable_buttons(); +} + +function autosave_loading() { + $('autosave').innerHTML = autosaveL10n.savingText; +} + +function autosave_saved() { + var response = autosaveAjax.response; + var res = parseInt(response); + var message; + + if(isNaN(res)) { + message = autosaveL10n.errorText.replace(/%response%/g, response); + } else { + message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time()); + } + $('autosave').innerHTML = message; + autosave_enable_buttons(); +} + +function autosave_disable_buttons() { + var form = $('post'); + form.save ? form.save.disabled = 'disabled' : null; + form.submit ? form.submit.disabled = 'disabled' : null; + form.publish ? form.publish.disabled = 'disabled' : null; + form.deletepost ? form.deletepost.disabled = 'disabled' : null; + setTimeout('autosave_enable_buttons();', 1000); // Re-enable 1 sec later. Just gives autosave a head start to avoid collisions. +} + +function autosave_enable_buttons() { + var form = $('post'); + form.save ? form.save.disabled = '' : null; + form.submit ? form.submit.disabled = '' : null; + form.publish ? form.publish.disabled = '' : null; + form.deletepost ? form.deletepost.disabled = '' : null; +} + +function autosave() { + var form = $('post'); + var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false; + + autosaveAjax = new sack(); + + /* Gotta do this up here so we can check the length when tinyMCE is in use */ + if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) { + autosaveAjax.setVar("content", form.content.value); + } else { + // Don't run while the TinyMCE spellcheck is on. + if(tinyMCE.selectedInstance.spellcheckerOn) return; + tinyMCE.wpTriggerSave(); + autosaveAjax.setVar("content", form.content.value); + } + + if(form.post_title.value.length==0 || form.content.value.length==0 || form.post_title.value+form.content.value == autosaveLast) + return; + + autosave_disable_buttons(); + + autosaveLast = form.post_title.value+form.content.value; + + cats = document.getElementsByName("post_category[]"); + goodcats = ([]); + for(i=0;i= 0 ? '&' : '?') + q; + options.data = null; // data is null for 'get' + } + else + options.data = q; // data is the query string for 'post' + + var $form = this, callbacks = []; + if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); + if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); + + // perform a load on the target only if dataType is not provided + if (!options.dataType && options.target) { + var oldSuccess = options.success || function(){}; + callbacks.push(function(data, status) { + jQuery(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, [data, status]); + }); + } + else if (options.success) + callbacks.push(options.success); + + options.success = function(data, status) { + for (var i=0, max=callbacks.length; i < max; i++) + callbacks[i](data, status); + }; + + jQuery.ajax(options); + return this; +}; + +/** + * ajaxForm() provides a mechanism for fully automating form submission. + * + * The advantages of using this method instead of ajaxSubmit() are: + * + * 1: This method will include coordinates for elements (if the element + * is used to submit the form). + * 2. This method will include the submit element's name/value data (for the element that was + * used to submit the form). + * 3. This method binds the submit() method to the form for you. + * + * Note that for accurate x/y coordinates of image submit elements in all browsers + * you need to also use the "dimensions" plugin (this method will auto-detect its presence). + * + * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely + * passes the options argument along after properly binding events for submit elements and + * the form itself. See ajaxSubmit for a full description of the options argument. + * + * + * @example + * var options = { + * target: '#myTargetDiv' + * }; + * $('#myForm').ajaxSForm(options); + * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response + * when the form is submitted. + * + * + * @example + * var options = { + * success: function(responseText) { + * alert(responseText); + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc Bind form's submit event so that server response is alerted after the form is submitted. + * + * + * @example + * var options = { + * beforeSubmit: function(formArray, jqForm) { + * if (formArray.length == 0) { + * alert('Please enter data.'); + * return false; + * } + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc Bind form's submit event so that pre-submit callback is invoked before the form + * is submitted. + * + * + * @name ajaxForm + * @param options object literal containing options which control the form submission process + * @return jQuery + * @cat Plugins/Form + * @type jQuery + * @see ajaxSubmit + * @author jQuery Community + */ +jQuery.fn.ajaxForm = function(options) { + return this.each(function() { + jQuery("input:submit,input:image,button:submit", this).click(function(ev) { + var $form = this.form; + $form.clk = this; + if (this.type == 'image') { + if (ev.offsetX != undefined) { + $form.clk_x = ev.offsetX; + $form.clk_y = ev.offsetY; + } else if (typeof jQuery.fn.offset == 'function') { // try to use dimensions plugin + var offset = jQuery(this).offset(); + $form.clk_x = ev.pageX - offset.left; + $form.clk_y = ev.pageY - offset.top; + } else { + $form.clk_x = ev.pageX - this.offsetLeft; + $form.clk_y = ev.pageY - this.offsetTop; + } + } + // clear form vars + setTimeout(function() { + $form.clk = $form.clk_x = $form.clk_y = null; + }, 10); + }) + }).submit(function(e) { + jQuery(this).ajaxSubmit(options); + return false; + }); +}; + + +/** + * formToArray() gathers form element data into an array of objects that can + * be passed to any of the following ajax functions: $.get, $.post, or load. + * Each object in the array has both a 'name' and 'value' property. An example of + * an array for a simple login form might be: + * + * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] + * + * It is this array that is passed to pre-submit callback functions provided to the + * ajaxSubmit() and ajaxForm() methods. + * + * The semantic argument can be used to force form serialization in semantic order. + * This is normally true anyway, unless the form contains input elements of type='image'. + * If your form must be submitted with name/value pairs in semantic order and your form + * contains an input of type='image" then pass true for this arg, otherwise pass false + * (or nothing) to avoid the overhead for this logic. + * + * @example var data = $("#myForm").formToArray(); + * $.post( "myscript.cgi", data ); + * @desc Collect all the data from a form and submit it to the server. + * + * @name formToArray + * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) + * @type Array + * @cat Plugins/Form + * @see ajaxForm + * @see ajaxSubmit + * @author jQuery Community + */ +jQuery.fn.formToArray = function(semantic) { + var a = []; + if (this.length == 0) return a; + + var form = this[0]; + var els = semantic ? form.getElementsByTagName('*') : form.elements; + if (!els) return a; + for(var i=0, max=els.length; i < max; i++) { + var el = els[i]; + var n = el.name; + if (!n) continue; + + if (semantic && form.clk && el.type == "image") { + // handle image inputs on the fly when semantic == true + if(!el.disabled && form.clk == el) + a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); + continue; + } + var v = jQuery.fieldValue(el, true); + if (v === null) continue; + if (v.constructor == Array) { + for(var j=0, jmax=v.length; j < jmax; j++) + a.push({name: n, value: v[j]}); + } + else + a.push({name: n, value: v}); + } + + if (!semantic && form.clk) { + // input type=='image' are not found in elements array! handle them here + var inputs = form.getElementsByTagName("input"); + for(var i=0, max=inputs.length; i < max; i++) { + var input = inputs[i]; + var n = input.name; + if(n && !input.disabled && input.type == "image" && form.clk == input) + a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); + } + } + return a; +}; + + +/** + * Serializes form data into a 'submittable' string. This method will return a string + * in the format: name1=value1&name2=value2 + * + * The semantic argument can be used to force form serialization in semantic order. + * If your form must be submitted with name/value pairs in semantic order then pass + * true for this arg, otherwise pass false (or nothing) to avoid the overhead for + * this logic (which can be significant for very large forms). + * + * @example var data = $("#myForm").formSerialize(); + * $.ajax('POST', "myscript.cgi", data); + * @desc Collect all the data from a form into a single string + * + * @name formSerialize + * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) + * @type String + * @cat Plugins/Form + * @see formToArray + * @author jQuery Community + */ +jQuery.fn.formSerialize = function(semantic) { + //hand off to jQuery.param for proper encoding + return jQuery.param(this.formToArray(semantic)); +}; + + +/** + * Serializes all field elements in the jQuery object into a query string. + * This method will return a string in the format: name1=value1&name2=value2 + * + * The successful argument controls whether or not serialization is limited to + * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). + * The default value of the successful argument is true. + * + * @example var data = $("input").formSerialize(); + * @desc Collect the data from all successful input elements into a query string + * + * @example var data = $(":radio").formSerialize(); + * @desc Collect the data from all successful radio input elements into a query string + * + * @example var data = $("#myForm :checkbox").formSerialize(); + * @desc Collect the data from all successful checkbox input elements in myForm into a query string + * + * @example var data = $("#myForm :checkbox").formSerialize(false); + * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string + * + * @example var data = $(":input").formSerialize(); + * @desc Collect the data from all successful input, select, textarea and button elements into a query string + * + * @name fieldSerialize + * @param successful true if only successful controls should be serialized (default is true) + * @type String + * @cat Plugins/Form + */ +jQuery.fn.fieldSerialize = function(successful) { + var a = []; + this.each(function() { + var n = this.name; + if (!n) return; + var v = jQuery.fieldValue(this, successful); + if (v && v.constructor == Array) { + for (var i=0,max=v.length; i < max; i++) + a.push({name: n, value: v[i]}); + } + else if (v !== null && typeof v != 'undefined') + a.push({name: this.name, value: v}); + }); + //hand off to jQuery.param for proper encoding + return jQuery.param(a); +}; + + +/** + * Returns the value of the field element in the jQuery object. If there is more than one field element + * in the jQuery object the value of the first successful one is returned. + * + * The successful argument controls whether or not the field element must be 'successful' + * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). + * The default value of the successful argument is true. If this value is false then + * the value of the first field element in the jQuery object is returned. + * + * Note: If no valid value can be determined the return value will be undifined. + * + * Note: The fieldValue returned for a select-multiple element or for a checkbox input will + * always be an array if it is not undefined. + * + * + * @example var data = $("#myPasswordElement").formValue(); + * @desc Gets the current value of the myPasswordElement element + * + * @example var data = $("#myForm :input").formValue(); + * @desc Get the value of the first successful control in the jQuery object. + * + * @example var data = $("#myForm :checkbox").formValue(); + * @desc Get the array of values for the first set of successful checkbox controls in the jQuery object. + * + * @example var data = $("#mySingleSelect").formValue(); + * @desc Get the value of the select control + * + * @example var data = $("#myMultiSelect").formValue(); + * @desc Get the array of selected values for the select-multiple control + * + * @name fieldValue + * @param Boolean successful true if value returned must be for a successful controls (default is true) + * @type String or Array + * @cat Plugins/Form + */ +jQuery.fn.fieldValue = function(successful) { + var cbVal, cbName; + + // loop until we find a value + for (var i=0, max=this.length; i < max; i++) { + var el = this[i]; + var v = jQuery.fieldValue(el, successful); + if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) + continue; + + // for checkboxes, consider multiple elements, for everything else just return first valid value + if (el.type != 'checkbox') return v; + + cbName = cbName || el.name; + if (cbName != el.name) // return if we hit a checkbox with a different name + return cbVal; + cbVal = cbVal || []; + cbVal.push(v); + } + return cbVal; +}; + +/** + * Returns the value of the field element. + * + * The successful argument controls whether or not the field element must be 'successful' + * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). + * The default value of the successful argument is true. If the given element is not + * successful and the successful arg is not false then the returned value will be null. + * + * Note: The fieldValue returned for a select-multiple element will always be an array. + * + * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]); + * @desc Gets the current value of the myPasswordElement element + * + * @name fieldValue + * @param Element el The DOM element for which the value will be returned + * @param Boolean successful true if value returned must be for a successful controls (default is true) + * @type String or Array + * @cat Plugins/Form + */ +jQuery.fieldValue = function(el, successful) { + var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); + if (typeof successful == 'undefined') successful = true; + + if (successful && ( !n || el.disabled || t == 'reset' || + (t == 'checkbox' || t == 'radio') && !el.checked || + (t == 'submit' || t == 'image') && el.form && el.form.clk != el || + tag == 'select' && el.selectedIndex == -1)) + return null; + + if (tag == 'select') { + var index = el.selectedIndex; + if (index < 0) return null; + var a = [], ops = el.options; + var one = (t == 'select-one'); + var max = (one ? index+1 : ops.length); + for(var i=(one ? index : 0); i < max; i++) { + var op = ops[i]; + if (op.selected) { + // extra pain for IE... + var v = jQuery.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value; + if (one) return v; + a.push(v); + } + } + return a; + } + return el.value; +}; + + +/** + * Clears the form data. Takes the following actions on the form's input fields: + * - input text fields will have their 'value' property set to the empty string + * - select elements will have their 'selectedIndex' property set to -1 + * - checkbox and radio inputs will have their 'checked' property set to false + * - inputs of type submit, button, reset, and hidden will *not* be effected + * - button elements will *not* be effected + * + * @example $('form').clearForm(); + * @desc Clears all forms on the page. + * + * @name clearForm + * @type jQuery + * @cat Plugins/Form + * @see resetForm + */ +jQuery.fn.clearForm = function() { + return this.each(function() { + jQuery('input,select,textarea', this).clearFields(); + }); +}; + +/** + * Clears the selected form elements. Takes the following actions on the matched elements: + * - input text fields will have their 'value' property set to the empty string + * - select elements will have their 'selectedIndex' property set to -1 + * - checkbox and radio inputs will have their 'checked' property set to false + * - inputs of type submit, button, reset, and hidden will *not* be effected + * - button elements will *not* be effected + * + * @example $('.myInputs').clearFields(); + * @desc Clears all inputs with class myInputs + * + * @name clearFields + * @type jQuery + * @cat Plugins/Form + * @see clearForm + */ +jQuery.fn.clearFields = jQuery.fn.clearInputs = function() { + return this.each(function() { + var t = this.type, tag = this.tagName.toLowerCase(); + if (t == 'text' || t == 'password' || tag == 'textarea') + this.value = ''; + else if (t == 'checkbox' || t == 'radio') + this.checked = false; + else if (tag == 'select') + this.selectedIndex = -1; + }); +}; + + +/** + * Resets the form data. Causes all form elements to be reset to their original value. + * + * @example $('form').resetForm(); + * @desc Resets all forms on the page. + * + * @name resetForm + * @type jQuery + * @cat Plugins/Form + * @see clearForm + */ +jQuery.fn.resetForm = function() { + return this.each(function() { + // guard against an input with the name of 'reset' + // note that IE reports the reset function as an 'object' + if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) + this.reset(); + }); +}; diff --git a/wp-includes/js/jquery/jquery.js b/wp-includes/js/jquery/jquery.js index 31650a1..c684bda 100644 --- a/wp-includes/js/jquery/jquery.js +++ b/wp-includes/js/jquery/jquery.js @@ -1,2 +1 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('k(1v 1t.6=="Q"){1t.Q=1t.Q;u 6=l(a,c){k(1t==7)q 1p 6(a,c);a=a||12;k(6.1k(a))q 1p 6(12)[6.C.28?"28":"2E"](a);k(1v a=="22"){u m=/^[^<]*(<(.|\\n)+>)[^>]*$/.2B(a);k(m)a=6.3W([m[1]]);H q 1p 6(c).2o(a)}q 7.4M(a.1g==2A&&a||(a.3e||a.G&&a!=1t&&!a.1V&&a[0]!=Q&&a[0].1V)&&6.3H(a)||[a])};k(1v $!="Q")6.2O$=$;u $=6;6.C=6.8o={3e:"1.1.1",8p:l(){q 7.G},G:0,2a:l(1R){q 1R==Q?6.3H(7):7[1R]},2q:l(a){u J=6(7);J.6j=7;q J.4M(a)},4M:l(a){7.G=0;[].1h.14(7,a);q 7},I:l(C,1y){q 6.I(7,C,1y)},2b:l(19){u 4I=-1;7.I(l(i){k(7==19)4I=i});q 4I},1E:l(20,N,v){u 19=20;k(20.1g==3p)k(N==Q)q 7.G&&6[v||"1E"](7[0],20)||Q;H{19={};19[20]=N}q 7.I(l(2b){O(u F 1B 19)6.1E(v?7.1q:7,F,6.F(7,19[F],v,2b,F))})},1f:l(20,N){q 7.1E(20,N,"2V")},2L:l(e){k(1v e=="22")q 7.3n().3t(12.8r(e));u t="";6.I(e||7,l(){6.I(7.38,l(){k(7.1V!=8)t+=7.1V!=1?7.60:6.C.2L([7])})});q t},2D:l(){u a=6.3W(1x);q 7.I(l(){u b=a[0].3V(T);7.V.2T(b,7);1Z(b.17)b=b.17;b.4i(7)})},3t:l(){q 7.35(1x,T,1,l(a){7.4i(a)})},5n:l(){q 7.35(1x,T,-1,l(a){7.2T(a,7.17)})},5h:l(){q 7.35(1x,Y,1,l(a){7.V.2T(a,7)})},5i:l(){q 7.35(1x,Y,-1,l(a){7.V.2T(a,7.2f)})},4E:l(){q 7.6j||6([])},2o:l(t){q 7.2q(6.2X(7,l(a){q 6.2o(t,a)}))},4w:l(4C){q 7.2q(6.2X(7,l(a){q a.3V(4C!=Q?4C:T)}))},1w:l(t){q 7.2q(6.1k(t)&&6.2k(7,l(2G,2b){q t.14(2G,[2b])})||6.3v(t,7))},2c:l(t){q 7.2q(t.1g==3p&&6.3v(t,7,T)||6.2k(7,l(a){k(t.1g==2A||t.3e)q 6.3g(t,a)<0;H q a!=t}))},1J:l(t){q 7.2q(6.2i(7.2a(),t.1g==3p?6(t).2a():t.G!=Q&&!t.1u?t:[t]))},46:l(1n){q 1n?6.1w(1n,7).r.G>0:Y},18:l(18){q 18==Q?(7.G?7[0].N:1c):7.1E("N",18)},4Q:l(18){q 18==Q?(7.G?7[0].2H:1c):7.3n().3t(18)},35:l(1y,1N,3F,C){u 4w=7.G>1;u a=6.3W(1y);k(3F<0)a.8s();q 7.I(l(){u 19=7;k(1N&&6.1u(7,"1N")&&6.1u(a[0],"3U"))19=7.5E("1T")[0]||7.4i(12.6e("1T"));6.I(a,l(){C.14(19,[4w?7.3V(T):7])})})}};6.1A=6.C.1A=l(){u 1P=1x[0],a=1;k(1x.G==1){1P=7;a=0}u F;1Z(F=1x[a++])O(u i 1B F)1P[i]=F[i];q 1P};6.1A({8v:l(){k(6.2O$)$=6.2O$;q 6},1k:l(C){q!!C&&1v C!="22"&&1v C[0]=="Q"&&/l/i.1s(C+"")},1u:l(B,W){q B.1u&&B.1u.3u()==W.3u()},I:l(19,C,1y){k(19.G==Q)O(u i 1B 19)C.14(19[i],1y||[i,19[i]]);H O(u i=0,6l=19.G;i<6l;i++)k(C.14(19[i],1y||[i,19[i]])===Y)4q;q 19},F:l(B,N,v,2b,F){k(6.1k(N))q N.3s(B,[2b]);u 6m=/z-?2b|7C-?7D|1b|64|8x-?26/i;k(N.1g==3N&&v=="2V"&&!6m.1s(F))q N+"49";q N},16:{1J:l(B,c){6.I(c.3o(/\\s+/),l(i,M){k(!6.16.2P(B.16,M))B.16+=(B.16?" ":"")+M})},2g:l(B,c){B.16=c?6.2k(B.16.3o(/\\s+/),l(M){q!6.16.2P(c,M)}).55(" "):""},2P:l(t,c){t=t.16||t;q t&&1p 4V("(^|\\\\s)"+c+"(\\\\s|$)").1s(t)}},44:l(e,o,f){O(u i 1B o){e.1q["1H"+i]=e.1q[i];e.1q[i]=o[i]}f.14(e,[]);O(u i 1B o)e.1q[i]=e.1q["1H"+i]},1f:l(e,p){k(p=="26"||p=="40"){u 1H={},41,3f,d=["7x","8z","8A","8B"];6.I(d,l(){1H["8C"+7]=0;1H["8E"+7+"8F"]=0});6.44(e,1H,l(){k(6.1f(e,"1e")!="1Y"){41=e.6E;3f=e.6v}H{e=6(e.3V(T)).2o(":4h").5j("2S").4E().1f({4g:"1C",3Z:"6q",1e:"2t",7v:"0",6r:"0"}).5f(e.V)[0];u 3c=6.1f(e.V,"3Z");k(3c==""||3c=="43")e.V.1q.3Z="6s";41=e.6t;3f=e.6u;k(3c==""||3c=="43")e.V.1q.3Z="43";e.V.39(e)}});q p=="26"?41:3f}q 6.2V(e,p)},2V:l(B,F,6k){u J;k(F=="1b"&&6.U.1m)q 6.1E(B.1q,"1b");k(F=="4L"||F=="2u")F=6.U.1m?"3l":"2u";k(!6k&&B.1q[F])J=B.1q[F];H k(12.3X&&12.3X.45){k(F=="2u"||F=="3l")F="4L";F=F.1U(/([A-Z])/g,"-$1").4P();u M=12.3X.45(B,1c);k(M)J=M.53(F);H k(F=="1e")J="1Y";H 6.44(B,{1e:"2t"},l(){u c=12.3X.45(7,"");J=c&&c.53(F)||""})}H k(B.4Z){u 54=F.1U(/\\-(\\w)/g,l(m,c){q c.3u()});J=B.4Z[F]||B.4Z[54]}q J},3W:l(a){u r=[];6.I(a,l(i,1L){k(!1L)q;k(1L.1g==3N)1L=1L.8m();k(1v 1L=="22"){u s=6.2Z(1L),1W=12.6e("1W"),2e=[];u 2D=!s.15("<1l")&&[1,"<3T>",""]||(!s.15("<6y")||!s.15("<1T")||!s.15("<6A"))&&[1,"<1N>",""]||!s.15("<3U")&&[2,"<1N><1T>",""]||(!s.15("<6B")||!s.15("<6D"))&&[3,"<1N><1T><3U>",""]||[0,"",""];1W.2H=2D[1]+s+2D[2];1Z(2D[0]--)1W=1W.17;k(6.U.1m){k(!s.15("<1N")&&s.15("<1T")<0)2e=1W.17&&1W.17.38;H k(2D[1]=="<1N>"&&s.15("<1T")<0)2e=1W.38;O(u n=2e.G-1;n>=0;--n)k(6.1u(2e[n],"1T")&&!2e[n].38.G)2e[n].V.39(2e[n])}1L=1W.38}k(1L.G===0)q;k(1L[0]==Q)r.1h(1L);H r=6.2i(r,1L)});q r},1E:l(B,W,N){u 2m={"O":"6G","6H":"16","4L":6.U.1m?"3l":"2u",2u:6.U.1m?"3l":"2u",2H:"2H",16:"16",N:"N",2R:"2R",2S:"2S",6K:"6L",2Q:"2Q"};k(W=="1b"&&6.U.1m&&N!=Q){B.64=1;q B.1w=B.1w.1U(/4K\\([^\\)]*\\)/6M,"")+(N==1?"":"4K(1b="+N*57+")")}H k(W=="1b"&&6.U.1m)q B.1w?4f(B.1w.6N(/4K\\(1b=(.*)\\)/)[1])/57:1;k(W=="1b"&&6.U.36&&N==1)N=0.7X;k(2m[W]){k(N!=Q)B[2m[W]]=N;q B[2m[W]]}H k(N==Q&&6.U.1m&&6.1u(B,"5S")&&(W=="6Q"||W=="7V"))q B.6S(W).60;H k(B.6T){k(N!=Q)B.7R(W,N);q B.3D(W)}H{W=W.1U(/-([a-z])/6W,l(z,b){q b.3u()});k(N!=Q)B[W]=N;q B[W]}},2Z:l(t){q t.1U(/^\\s+|\\s+$/g,"")},3H:l(a){u r=[];k(a.1g!=2A)O(u i=0,2w=a.G;i<2w;i++)r.1h(a[i]);H r=a.3J(0);q r},3g:l(b,a){O(u i=0,2w=a.G;i<2w;i++)k(a[i]==b)q i;q-1},2i:l(2v,3P){u r=[].3J.3s(2v,0);O(u i=0,63=3P.G;i<63;i++)k(6.3g(3P[i],r)==-1)2v.1h(3P[i]);q 2v},2k:l(1Q,C,48){k(1v C=="22")C=1p 4D("a","i","q "+C);u 1d=[];O(u i=0,2G=1Q.G;i<2G;i++)k(!48&&C(1Q[i],i)||48&&!C(1Q[i],i))1d.1h(1Q[i]);q 1d},2X:l(1Q,C){k(1v C=="22")C=1p 4D("a","q "+C);u 1d=[],r=[];O(u i=0,2G=1Q.G;i<2G;i++){u 18=C(1Q[i],i);k(18!==1c&&18!=Q){k(18.1g!=2A)18=[18];1d=1d.70(18)}}u r=1d.G?[1d[0]]:[];5d:O(u i=1,5N=1d.G;i<5N;i++){O(u j=0;jm[3]-0",25:"m[3]-0==i",5m:"m[3]-0==i",2v:"i==0",2W:"i==r.G-1",5M:"i%2==0",5O:"i%2","25-3k":"6.25(a.V.17,m[3],\'2f\',a)==a","2v-3k":"6.25(a.V.17,1,\'2f\')==a","2W-3k":"6.25(a.V.7n,1,\'5o\')==a","7o-3k":"6.2F(a.V.17).G==1",5p:"a.17",3n:"!a.17",5r:"6.C.2L.14([a]).15(m[3])>=0",3a:\'a.v!="1C"&&6.1f(a,"1e")!="1Y"&&6.1f(a,"4g")!="1C"\',1C:\'a.v=="1C"||6.1f(a,"1e")=="1Y"||6.1f(a,"4g")=="1C"\',7q:"!a.2R",2R:"a.2R",2S:"a.2S",2Q:"a.2Q||6.1E(a,\'2Q\')",2L:"a.v==\'2L\'",4h:"a.v==\'4h\'",59:"a.v==\'59\'",42:"a.v==\'42\'",58:"a.v==\'58\'",4O:"a.v==\'4O\'",5v:"a.v==\'5v\'",5w:"a.v==\'5w\'",3h:\'a.v=="3h"||6.1u(a,"3h")\',5x:"/5x|3T|7s|3h/i.1s(a.1u)"},".":"6.16.2P(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z&&!z.15(m[4])","$=":"z&&z.2Y(z.G - m[4].G,m[4].G)==m[4]","*=":"z&&z.15(m[4])>=0","":"z",4U:l(m){q["",m[1],m[3],m[2],m[5]]},5J:"z=a[m[3]]||6.1E(a,m[3]);"},"[":"6.2o(m[2],a).G"},5G:[/^\\[ *(@)([a-2l-3y-]*) *([!*$^=]*) *(\'?"?)(.*?)\\4 *\\]/i,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([a-2l-3y-]*)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/i,/^([:.#]*)([a-2l-3y*-]*)/i],1O:[/^(\\/?\\.\\.)/,"a.V",/^(>|\\/)/,"6.2F(a.17)",/^(\\+)/,"6.25(a,2,\'2f\')",/^(~)/,l(a){u s=6.2F(a.V.17);q s.3J(0,6.3g(a,s))}],3v:l(1n,1Q,2c){u 1H,M=[];1Z(1n&&1n!=1H){1H=1n;u f=6.1w(1n,1Q,2c);1n=f.t.1U(/^\\s*,\\s*/,"");M=2c?1Q=f.r:6.2i(M,f.r)}q M},2o:l(t,1r){k(1v t!="22")q[t];k(1r&&!1r.1V)1r=1c;1r=1r||12;k(!t.15("//")){1r=1r.4y;t=t.2Y(2,t.G)}H k(!t.15("/")){1r=1r.4y;t=t.2Y(1,t.G);k(t.15("/")>=1)t=t.2Y(t.15("/"),t.G)}u J=[1r],29=[],2W=1c;1Z(t&&2W!=t){u r=[];2W=t;t=6.2Z(t).1U(/^\\/\\//i,"");u 3x=Y;u 1G=/^[\\/>]\\s*([a-2l-9*-]+)/i;u m=1G.2B(t);k(m){6.I(J,l(){O(u c=7.17;c;c=c.2f)k(c.1V==1&&(6.1u(c,m[1])||m[1]=="*"))r.1h(c)});J=r;t=t.1U(1G,"");k(t.15(" ")==0)5z;3x=T}H{O(u i=0;i<6.1O.G;i+=2){u 1G=6.1O[i];u m=1G.2B(t);k(m){r=J=6.2X(J,6.1k(6.1O[i+1])?6.1O[i+1]:l(a){q 3B(6.1O[i+1])});t=6.2Z(t.1U(1G,""));3x=T;4q}}}k(t&&!3x){k(!t.15(",")){k(J[0]==1r)J.4m();6.2i(29,J);r=J=[1r];t=" "+t.2Y(1,t.G)}H{u 34=/^([a-2l-3y-]+)(#)([a-2l-9\\\\*2O-]*)/i;u m=34.2B(t);k(m){m=[0,m[2],m[3],m[1]]}H{34=/^([#.]?)([a-2l-9\\\\*2O-]*)/i;m=34.2B(t)}k(m[1]=="#"&&J[J.G-1].4R){u 3z=J[J.G-1].4R(m[2]);J=r=3z&&(!m[3]||6.1u(3z,m[3]))?[3z]:[]}H{k(m[1]==".")u 4k=1p 4V("(^|\\\\s)"+m[2]+"(\\\\s|$)");6.I(J,l(){u 3C=m[1]!=""||m[0]==""?"*":m[2];k(6.1u(7,"7w")&&3C=="*")3C="2U";6.2i(r,m[1]!=""&&J.G!=1?6.4r(7,[],m[1],m[2],4k):7.5E(3C))});k(m[1]=="."&&J.G==1)r=6.2k(r,l(e){q 4k.1s(e.16)});k(m[1]=="#"&&J.G==1){u 5F=r;r=[];6.I(5F,l(){k(7.3D("3Y")==m[2]){r=[7];q Y}})}J=r}t=t.1U(34,"")}}k(t){u 18=6.1w(t,r);J=r=18.r;t=6.2Z(18.t)}}k(J&&J[0]==1r)J.4m();6.2i(29,J);q 29},1w:l(t,r,2c){1Z(t&&/^[a-z[({<*:.#]/i.1s(t)){u p=6.5G,m;6.I(p,l(i,1G){m=1G.2B(t);k(m){t=t.7y(m[0].G);k(6.1n[m[1]].4U)m=6.1n[m[1]].4U(m);q Y}});k(m[1]==":"&&m[2]=="2c")r=6.1w(m[3],r,T).r;H k(m[1]=="."){u 1G=1p 4V("(^|\\\\s)"+m[2]+"(\\\\s|$)");r=6.2k(r,l(e){q 1G.1s(e.16||"")},2c)}H{u f=6.1n[m[1]];k(1v f!="22")f=6.1n[m[1]][m[2]];3B("f = l(a,i){"+(6.1n[m[1]].5J||"")+"q "+f+"}");r=6.2k(r,f,2c)}}q{r:r,t:t}},4r:l(o,r,1O,W,1G){O(u s=o.17;s;s=s.2f)k(s.1V==1){u 1J=T;k(1O==".")1J=s.16&&1G.1s(s.16);H k(1O=="#")1J=s.3D("3Y")==W;k(1J)r.1h(s);k(1O=="#"&&r.G)4q;k(s.17)6.4r(s,r,1O,W,1G)}q r},4s:l(B){u 4N=[];u M=B.V;1Z(M&&M!=12){4N.1h(M);M=M.V}q 4N},25:l(M,1d,3F,B){1d=1d||1;u 1R=0;O(;M;M=M[3F]){k(M.1V==1)1R++;k(1R==1d||1d=="5M"&&1R%2==0&&1R>1&&M==B||1d=="5O"&&1R%2==1&&M==B)q M}},2F:l(n,B){u r=[];O(;n;n=n.2f){k(n.1V==1&&(!B||n!=B))r.1h(n)}q r}});6.E={1J:l(S,v,1j,D){k(6.U.1m&&S.4c!=Q)S=1t;k(D)1j.D=D;k(!1j.2n)1j.2n=7.2n++;k(!S.1I)S.1I={};u 32=S.1I[v];k(!32){32=S.1I[v]={};k(S["3I"+v])32[0]=S["3I"+v]}32[1j.2n]=1j;S["3I"+v]=7.5T;k(!7.1i[v])7.1i[v]=[];7.1i[v].1h(S)},2n:1,1i:{},2g:l(S,v,1j){k(S.1I)k(v&&v.v)4u S.1I[v.v][v.1j.2n];H k(v&&S.1I[v])k(1j)4u S.1I[v][1j.2n];H O(u i 1B S.1I[v])4u S.1I[v][i];H O(u j 1B S.1I)7.2g(S,j)},1M:l(v,D,S){D=6.3H(D||[]);k(!S)6.I(7.1i[v]||[],l(){6.E.1M(v,D,7)});H{u 1j=S["3I"+v],18,C=6.1k(S[v]);k(1j){D.5U(7.2m({v:v,1P:S}));k((18=1j.14(S,D))!==Y)7.4v=T}k(C&&18!==Y)S[v]();7.4v=Y}},5T:l(E){k(1v 6=="Q"||6.E.4v)q;E=6.E.2m(E||1t.E||{});u 3M;u c=7.1I[E.v];u 1y=[].3J.3s(1x,1);1y.5U(E);O(u j 1B c){1y[0].1j=c[j];1y[0].D=c[j].D;k(c[j].14(7,1y)===Y){E.2h();E.2z();3M=Y}}k(6.U.1m)E.1P=E.2h=E.2z=E.1j=E.D=1c;q 3M},2m:l(E){k(!E.1P&&E.5V)E.1P=E.5V;k(E.5W==Q&&E.5Y!=Q){u e=12.4y,b=12.7K;E.5W=E.5Y+(e.5Z||b.5Z);E.7M=E.7N+(e.61||b.61)}k(6.U.2C&&E.1P.1V==3){u 33=E;E=6.1A({},33);E.1P=33.1P.V;E.2h=l(){q 33.2h()};E.2z=l(){q 33.2z()}}k(!E.2h)E.2h=l(){7.3M=Y};k(!E.2z)E.2z=l(){7.7Q=T};q E}};6.C.1A({3R:l(v,D,C){q 7.I(l(){6.E.1J(7,v,C||D,D)})},6n:l(v,D,C){q 7.I(l(){6.E.1J(7,v,l(E){6(7).62(E);q(C||D).14(7,1x)},D)})},62:l(v,C){q 7.I(l(){6.E.2g(7,v,C)})},1M:l(v,D){q 7.I(l(){6.E.1M(v,D,7)})},3r:l(){u a=1x;q 7.69(l(e){7.4F=7.4F==0?1:0;e.2h();q a[7.4F].14(7,[e])||Y})},7T:l(f,g){l 4e(e){u p=(e.v=="3S"?e.7U:e.7Y)||e.7Z;1Z(p&&p!=7)2s{p=p.V}2y(e){p=7};k(p==7)q Y;q(e.v=="3S"?f:g).14(7,[e])}q 7.3S(4e).6b(4e)},28:l(f){k(6.3O)f.14(12,[6]);H{6.3b.1h(l(){q f.14(7,[6])})}q 7}});6.1A({3O:Y,3b:[],28:l(){k(!6.3O){6.3O=T;k(6.3b){6.I(6.3b,l(){7.14(12)});6.3b=1c}k(6.U.36||6.U.37)12.81("6g",6.28,Y)}}});1p l(){6.I(("82,83,2E,84,85,4Y,69,86,"+"87,88,89,3S,6b,8b,3T,"+"4O,8d,8f,8g,2M").3o(","),l(i,o){6.C[o]=l(f){q f?7.3R(o,f):7.1M(o)}});k(6.U.36||6.U.37)12.8h("6g",6.28,Y);H k(6.U.1m){12.8i("<8j"+"8l 3Y=6a 8q=T "+"4B=//:><\\/2d>");u 2d=12.4R("6a");k(2d)2d.2p=l(){k(7.3A!="1X")q;7.V.39(7);6.28()};2d=1c}H k(6.U.2C)6.4W=4c(l(){k(12.3A=="8t"||12.3A=="1X"){5u(6.4W);6.4W=1c;6.28()}},10);6.E.1J(1t,"2E",6.28)};k(6.U.1m)6(1t).6n("4Y",l(){u 1i=6.E.1i;O(u v 1B 1i){u 4X=1i[v],i=4X.G;k(i&&v!=\'4Y\')6p 6.E.2g(4X[i-1],v);1Z(--i)}});6.C.1A({1K:l(P,K){u 1C=7.1w(":1C");P?1C.23({26:"1K",40:"1K",1b:"1K"},P,K):1C.I(l(){7.1q.1e=7.2N?7.2N:"";k(6.1f(7,"1e")=="1Y")7.1q.1e="2t"});q 7},1D:l(P,K){u 3a=7.1w(":3a");P?3a.23({26:"1D",40:"1D",1b:"1D"},P,K):3a.I(l(){7.2N=7.2N||6.1f(7,"1e");k(7.2N=="1Y")7.2N="2t";7.1q.1e="1Y"});q 7},52:6.C.3r,3r:l(C,4S){u 1y=1x;q 6.1k(C)&&6.1k(4S)?7.52(C,4S):7.I(l(){6(7)[6(7).46(":1C")?"1K":"1D"].14(6(7),1y)})},6x:l(P,K){q 7.23({26:"1K"},P,K)},6z:l(P,K){q 7.23({26:"1D"},P,K)},6C:l(P,K){q 7.I(l(){u 56=6(7).46(":1C")?"1K":"1D";6(7).23({26:56},P,K)})},6F:l(P,K){q 7.23({1b:"1K"},P,K)},6I:l(P,K){q 7.23({1b:"1D"},P,K)},6J:l(P,3q,K){q 7.23({1b:3q},P,K)},23:l(F,P,1o,K){q 7.1F(l(){7.2r=6.1A({},F);u 1l=6.P(P,1o,K);O(u p 1B F){u e=1p 6.30(7,1l,p);k(F[p].1g==3N)e.2x(e.M(),F[p]);H e[F[p]](F)}})},1F:l(v,C){k(!C){C=v;v="30"}q 7.I(l(){k(!7.1F)7.1F={};k(!7.1F[v])7.1F[v]=[];7.1F[v].1h(C);k(7.1F[v].G==1)C.14(7)})}});6.1A({P:l(P,1o,C){u 1l=P&&P.1g==6O?P:{1X:C||!C&&1o||6.1k(P)&&P,24:P,1o:C&&1o||1o&&1o.1g!=4D&&1o};1l.24=(1l.24&&1l.24.1g==3N?1l.24:{6U:6X,6Y:51}[1l.24])||6Z;1l.1H=1l.1X;1l.1X=l(){6.5X(7,"30");k(6.1k(1l.1H))1l.1H.14(7)};q 1l},1o:{},1F:{},5X:l(B,v){v=v||"30";k(B.1F&&B.1F[v]){B.1F[v].4m();u f=B.1F[v][0];k(f)f.14(B)}},30:l(B,1a,F){u z=7;u y=B.1q;u 4j=6.1f(B,"1e");y.1e="2t";y.5y="1C";z.a=l(){k(1a.3j)1a.3j.14(B,[z.2j]);k(F=="1b")6.1E(y,"1b",z.2j);H k(5g(z.2j))y[F]=5g(z.2j)+"49"};z.5k=l(){q 4f(6.1f(B,F))};z.M=l(){u r=4f(6.2V(B,F));q r&&r>-7g?r:z.5k()};z.2x=l(4d,3q){z.4o=(1p 5s()).5t();z.2j=4d;z.a();z.47=4c(l(){z.3j(4d,3q)},13)};z.1K=l(){k(!B.1z)B.1z={};B.1z[F]=7.M();1a.1K=T;z.2x(0,B.1z[F]);k(F!="1b")y[F]="5q"};z.1D=l(){k(!B.1z)B.1z={};B.1z[F]=7.M();1a.1D=T;z.2x(B.1z[F],0)};z.3r=l(){k(!B.1z)B.1z={};B.1z[F]=7.M();k(4j=="1Y"){1a.1K=T;k(F!="1b")y[F]="5q";z.2x(0,B.1z[F])}H{1a.1D=T;z.2x(B.1z[F],0)}};z.3j=l(31,3G){u t=(1p 5s()).5t();k(t>1a.24+z.4o){5u(z.47);z.47=1c;z.2j=3G;z.a();k(B.2r)B.2r[F]=T;u 29=T;O(u i 1B B.2r)k(B.2r[i]!==T)29=Y;k(29){y.5y="";y.1e=4j;k(6.1f(B,"1e")=="1Y")y.1e="2t";k(1a.1D)y.1e="1Y";k(1a.1D||1a.1K)O(u p 1B B.2r)k(p=="1b")6.1E(y,p,B.1z[p]);H y[p]=""}k(29&&6.1k(1a.1X))1a.1X.14(B)}H{u n=t-7.4o;u p=n/1a.24;z.2j=1a.1o&&6.1o[1a.1o]?6.1o[1a.1o](p,n,31,(3G-31),1a.24):((-5L.7E(p*5L.7F)/2)+0.5)*(3G-31)+31;z.a()}}}});6.C.1A({7G:l(R,21,K){7.2E(R,21,K,1)},2E:l(R,21,K,1S){k(6.1k(R))q 7.3R("2E",R);K=K||l(){};u v="65";k(21)k(6.1k(21)){K=21;21=1c}H{21=6.2U(21);v="6f"}u 4x=7;6.3d({R:R,v:v,D:21,1S:1S,1X:l(2J,11){k(11=="2K"||!1S&&11=="5H")4x.1E("2H",2J.3L).4T().I(K,[2J.3L,11,2J]);H K.14(4x,[2J.3L,11,2J])}});q 7},7L:l(){q 6.2U(7)},4T:l(){q 7.2o("2d").I(l(){k(7.4B)6.6c(7.4B);H 6.4H(7.2L||7.7P||7.2H||"")}).4E()}});k(!1t.3w)3w=l(){q 1p 7S("7W.80")};6.I("68,5R,5Q,6h,5P,5C".3o(","),l(i,o){6.C[o]=l(f){q 7.3R(o,f)}});6.1A({2a:l(R,D,K,v,1S){k(6.1k(D)){K=D;D=1c}q 6.3d({R:R,D:D,2K:K,4t:v,1S:1S})},8a:l(R,D,K,v){q 6.2a(R,D,K,v,1)},6c:l(R,K){q 6.2a(R,1c,K,"2d")},8c:l(R,D,K){q 6.2a(R,D,K,"67")},8e:l(R,D,K,v){k(6.1k(D)){K=D;D={}}q 6.3d({v:"6f",R:R,D:D,2K:K,4t:v})},8k:l(27){6.3K.27=27},8n:l(6o){6.1A(6.3K,6o)},3K:{1i:T,v:"65",27:0,5a:"8u/x-8w-5S-8D",50:T,4G:T,D:1c},3m:{},3d:l(s){s=6.1A({},6.3K,s);k(s.D){k(s.50&&1v s.D!="22")s.D=6.2U(s.D);k(s.v.4P()=="2a")s.R+=((s.R.15("?")>-1)?"&":"?")+s.D}k(s.1i&&!6.4a++)6.E.1M("68");u 4z=Y;u L=1p 3w();L.6P(s.v,s.R,s.4G);k(s.D)L.3i("6R-6V",s.5a);k(s.1S)L.3i("71-4A-73",6.3m[s.R]||"77, 7a 7c 7e 4b:4b:4b 7k");L.3i("X-7m-7p","3w");k(L.7r)L.3i("7t","7u");k(s.5A)s.5A(L);k(s.1i)6.E.1M("5C",[L,s]);u 2p=l(4n){k(L&&(L.3A==4||4n=="27")){4z=T;u 11;2s{11=6.6i(L)&&4n!="27"?s.1S&&6.6d(L,s.R)?"5H":"2K":"2M";k(11!="2M"){u 3E;2s{3E=L.4l("66-4A")}2y(e){}k(s.1S&&3E)6.3m[s.R]=3E;u D=6.5D(L,s.4t);k(s.2K)s.2K(D,11);k(s.1i)6.E.1M("5P",[L,s])}H 6.3Q(s,L,11)}2y(e){11="2M";6.3Q(s,L,11,e)}k(s.1i)6.E.1M("5Q",[L,s]);k(s.1i&&!--6.4a)6.E.1M("5R");k(s.1X)s.1X(L,11);L.2p=l(){};L=1c}};L.2p=2p;k(s.27>0)5c(l(){k(L){L.7J();k(!4z)2p("27")}},s.27);u 4J=L;2s{4J.7O(s.D)}2y(e){6.3Q(s,L,1c,e)}k(!s.4G)2p();q 4J},3Q:l(s,L,11,e){k(s.2M)s.2M(L,11,e);k(s.1i)6.E.1M("6h",[L,s,e])},4a:0,6i:l(r){2s{q!r.11&&8y.8G=="42:"||(r.11>=51&&r.11<6w)||r.11==5b||6.U.2C&&r.11==Q}2y(e){}q Y},6d:l(L,R){2s{u 5K=L.4l("66-4A");q L.11==5b||5K==6.3m[R]||6.U.2C&&L.11==Q}2y(e){}q Y},5D:l(r,v){u 4p=r.4l("7A-v");u D=!v&&4p&&4p.15("L")>=0;D=v=="L"||D?r.7I:r.3L;k(v=="2d")6.4H(D);k(v=="67")3B("D = "+D);k(v=="4Q")6("<1W>").4Q(D).4T();q D},2U:l(a){u s=[];k(a.1g==2A||a.3e)6.I(a,l(){s.1h(2I(7.W)+"="+2I(7.N))});H O(u j 1B a)k(a[j]&&a[j].1g==2A)6.I(a[j],l(){s.1h(2I(j)+"="+2I(7))});H s.1h(2I(j)+"="+2I(a[j]));q s.55("&")},4H:l(D){k(1t.5B)1t.5B(D);H k(6.U.2C)1t.5c(D,0);H 3B.3s(1t,D)}})}',62,539,'||||||jQuery|this|||||||||||||if|function|||||return||||var|type||||||elem|fn|data|event|prop|length|else|each|ret|callback|xml|cur|value|for|speed|undefined|url|element|true|browser|parentNode|name||false|||status|document||apply|indexOf|className|firstChild|val|obj|options|opacity|null|result|display|css|constructor|push|global|handler|isFunction|opt|msie|expr|easing|new|style|context|test|window|nodeName|typeof|filter|arguments|args|orig|extend|in|hidden|hide|attr|queue|re|old|events|add|show|arg|trigger|table|token|target|elems|num|ifModified|tbody|replace|nodeType|div|complete|none|while|key|params|string|animate|duration|nth|height|timeout|ready|done|get|index|not|script|tb|nextSibling|remove|preventDefault|merge|now|grep|z0|fix|guid|find|onreadystatechange|pushStack|curAnim|try|block|cssFloat|first|al|custom|catch|stopPropagation|Array|exec|safari|wrap|load|sibling|el|innerHTML|encodeURIComponent|res|success|text|error|oldblock|_|has|selected|disabled|checked|insertBefore|param|curCSS|last|map|substr|trim|fx|firstNum|handlers|originalEvent|re2|domManip|mozilla|opera|childNodes|removeChild|visible|readyList|parPos|ajax|jquery|oWidth|inArray|button|setRequestHeader|step|child|styleFloat|lastModified|empty|split|String|to|toggle|call|append|toUpperCase|multiFilter|XMLHttpRequest|foundToken|9_|oid|readyState|eval|tag|getAttribute|modRes|dir|lastNum|makeArray|on|slice|ajaxSettings|responseText|returnValue|Number|isReady|second|handleError|bind|mouseover|select|tr|cloneNode|clean|defaultView|id|position|width|oHeight|file|static|swap|getComputedStyle|is|timer|inv|px|active|00|setInterval|from|handleHover|parseFloat|visibility|radio|appendChild|oldDisplay|rec|getResponseHeader|shift|isTimeout|startTime|ct|break|getAll|parents|dataType|delete|triggered|clone|self|documentElement|requestDone|Modified|src|deep|Function|end|lastToggle|async|globalEval|pos|xml2|alpha|float|setArray|matched|submit|toLowerCase|html|getElementById|fn2|evalScripts|_resort|RegExp|safariTimer|els|unload|currentStyle|processData|200|_toggle|getPropertyValue|newProp|join|state|100|password|checkbox|contentType|304|setTimeout|check|gt|appendTo|parseInt|before|after|removeAttr|max|lt|eq|prepend|previousSibling|parent|1px|contains|Date|getTime|clearInterval|image|reset|input|overflow|continue|beforeSend|execScript|ajaxSend|httpData|getElementsByTagName|tmp|parse|notmodified|webkit|_prefix|xmlRes|Math|even|rl|odd|ajaxSuccess|ajaxComplete|ajaxStop|form|handle|unshift|srcElement|pageX|dequeue|clientX|scrollLeft|nodeValue|scrollTop|unbind|sl|zoom|GET|Last|json|ajaxStart|click|__ie_init|mouseout|getScript|httpNotModified|createElement|POST|DOMContentLoaded|ajaxError|httpSuccess|prevObject|force|ol|exclude|one|settings|do|absolute|left|relative|clientHeight|clientWidth|offsetWidth|300|slideDown|thead|slideUp|tfoot|td|slideToggle|th|offsetHeight|fadeIn|htmlFor|class|fadeOut|fadeTo|readonly|readOnly|gi|match|Object|open|action|Content|getAttributeNode|tagName|slow|Type|ig|600|fast|400|concat|If|userAgent|Since|compatible|boxModel|compatMode|Thu|next|siblings|01|children|Jan|prependTo|1970|insertAfter|10000|removeAttribute|addClass|removeClass|GMT|toggleClass|Requested|lastChild|only|With|enabled|overrideMimeType|textarea|Connection|close|right|object|Top|substring|prev|content|CSS1Compat|font|weight|cos|PI|loadIfModified|navigator|responseXML|abort|body|serialize|pageY|clientY|send|textContent|cancelBubble|setAttribute|ActiveXObject|hover|fromElement|method|Microsoft|9999|toElement|relatedTarget|XMLHTTP|removeEventListener|blur|focus|resize|scroll|dblclick|mousedown|mouseup|mousemove|getIfModified|change|getJSON|keydown|post|keypress|keyup|addEventListener|write|scr|ajaxTimeout|ipt|toString|ajaxSetup|prototype|size|defer|createTextNode|reverse|loaded|application|noConflict|www|line|location|Bottom|Right|Left|padding|urlencoded|border|Width|protocol'.split('|'),0,{})); jQuery.noConflict(); - +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7(1C 1w.6=="T"){1w.T=1w.T;B 6=u(a,c){7(1w==q)v 1p 6(a,c);a=a||17;7(6.1t(a))v 1p 6(17)[6.E.27?"27":"2O"](a);7(1C a=="23"){B m=/^[^<]*(<(.|\\s)+>)[^>]*$/.2Q(a);7(m)a=6.3k([m[1]]);J v 1p 6(c).2o(a)}v q.6r(a.1l==2y&&a||(a.3Y||a.I&&a!=1w&&!a.24&&a[0]!=T&&a[0].24)&&6.3M(a)||[a])};7(1C $!="T")6.2S$=$;B $=6;6.E=6.8p={3Y:"1.1.2",8q:u(){v q.I},I:0,2b:u(1T){v 1T==T?6.3M(q):q[1T]},2r:u(a){B L=6(a);L.6p=q;v L},6r:u(a){q.I=0;[].1g.14(q,a);v q},K:u(E,1E){v 6.K(q,E,1E)},2h:u(1c){B 4c=-1;q.K(u(i){7(q==1c)4c=i});v 4c},1I:u(1Y,O,C){B 1c=1Y;7(1Y.1l==3t)7(O==T)v q.I&&6[C||"1I"](q[0],1Y)||T;J{1c={};1c[1Y]=O}v q.K(u(2h){P(B H 1x 1c)6.1I(C?q.1q:q,H,6.H(q,1c[H],C,2h,H))})},1m:u(1Y,O){v q.1I(1Y,O,"30")},2L:u(e){7(1C e=="23")v q.3u().3r(17.8t(e));B t="";6.K(e||q,u(){6.K(q.2I,u(){7(q.24!=8)t+=q.24!=1?q.60:6.E.2L([q])})});v t},2K:u(){B a=6.3k(1A);v q.K(u(){B b=a[0].3l(U);q.11.2X(b,q);22(b.1b)b=b.1b;b.4C(q)})},3r:u(){v q.3j(1A,U,1,u(a){q.4C(a)})},5i:u(){v q.3j(1A,U,-1,u(a){q.2X(a,q.1b)})},5j:u(){v q.3j(1A,12,1,u(a){q.11.2X(a,q)})},5t:u(){v q.3j(1A,12,-1,u(a){q.11.2X(a,q.2e)})},4g:u(){v q.6p||6([])},2o:u(t){v q.2r(6.31(q,u(a){v 6.2o(t,a)}),t)},4Y:u(4N){v q.2r(6.31(q,u(a){B a=a.3l(4N!=T?4N:U);a.$1H=16;v a}))},1D:u(t){v q.2r(6.1t(t)&&6.2q(q,u(2z,2h){v t.14(2z,[2h])})||6.3z(t,q))},2g:u(t){v q.2r(t.1l==3t&&6.3z(t,q,U)||6.2q(q,u(a){v(t.1l==2y||t.3Y)?6.3y(a,t)<0:a!=t}))},1M:u(t){v q.2r(6.2k(q.2b(),t.1l==3t?6(t).2b():t.I!=T&&(!t.1f||t.1f=="8v")?t:[t]))},4l:u(1s){v 1s?6.1D(1s,q).r.I>0:12},1a:u(1a){v 1a==T?(q.I?q[0].O:16):q.1I("O",1a)},4U:u(1a){v 1a==T?(q.I?q[0].2t:16):q.3u().3r(1a)},3j:u(1E,1P,3Z,E){B 4Y=q.I>1;B a=6.3k(1E);7(3Z<0)a.8w();v q.K(u(){B 1c=q;7(1P&&6.1f(q,"1P")&&6.1f(a[0],"3m"))1c=q.5J("20")[0]||q.4C(17.6n("20"));6.K(a,u(){E.14(1c,[4Y?q.3l(U):q])})})}};6.1z=6.E.1z=u(){B 1O=1A[0],a=1;7(1A.I==1){1O=q;a=0}B H;22(H=1A[a++])P(B i 1x H)1O[i]=H[i];v 1O};6.1z({8x:u(){7(6.2S$)$=6.2S$;v 6},1t:u(E){v!!E&&1C E!="23"&&!E.1f&&1C E[0]=="T"&&/u/i.1n(E+"")},4B:u(D){v D.66&&D.5I&&!D.5I.64},1f:u(D,Y){v D.1f&&D.1f.3K()==Y.3K()},K:u(1c,E,1E){7(1c.I==T)P(B i 1x 1c)E.14(1c[i],1E||[i,1c[i]]);J P(B i=0,6q=1c.I;i<6q;i++)7(E.14(1c[i],1E||[i,1c[i]])===12)3O;v 1c},H:u(D,O,C,2h,H){7(6.1t(O))O=O.3n(D,[2h]);B 6s=/z-?2h|7P-?8A|1d|58|8B-?28/i;v O&&O.1l==3Q&&C=="30"&&!6s.1n(H)?O+"4S":O},19:{1M:u(D,c){6.K(c.3o(/\\s+/),u(i,Q){7(!6.19.2V(D.19,Q))D.19+=(D.19?" ":"")+Q})},2f:u(D,c){D.19=c?6.2q(D.19.3o(/\\s+/),u(Q){v!6.19.2V(c,Q)}).6t(" "):""},2V:u(t,c){t=t.19||t;c=c.1R(/([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:])/g,"\\\\$1");v t&&1p 4v("(^|\\\\s)"+c+"(\\\\s|$)").1n(t)}},4d:u(e,o,f){P(B i 1x o){e.1q["1N"+i]=e.1q[i];e.1q[i]=o[i]}f.14(e,[]);P(B i 1x o)e.1q[i]=e.1q["1N"+i]},1m:u(e,p){7(p=="28"||p=="3V"){B 1N={},46,3P,d=["7d","8C","8D","8E"];6.K(d,u(){1N["8F"+q]=0;1N["8G"+q+"8H"]=0});6.4d(e,1N,u(){7(6.1m(e,"1h")!="1Z"){46=e.8I;3P=e.8J}J{e=6(e.3l(U)).2o(":4j").5l("2Z").4g().1m({4n:"1G",45:"8K",1h:"2D",7I:"0",8M:"0"}).5z(e.11)[0];B 3d=6.1m(e.11,"45");7(3d==""||3d=="4b")e.11.1q.45="6x";46=e.6y;3P=e.6z;7(3d==""||3d=="4b")e.11.1q.45="4b";e.11.33(e)}});v p=="28"?46:3P}v 6.30(e,p)},30:u(D,H,53){B L;7(H=="1d"&&6.W.1j)v 6.1I(D.1q,"1d");7(H=="4h"||H=="2v")H=6.W.1j?"3T":"2v";7(!53&&D.1q[H])L=D.1q[H];J 7(17.44&&17.44.4W){7(H=="2v"||H=="3T")H="4h";H=H.1R(/([A-Z])/g,"-$1").4m();B Q=17.44.4W(D,16);7(Q)L=Q.55(H);J 7(H=="1h")L="1Z";J 6.4d(D,{1h:"2D"},u(){B c=17.44.4W(q,"");L=c&&c.55(H)||""})}J 7(D.51){B 56=H.1R(/\\-(\\w)/g,u(m,c){v c.3K()});L=D.51[H]||D.51[56]}v L},3k:u(a){B r=[];6.K(a,u(i,1r){7(!1r)v;7(1r.1l==3Q)1r=1r.6C();7(1C 1r=="23"){B s=6.35(1r),1V=17.6n("1V"),2i=[];B 2K=!s.18("<1u")&&[1,"<42>",""]||(!s.18("<6D")||!s.18("<20")||!s.18("<6E"))&&[1,"<1P>",""]||!s.18("<3m")&&[2,"<1P><20>",""]||(!s.18("<6F")||!s.18("<6G"))&&[3,"<1P><20><3m>",""]||[0,"",""];1V.2t=2K[1]+s+2K[2];22(2K[0]--)1V=1V.1b;7(6.W.1j){7(!s.18("<1P")&&s.18("<20")<0)2i=1V.1b&&1V.1b.2I;J 7(2K[1]=="<1P>"&&s.18("<20")<0)2i=1V.2I;P(B n=2i.I-1;n>=0;--n)7(6.1f(2i[n],"20")&&!2i[n].2I.I)2i[n].11.33(2i[n])}1r=[];P(B i=0,l=1V.2I.I;im[3]-0",2a:"m[3]-0==i",5q:"m[3]-0==i",2u:"i==0",2T:"i==r.I-1",5R:"i%2==0",5S:"i%2","2a-3s":"6.2a(a.11.1b,m[3],\'2e\',a)==a","2u-3s":"6.2a(a.11.1b,1,\'2e\')==a","2T-3s":"6.2a(a.11.7n,1,\'5s\')==a","7p-3s":"6.2B(a.11.1b).I==1",5u:"a.1b",3u:"!a.1b",5v:"6.E.2L.14([a]).18(m[3])>=0",3i:\'a.C!="1G"&&6.1m(a,"1h")!="1Z"&&6.1m(a,"4n")!="1G"\',1G:\'a.C=="1G"||6.1m(a,"1h")=="1Z"||6.1m(a,"4n")=="1G"\',7v:"!a.2W",2W:"a.2W",2Z:"a.2Z",2Y:"a.2Y||6.1I(a,\'2Y\')",2L:"a.C==\'2L\'",4j:"a.C==\'4j\'",5x:"a.C==\'5x\'",4G:"a.C==\'4G\'",5y:"a.C==\'5y\'",4R:"a.C==\'4R\'",5A:"a.C==\'5A\'",5B:"a.C==\'5B\'",3x:\'a.C=="3x"||6.1f(a,"3x")\',5C:"/5C|42|7A|3x/i.1n(a.1f)"},".":"6.19.2V(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z&&!z.18(m[4])","$=":"z&&z.2U(z.I - m[4].I,m[4].I)==m[4]","*=":"z&&z.18(m[4])>=0","":"z",4u:u(m){v["",m[1],m[3],m[2],m[5]]},5P:"z=a[m[3]];7(!z||/5E|3e/.1n(m[3]))z=6.1I(a,m[3]);"},"[":"6.2o(m[2],a).I"},5M:[/^\\[ *(@)([a-2m-3C-]*) *([!*$^=]*) *(\'?"?)(.*?)\\4 *\\]/i,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([a-2m-3C-]*)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/i,/^([:.#]*)([a-2m-3C*-]*)/i],1Q:[/^(\\/?\\.\\.)/,"a.11",/^(>|\\/)/,"6.2B(a.1b)",/^(\\+)/,"6.2a(a,2,\'2e\')",/^(~)/,u(a){B s=6.2B(a.11.1b);v s.3N(6.3y(a,s)+1)}],3z:u(1s,1U,2g){B 1N,Q=[];22(1s&&1s!=1N){1N=1s;B f=6.1D(1s,1U,2g);1s=f.t.1R(/^\\s*,\\s*/,"");Q=2g?1U=f.r:6.2k(Q,f.r)}v Q},2o:u(t,1B){7(1C t!="23")v[t];7(1B&&!1B.24)1B=16;1B=1B||17;7(!t.18("//")){1B=1B.4H;t=t.2U(2,t.I)}J 7(!t.18("/")){1B=1B.4H;t=t.2U(1,t.I);7(t.18("/")>=1)t=t.2U(t.18("/"),t.I)}B L=[1B],2c=[],2T=16;22(t&&2T!=t){B r=[];2T=t;t=6.35(t).1R(/^\\/\\//i,"");B 3B=12;B 1J=/^[\\/>]\\s*([a-2m-9*-]+)/i;B m=1J.2Q(t);7(m){6.K(L,u(){P(B c=q.1b;c;c=c.2e)7(c.24==1&&(6.1f(c,m[1])||m[1]=="*"))r.1g(c)});L=r;t=t.1R(1J,"");7(t.18(" ")==0)5F;3B=U}J{P(B i=0;i<6.1Q.I;i+=2){B 1J=6.1Q[i];B m=1J.2Q(t);7(m){r=L=6.31(L,6.1t(6.1Q[i+1])?6.1Q[i+1]:u(a){v 40(6.1Q[i+1])});t=6.35(t.1R(1J,""));3B=U;3O}}}7(t&&!3B){7(!t.18(",")){7(L[0]==1B)L.4L();6.2k(2c,L);r=L=[1B];t=" "+t.2U(1,t.I)}J{B 34=/^([a-2m-3C-]+)(#)([a-2m-9\\\\*2S-]*)/i;B m=34.2Q(t);7(m){m=[0,m[2],m[3],m[1]]}J{34=/^([#.]?)([a-2m-9\\\\*2S-]*)/i;m=34.2Q(t)}7(m[1]=="#"&&L[L.I-1].4X){B 2l=L[L.I-1].4X(m[2]);7(6.W.1j&&2l&&2l.2J!=m[2])2l=6(\'[@2J="\'+m[2]+\'"]\',L[L.I-1])[0];L=r=2l&&(!m[3]||6.1f(2l,m[3]))?[2l]:[]}J{7(m[1]==".")B 4r=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");6.K(L,u(){B 3E=m[1]!=""||m[0]==""?"*":m[2];7(6.1f(q,"7J")&&3E=="*")3E="3g";6.2k(r,m[1]!=""&&L.I!=1?6.4x(q,[],m[1],m[2],4r):q.5J(3E))});7(m[1]=="."&&L.I==1)r=6.2q(r,u(e){v 4r.1n(e.19)});7(m[1]=="#"&&L.I==1){B 5K=r;r=[];6.K(5K,u(){7(q.36("2J")==m[2]){r=[q];v 12}})}L=r}t=t.1R(34,"")}}7(t){B 1a=6.1D(t,r);L=r=1a.r;t=6.35(1a.t)}}7(L&&L[0]==1B)L.4L();6.2k(2c,L);v 2c},1D:u(t,r,2g){22(t&&/^[a-z[({<*:.#]/i.1n(t)){B p=6.5M,m;6.K(p,u(i,1J){m=1J.2Q(t);7(m){t=t.7M(m[0].I);7(6.1s[m[1]].4u)m=6.1s[m[1]].4u(m);v 12}});7(m[1]==":"&&m[2]=="2g")r=6.1D(m[3],r,U).r;J 7(m[1]=="."){B 1J=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");r=6.2q(r,u(e){v 1J.1n(e.19||"")},2g)}J{B f=6.1s[m[1]];7(1C f!="23")f=6.1s[m[1]][m[2]];40("f = u(a,i){"+(6.1s[m[1]].5P||"")+"v "+f+"}");r=6.2q(r,f,2g)}}v{r:r,t:t}},4x:u(o,r,1Q,Y,1J){P(B s=o.1b;s;s=s.2e)7(s.24==1){B 1M=U;7(1Q==".")1M=s.19&&1J.1n(s.19);J 7(1Q=="#")1M=s.36("2J")==Y;7(1M)r.1g(s);7(1Q=="#"&&r.I)3O;7(s.1b)6.4x(s,r,1Q,Y,1J)}v r},4z:u(D){B 4A=[];B Q=D.11;22(Q&&Q!=17){4A.1g(Q);Q=Q.11}v 4A},2a:u(Q,1i,3Z,D){1i=1i||1;B 1T=0;P(;Q;Q=Q[3Z]){7(Q.24==1)1T++;7(1T==1i||1i=="5R"&&1T%2==0&&1T>1&&Q==D||1i=="5S"&&1T%2==1&&Q==D)v Q}},2B:u(n,D){B r=[];P(;n;n=n.2e){7(n.24==1&&(!D||n!=D))r.1g(n)}v r}});6.G={1M:u(S,C,1o,F){7(6.W.1j&&S.3L!=T)S=1w;7(F)1o.F=F;7(!1o.2A)1o.2A=q.2A++;7(!S.$1H)S.$1H={};B 38=S.$1H[C];7(!38){38=S.$1H[C]={};7(S["39"+C])38[0]=S["39"+C]}38[1o.2A]=1o;S["39"+C]=q.5Y;7(!q.1k[C])q.1k[C]=[];q.1k[C].1g(S)},2A:1,1k:{},2f:u(S,C,1o){7(S.$1H){B i,j,k;7(C&&C.C){1o=C.1o;C=C.C}7(C&&S.$1H[C])7(1o)5U S.$1H[C][1o.2A];J P(i 1x S.$1H[C])5U S.$1H[C][i];J P(j 1x S.$1H)q.2f(S,j);P(k 1x S.$1H[C])7(k){k=U;3O}7(!k)S["39"+C]=16}},1S:u(C,F,S){F=6.3M(F||[]);7(!S)6.K(q.1k[C]||[],u(){6.G.1S(C,F,q)});J{B 1o=S["39"+C],1a,E=6.1t(S[C]);7(1o){F.61(q.2j({C:C,1O:S}));7((1a=1o.14(S,F))!==12)q.4F=U}7(E&&1a!==12)S[C]();q.4F=12}},5Y:u(G){7(1C 6=="T"||6.G.4F)v;G=6.G.2j(G||1w.G||{});B 3R;B c=q.$1H[G.C];B 1E=[].3N.3n(1A,1);1E.61(G);P(B j 1x c){1E[0].1o=c[j];1E[0].F=c[j].F;7(c[j].14(q,1E)===12){G.2n();G.2H();3R=12}}7(6.W.1j)G.1O=G.2n=G.2H=G.1o=G.F=16;v 3R},2j:u(G){7(!G.1O&&G.63)G.1O=G.63;7(G.65==T&&G.67!=T){B e=17.4H,b=17.64;G.65=G.67+(e.68||b.68);G.7Y=G.7Z+(e.6c||b.6c)}7(6.W.2N&&G.1O.24==3){B 3a=G;G=6.1z({},3a);G.1O=3a.1O.11;G.2n=u(){v 3a.2n()};G.2H=u(){v 3a.2H()}}7(!G.2n)G.2n=u(){q.3R=12};7(!G.2H)G.2H=u(){q.82=U};v G}};6.E.1z({3U:u(C,F,E){v q.K(u(){6.G.1M(q,C,E||F,F)})},6u:u(C,F,E){v q.K(u(){6.G.1M(q,C,u(G){6(q).6f(G);v(E||F).14(q,1A)},F)})},6f:u(C,E){v q.K(u(){6.G.2f(q,C,E)})},1S:u(C,F){v q.K(u(){6.G.1S(C,F,q)})},3X:u(){B a=1A;v q.6j(u(e){q.4M=q.4M==0?1:0;e.2n();v a[q.4M].14(q,[e])||12})},83:u(f,g){u 4O(e){B p=(e.C=="41"?e.84:e.85)||e.86;22(p&&p!=q)2G{p=p.11}2w(e){p=q};7(p==q)v 12;v(e.C=="41"?f:g).14(q,[e])}v q.41(4O).6k(4O)},27:u(f){7(6.3W)f.14(17,[6]);J{6.3c.1g(u(){v f.14(q,[6])})}v q}});6.1z({3W:12,3c:[],27:u(){7(!6.3W){6.3W=U;7(6.3c){6.K(6.3c,u(){q.14(17)});6.3c=16}7(6.W.3h||6.W.3f)17.87("6o",6.27,12)}}});1p u(){6.K(("88,8a,2O,8b,8d,52,6j,8e,"+"8f,8g,8h,41,6k,8j,42,"+"4R,8k,8l,8m,2C").3o(","),u(i,o){6.E[o]=u(f){v f?q.3U(o,f):q.1S(o)}});7(6.W.3h||6.W.3f)17.8n("6o",6.27,12);J 7(6.W.1j){17.8o("<8r"+"8s 2J=62 8u=U "+"3e=//:><\\/2d>");B 2d=17.4X("62");7(2d)2d.37=u(){7(q.3D!="1X")v;q.11.33(q);6.27()};2d=16}J 7(6.W.2N)6.50=3L(u(){7(17.3D=="8y"||17.3D=="1X"){4p(6.50);6.50=16;6.27()}},10);6.G.1M(1w,"2O",6.27)};7(6.W.1j)6(1w).6u("52",u(){B 1k=6.G.1k;P(B C 1x 1k){B 4Z=1k[C],i=4Z.I;7(i&&C!=\'52\')6w 6.G.2f(4Z[i-1],C);22(--i)}});6.E.1z({6A:u(V,21,M){q.2O(V,21,M,1)},2O:u(V,21,M,1W){7(6.1t(V))v q.3U("2O",V);M=M||u(){};B C="5d";7(21)7(6.1t(21)){M=21;21=16}J{21=6.3g(21);C="5V"}B 4e=q;6.3v({V:V,C:C,F:21,1W:1W,1X:u(2P,15){7(15=="2M"||!1W&&15=="5L")4e.1I("2t",2P.3G).4V().K(M,[2P.3G,15,2P]);J M.14(4e,[2P.3G,15,2P])}});v q},6B:u(){v 6.3g(q)},4V:u(){v q.2o("2d").K(u(){7(q.3e)6.59(q.3e);J 6.4a(q.2L||q.6H||q.2t||"")}).4g()}});7(!1w.3p)3p=u(){v 1p 6I("6K.6M")};6.K("5m,5Q,5O,5W,5N,5H".3o(","),u(i,o){6.E[o]=u(f){v q.3U(o,f)}});6.1z({2b:u(V,F,M,C,1W){7(6.1t(F)){M=F;F=16}v 6.3v({V:V,F:F,2M:M,4t:C,1W:1W})},6Q:u(V,F,M,C){v 6.2b(V,F,M,C,1)},59:u(V,M){v 6.2b(V,16,M,"2d")},6S:u(V,F,M){v 6.2b(V,F,M,"6m")},6U:u(V,F,M,C){7(6.1t(F)){M=F;F={}}v 6.3v({C:"5V",V:V,F:F,2M:M,4t:C})},6X:u(29){6.3q.29=29},6Y:u(5c){6.1z(6.3q,5c)},3q:{1k:U,C:"5d",29:0,5r:"70/x-73-3w-77",5h:U,48:U,F:16},3S:{},3v:u(s){s=6.1z({},6.3q,s);7(s.F){7(s.5h&&1C s.F!="23")s.F=6.3g(s.F);7(s.C.4m()=="2b"){s.V+=((s.V.18("?")>-1)?"&":"?")+s.F;s.F=16}}7(s.1k&&!6.4E++)6.G.1S("5m");B 4y=12;B N=1p 3p();N.7j(s.C,s.V,s.48);7(s.F)N.3A("7l-7m",s.5r);7(s.1W)N.3A("7o-4K-7q",6.3S[s.V]||"7s, 7t 7w 7x 4o:4o:4o 7z");N.3A("X-7B-7C","3p");7(N.7E)N.3A("7F","7G");7(s.5G)s.5G(N);7(s.1k)6.G.1S("5H",[N,s]);B 37=u(4s){7(N&&(N.3D==4||4s=="29")){4y=U;7(3I){4p(3I);3I=16}B 15;2G{15=6.5Z(N)&&4s!="29"?s.1W&&6.69(N,s.V)?"5L":"2M":"2C";7(15!="2C"){B 3F;2G{3F=N.4P("6b-4K")}2w(e){}7(s.1W&&3F)6.3S[s.V]=3F;B F=6.6i(N,s.4t);7(s.2M)s.2M(F,15);7(s.1k)6.G.1S("5N",[N,s])}J 6.3J(s,N,15)}2w(e){15="2C";6.3J(s,N,15,e)}7(s.1k)6.G.1S("5O",[N,s]);7(s.1k&&!--6.4E)6.G.1S("5Q");7(s.1X)s.1X(N,15);7(s.48)N=16}};B 3I=3L(37,13);7(s.29>0)57(u(){7(N){N.7N();7(!4y)37("29")}},s.29);2G{N.7Q(s.F)}2w(e){6.3J(s,N,16,e)}7(!s.48)37();v N},3J:u(s,N,15,e){7(s.2C)s.2C(N,15,e);7(s.1k)6.G.1S("5W",[N,s,e])},4E:0,5Z:u(r){2G{v!r.15&&7V.7W=="4G:"||(r.15>=5X&&r.15<7X)||r.15==6d||6.W.2N&&r.15==T}2w(e){}v 12},69:u(N,V){2G{B 6e=N.4P("6b-4K");v N.15==6d||6e==6.3S[V]||6.W.2N&&N.15==T}2w(e){}v 12},6i:u(r,C){B 4Q=r.4P("8c-C");B F=!C&&4Q&&4Q.18("N")>=0;F=C=="N"||F?r.8i:r.3G;7(C=="2d")6.4a(F);7(C=="6m")40("F = "+F);7(C=="4U")6("<1V>").4U(F).4V();v F},3g:u(a){B s=[];7(a.1l==2y||a.3Y)6.K(a,u(){s.1g(2x(q.Y)+"="+2x(q.O))});J P(B j 1x a)7(a[j]&&a[j].1l==2y)6.K(a[j],u(){s.1g(2x(j)+"="+2x(q))});J s.1g(2x(j)+"="+2x(a[j]));v s.6t("&")},4a:u(F){7(1w.54)1w.54(F);J 7(6.W.2N)1w.57(F,0);J 40.3n(1w,F)}});6.E.1z({1L:u(R,M){B 1G=q.1D(":1G");R?1G.26({28:"1L",3V:"1L",1d:"1L"},R,M):1G.K(u(){q.1q.1h=q.2E?q.2E:"";7(6.1m(q,"1h")=="1Z")q.1q.1h="2D"});v q},1K:u(R,M){B 3i=q.1D(":3i");R?3i.26({28:"1K",3V:"1K",1d:"1K"},R,M):3i.K(u(){q.2E=q.2E||6.1m(q,"1h");7(q.2E=="1Z")q.2E="2D";q.1q.1h="1Z"});v q},5g:6.E.3X,3X:u(E,4I){B 1E=1A;v 6.1t(E)&&6.1t(4I)?q.5g(E,4I):q.K(u(){6(q)[6(q).4l(":1G")?"1L":"1K"].14(6(q),1E)})},7a:u(R,M){v q.26({28:"1L"},R,M)},7c:u(R,M){v q.26({28:"1K"},R,M)},7f:u(R,M){v q.K(u(){B 5k=6(q).4l(":1G")?"1L":"1K";6(q).26({28:5k},R,M)})},7r:u(R,M){v q.26({1d:"1L"},R,M)},7u:u(R,M){v q.26({1d:"1K"},R,M)},7y:u(R,43,M){v q.26({1d:43},R,M)},26:u(H,R,1v,M){v q.1F(u(){q.2F=6.1z({},H);B 1u=6.R(R,1v,M);P(B p 1x H){B e=1p 6.3b(q,1u,p);7(H[p].1l==3Q)e.2s(e.Q(),H[p]);J e[H[p]](H)}})},1F:u(C,E){7(!E){E=C;C="3b"}v q.K(u(){7(!q.1F)q.1F={};7(!q.1F[C])q.1F[C]=[];q.1F[C].1g(E);7(q.1F[C].I==1)E.14(q)})}});6.1z({R:u(R,1v,E){B 1u=R&&R.1l==7K?R:{1X:E||!E&&1v||6.1t(R)&&R,25:R,1v:E&&1v||1v&&1v.1l!=4w&&1v};1u.25=(1u.25&&1u.25.1l==3Q?1u.25:{7R:7S,7T:5X}[1u.25])||7U;1u.1N=1u.1X;1u.1X=u(){6.6a(q,"3b");7(6.1t(1u.1N))1u.1N.14(q)};v 1u},1v:{},1F:{},6a:u(D,C){C=C||"3b";7(D.1F&&D.1F[C]){D.1F[C].4L();B f=D.1F[C][0];7(f)f.14(D)}},3b:u(D,1e,H){B z=q;B y=D.1q;B 4D=6.1m(D,"1h");y.5T="1G";z.a=u(){7(1e.49)1e.49.14(D,[z.2p]);7(H=="1d")6.1I(y,"1d",z.2p);J 7(6l(z.2p))y[H]=6l(z.2p)+"4S";y.1h="2D"};z.6v=u(){v 4T(6.1m(D,H))};z.Q=u(){B r=4T(6.30(D,H));v r&&r>-8z?r:z.6v()};z.2s=u(4f,43){z.4J=(1p 5o()).5w();z.2p=4f;z.a();z.4q=3L(u(){z.49(4f,43)},13)};z.1L=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1L=U;z.2s(0,D.1y[H]);7(H!="1d")y[H]="5a"};z.1K=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1K=U;z.2s(D.1y[H],0)};z.3X=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();7(4D=="1Z"){1e.1L=U;7(H!="1d")y[H]="5a";z.2s(0,D.1y[H])}J{1e.1K=U;z.2s(D.1y[H],0)}};z.49=u(32,47){B t=(1p 5o()).5w();7(t>1e.25+z.4J){4p(z.4q);z.4q=16;z.2p=47;z.a();7(D.2F)D.2F[H]=U;B 2c=U;P(B i 1x D.2F)7(D.2F[i]!==U)2c=12;7(2c){y.5T="";y.1h=4D;7(6.1m(D,"1h")=="1Z")y.1h="2D";7(1e.1K)y.1h="1Z";7(1e.1K||1e.1L)P(B p 1x D.2F)7(p=="1d")6.1I(y,p,D.1y[p]);J y[p]=""}7(2c&&6.1t(1e.1X))1e.1X.14(D)}J{B n=t-q.4J;B p=n/1e.25;z.2p=1e.1v&&6.1v[1e.1v]?6.1v[1e.1v](p,n,32,(47-32),1e.25):((-6h.7O(p*6h.8L)/2)+0.5)*(47-32)+32;z.a()}}}})}',62,545,'||||||jQuery|if|||||||||||||||||||this||||function|return||||||var|type|elem|fn|data|event|prop|length|else|each|ret|callback|xml|value|for|cur|speed|element|undefined|true|url|browser||name|||parentNode|false||apply|status|null|document|indexOf|className|val|firstChild|obj|opacity|options|nodeName|push|display|result|msie|global|constructor|css|test|handler|new|style|arg|expr|isFunction|opt|easing|window|in|orig|extend|arguments|context|typeof|filter|args|queue|hidden|events|attr|re|hide|show|add|old|target|table|token|replace|trigger|num|elems|div|ifModified|complete|key|none|tbody|params|while|string|nodeType|duration|animate|ready|height|timeout|nth|get|done|script|nextSibling|remove|not|index|tb|fix|merge|oid|z0|preventDefault|find|now|grep|pushStack|custom|innerHTML|first|cssFloat|catch|encodeURIComponent|Array|el|guid|sibling|error|block|oldblock|curAnim|try|stopPropagation|childNodes|id|wrap|text|success|safari|load|res|exec|al|_|last|substr|has|disabled|insertBefore|selected|checked|curCSS|map|firstNum|removeChild|re2|trim|getAttribute|onreadystatechange|handlers|on|originalEvent|fx|readyList|parPos|src|opera|param|mozilla|visible|domManip|clean|cloneNode|tr|call|split|XMLHttpRequest|ajaxSettings|append|child|String|empty|ajax|form|button|inArray|multiFilter|setRequestHeader|foundToken|9_|readyState|tag|modRes|responseText|second|ival|handleError|toUpperCase|setInterval|makeArray|slice|break|oWidth|Number|returnValue|lastModified|styleFloat|bind|width|isReady|toggle|jquery|dir|eval|mouseover|select|to|defaultView|position|oHeight|lastNum|async|step|globalEval|static|pos|swap|self|from|end|float|alpha|radio|inv|is|toLowerCase|visibility|00|clearInterval|timer|rec|isTimeout|dataType|_resort|RegExp|Function|getAll|requestDone|parents|matched|isXMLDoc|appendChild|oldDisplay|active|triggered|file|documentElement|fn2|startTime|Modified|shift|lastToggle|deep|handleHover|getResponseHeader|ct|submit|px|parseFloat|html|evalScripts|getComputedStyle|getElementById|clone|els|safariTimer|currentStyle|unload|force|execScript|getPropertyValue|newProp|setTimeout|zoom|getScript|1px|sl|settings|GET|rl|check|_toggle|processData|prepend|before|state|removeAttr|ajaxStart|lt|Date|gt|eq|contentType|previousSibling|after|parent|contains|getTime|checkbox|password|appendTo|image|reset|input|webkit|href|continue|beforeSend|ajaxSend|ownerDocument|getElementsByTagName|tmp|notmodified|parse|ajaxSuccess|ajaxComplete|_prefix|ajaxStop|even|odd|overflow|delete|POST|ajaxError|200|handle|httpSuccess|nodeValue|unshift|__ie_init|srcElement|body|pageX|tagName|clientX|scrollLeft|httpNotModified|dequeue|Last|scrollTop|304|xmlRes|unbind|100|Math|httpData|click|mouseout|parseInt|json|createElement|DOMContentLoaded|prevObject|ol|setArray|exclude|join|one|max|do|relative|clientHeight|clientWidth|loadIfModified|serialize|toString|thead|tfoot|td|th|textContent|ActiveXObject|htmlFor|Microsoft|class|XMLHTTP|readOnly|gi|match|getIfModified|9999|getJSON|getAttributeNode|post|setAttribute|ig|ajaxTimeout|ajaxSetup|concat|application|userAgent|compatible|www|compatMode|CSS1Compat|next|urlencoded|siblings|children|slideDown|prependTo|slideUp|Top|insertAfter|slideToggle|removeAttribute|addClass|removeClass|open|toggleClass|Content|Type|lastChild|If|only|Since|fadeIn|Thu|01|fadeOut|enabled|Jan|1970|fadeTo|GMT|textarea|Requested|With|prev|overrideMimeType|Connection|close|boxModel|right|object|Object|navigator|substring|abort|cos|font|send|slow|600|fast|400|location|protocol|300|pageY|clientY|method|action|cancelBubble|hover|fromElement|toElement|relatedTarget|removeEventListener|blur|readonly|focus|resize|content|scroll|dblclick|mousedown|mouseup|mousemove|responseXML|change|keydown|keypress|keyup|addEventListener|write|prototype|size|scr|ipt|createTextNode|defer|FORM|reverse|noConflict|loaded|10000|weight|line|Bottom|Right|Left|padding|border|Width|offsetHeight|offsetWidth|absolute|PI|left'.split('|'),0,{}));jQuery.noConflict(); diff --git a/wp-includes/js/list-manipulation.js b/wp-includes/js/list-manipulation.js new file mode 100644 index 0000000..e522709 --- /dev/null +++ b/wp-includes/js/list-manipulation.js @@ -0,0 +1,295 @@ +addLoadEvent( function() { + if ( 'undefined' != typeof listManL10n ) + Object.extend(listMan.prototype, listManL10n); + theList = new listMan(); +} ); + +function deleteSomething( what, id, message, obj ) { + if ( !obj ) + obj=theList; + if ( !message ) + message = obj.delText.replace(/%thing%/g, what); + if( confirm(message) ) + return obj.ajaxDelete( what, id ); + else return false; +} + +function dimSomething( what, id, dimClass, obj ) { + if ( !obj ) + obj = theList; + return obj.ajaxDimmer(what,id,dimClass); +} + +var listMan = Class.create(); +Object.extend(listMan.prototype, { + ajaxRespEl: 'ajax-response', + ajaxHandler: false, + inputData: '', + clearInputs: [], + showLink: true, + topAdder: false, + alt: 'alternate', + altOffset: 0, + addComplete: null, + delComplete: null, + dimComplete: null, + dataStore: null, + formStore: null, + + jumpText: '', // We get these from listManL10n + delText: '', + + initialize: function(theListId) { + this.theList = $(theListId ? theListId : 'the-list'); + if ( !this.theList ) + return false; + Element.cleanWhitespace(this.theList); + }, + + // sends add-what and fields contained in where + // recieves html with top element having an id like what-# + ajaxAdder: function( what, where, update ) { // Do NOT wrap TR in TABLE TBODY + var ajaxAdd = new WPAjax( this.ajaxHandler, this.ajaxRespEl ); + if ( ajaxAdd.notInitialized() ) + return true; + var action = ( update ? 'update-' : 'add-' ) + what; + ajaxAdd.options.parameters = $H(ajaxAdd.options.parameters).merge({action: action}).merge(this.inputData.toQueryParams()).merge(this.grabInputs( where, ajaxAdd ).toQueryParams()); + + var tempObj=this; + ajaxAdd.addOnComplete( function(transport) { + var newItems = $A(transport.responseXML.getElementsByTagName(what)); + if ( newItems ) { + var showLinkMessage = ''; + var m = ''; + newItems.each( function(i) { + var id = i.getAttribute('id'); + var exists = $(what+'-'+id); + if ( exists ) + tempObj.replaceListItem( exists, getNodeValue(i,'response_data'), update ); + else + tempObj.addListItem( getNodeValue(i, 'response_data') ); + m = getNodeValue(i, 'show-link'); + showLinkMessage += showLinkMessage ? "
\n" : ''; + if ( m ) + showLinkMessage += m; + else + showLinkMessage += "" + tempObj.jumpText + ""; + }); + if ( tempObj.showLink && showLinkMessage ) + Element.update(ajaxAdd.myResponseElement,""); + } + if ( tempObj.addComplete && typeof tempObj.addComplete == 'function' ) + tempObj.addComplete( what, where, update, transport ); + tempObj.recolorList(); + ajaxAdd.restoreInputs = null; + }); + if ( !update ) + ajaxAdd.addOnWPError( function(transport) { tempObj.restoreForm(ajaxAdd.restoreInputs); }); + ajaxAdd.request(ajaxAdd.url); + if ( !update ) + this.clear(); + return false; + }, + + // sends update-what and fields contained in where + // recieves html with top element having an id like what-# + ajaxUpdater: function( what, where ) { return this.ajaxAdder( what, where, true ); }, + + // sends delete-what and id# + ajaxDelete: function( what, id ) { + var ajaxDel = new WPAjax( this.ajaxHandler, this.ajaxRespEl ); + if( ajaxDel.notInitialized() ) + return true; + var tempObj = this; + var action = 'delete-' + what; + var actionId = action + '&id=' + id; + var idName = what.replace('-as-spam','') + '-' + id; + ajaxDel.addOnComplete( function(transport) { + Element.update(ajaxDel.myResponseElement,''); + tempObj.destore(actionId); + if( tempObj.delComplete && typeof tempObj.delComplete == 'function' ) + tempObj.delComplete( what, id, transport ); + }); + ajaxDel.addOnWPError( function(transport) { tempObj.restore(actionId, true); }); + ajaxDel.options.parameters = $H(ajaxDel.options.parameters).merge({action: action, id: id}).merge(this.inputData.toQueryParams()); + ajaxDel.request(ajaxDel.url); + this.store(actionId, idName); + tempObj.removeListItem( idName ); + return false; + }, + + // Toggles class nomes + // sends dim-what and id# + ajaxDimmer: function( what, id, dimClass ) { + ajaxDim = new WPAjax( this.ajaxHandler, this.ajaxRespEl ); + if ( ajaxDim.notInitialized() ) + return true; + var tempObj = this; + var action = 'dim-' + what; + var actionId = action + '&id=' + id; + var idName = what + '-' + id; + ajaxDim.addOnComplete( function(transport) { + Element.update(ajaxDim.myResponseElement,''); + tempObj.destore(actionId); + if ( tempObj.dimComplete && typeof tempObj.dimComplete == 'function' ) + tempObj.dimComplete( what, id, dimClass, transport ); + }); + ajaxDim.addOnWPError( function(transport) { tempObj.restore(actionId, true); }); + ajaxDim.options.parameters = $H(ajaxDim.options.parameters).merge({action: action, id: id}).merge(this.inputData.toQueryParams()); + ajaxDim.request(ajaxDim.url); + this.store(actionId, idName); + this.dimItem( idName, dimClass ); + return false; + }, + + addListItem: function( h ) { + new Insertion[this.topAdder ? 'Top' : 'Bottom'](this.theList,h); + Element.cleanWhitespace(this.theList); + var id = this.topAdder ? this.theList.firstChild.id : this.theList.lastChild.id; + if ( this.alt ) + if ( ( this.theList.childNodes.length + this.altOffset ) % 2 ) + Element.addClassName($(id),this.alt); + Fat.fade_element(id); + }, + + // only hides the element sa it can be put back again if necessary + removeListItem: function( id, noFade ) { + id = $(id); + if ( !noFade ) { + Fat.fade_element(id.id,null,700,'#FF3333'); + var tempObj = this; + var func = function() { id.hide(); tempObj.recolorList(); } + setTimeout(func, 705); + } else { + id.hide(); + this.recolorList(); + } + }, + + replaceListItem: function( id, h, update ) { + id = $(id); + if ( !update ) { + Element.remove(id); + this.addListItem( h ); + return; + } + id.replace(h); + Fat.fade_element(id.id); + }, + + // toggles class + dimItem: function( id, dimClass, noFade ) { + id = $(id); + if ( Element.hasClassName(id,dimClass) ) { + if ( !noFade ) + Fat.fade_element(id.id,null,700,null); + Element.removeClassName(id,dimClass); + } else { + if ( !noFade ) + Fat.fade_element(id.id,null,700,'#FF3333'); + Element.addClassName(id,dimClass); + } + }, + + // store an element in case we need it later + store: function(action, id) { + if ( !this.dataStore ) + this.dataStore = $H(); + this.dataStore[action] = $(id).cloneNode(true); + }, + + // delete from store + destore: function(action) { delete(this.dataStore[action]); }, + + // restore element from store into existing (possibly hidden) element of same id + restore: function(action, error) { + var id = this.dataStore[action].id; + this.theList.replaceChild(this.dataStore[action], $(id)); + delete(this.dataStore[action]); + if ( error ) { + func = function() { Element.setStyle($(id),{backgroundColor:'#FF3333'}); } + func(); setTimeout(func, 705); // Hit it twice in case it's still fading. + } + }, + + // Like Form.serialize, but excludes action and sets up clearInputs + grabInputs: function( where, ajaxObj ) { + if ( ajaxObj ) + ajaxObj.restoreInputs = []; + var elements = Form.getElements($(where)); + var queryComponents = new Array(); + for (var i = 0; i < elements.length; i++) { + if ( 'action' == elements[i].name ) + continue; + if ( 'hidden' != elements[i].type && 'submit' != elements[i].type && 'button' != elements[i].type ) { + this.clearInputs.push(elements[i]); + if ( ajaxObj ) + ajaxObj.restoreInputs.push([elements[i], elements[i].value]); + } + var queryComponent = Form.Element.serialize(elements[i]); + if (queryComponent) { + queryComponents.push(queryComponent); + } + } + return queryComponents.join('&'); + }, + + // form.reset() can only do whole forms. This can do subsections. + clear: function() { + this.clearInputs.each( function(i) { + i = $(i); + if ( 'textarea' == i.tagName.toLowerCase() ) + i.value = ''; + else + switch ( i.type.toLowerCase() ) { + case 'password': case 'text': + i.value = ''; + break; + case 'checkbox': case 'radio': + i.checked = false; + break; + case 'select': case 'select-one': + i.selectedIndex = null; + break; + case 'select-multiple': + for (var o = 0; o < i.length; o++) i.options[o].selected = false; + break; + } + }); + this.clearInputs = []; + }, + + restoreForm: function(elements) { + elements.each( function(i) { + i[0].value = i[1]; + }); + }, + + recolorList: function() { + if ( !this.alt ) + return; + var alt = this.alt; + var offset = this.altOffset; + var listItems = $A(this.theList.childNodes).findAll( function(i) { return Element.visible(i) } ); + listItems.each( function(i,n) { + if ( ( n + offset ) % 2 ) + Element.removeClassName(i,alt); + else + Element.addClassName(i,alt); + }); + } +}); + +//No submit unless code returns true. +function killSubmit ( code, e ) { + e = e ? e : window.event; + if ( !e ) return; + var t = e.target ? e.target : e.srcElement; + if ( ( 'text' == t.type && e.keyCode == 13 ) || ( 'submit' == t.type && 'click' == e.type ) ) { + if ( ( 'string' == typeof code && !eval(code) ) || ( 'function' == typeof code && !code() ) ) { + e.returnValue = false; e.cancelBubble = true; return false; + } + } +} +//Generic but lame JS closure +function encloseFunc(f){var a=arguments[1];return function(){return f(a);}} diff --git a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php index 971da10..cf3d800 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php +++ b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php @@ -1,12 +1,10 @@ _getMatches($wordstr); for ($i=0; $iunhtmlentities(mb_substr($wordstr, $matches[$i][1], $matches[$i][2], "UTF-8")); return $words; } + function unhtmlentities($string) { + $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); + $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string); + + $trans_tbl = get_html_translation_table(HTML_ENTITIES); + $trans_tbl = array_flip($trans_tbl); + + return strtr($string, $trans_tbl); + } + // Returns array with suggestions or false if failed. function getSuggestion($word) { $sug = array(); @@ -34,37 +42,78 @@ class TinyGoogleSpell { $matches = $this->_getMatches($word); if (count($matches) > 0) - $sug = explode("\t", $matches[0][4]); + $sug = explode("\t", utf8_encode($this->unhtmlentities($matches[0][4]))); return $sug; } - function _getMatches($word_list) { - $xml = ""; + function _xmlChars($string) { + $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); + + foreach ($trans as $k => $v) + $trans[$k] = "&#".ord($k).";"; - // Setup HTTP Client - $client = new HttpClient('www.google.com'); - $client->setUserAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR'); - $client->setHandleRedirects(false); - $client->setDebug(false); + return strtr($string, $trans); + } + + function _getMatches($word_list) { + $server = "www.google.com"; + $port = 443; + $path = "/tbproxy/spell?lang=" . $this->lang . "&hl=en"; + $host = "www.google.com"; + $url = "https://" . $server; // Setup XML request - $xml .= ''; - $xml .= ''; - $xml .= '' . htmlentities($word_list) . ''; - - // Execute HTTP Post to Google - if (!$client->post('/tbproxy/spell?lang=' . $this->lang, $xml)) { - $this->errorMsg[] = 'An error occurred: ' . $client->getError(); - return array(); + $xml = '' . $word_list . ''; + + $header = "POST ".$path." HTTP/1.0 \r\n"; + $header .= "MIME-Version: 1.0 \r\n"; + $header .= "Content-type: application/PTI26 \r\n"; + $header .= "Content-length: ".strlen($xml)." \r\n"; + $header .= "Content-transfer-encoding: text \r\n"; + $header .= "Request-number: 1 \r\n"; + $header .= "Document-type: Request \r\n"; + $header .= "Interface-Version: Test 1.4 \r\n"; + $header .= "Connection: close \r\n\r\n"; + $header .= $xml; + //$this->_debugData($xml); + + // Use raw sockets + $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30); + if ($fp) { + // Send request + fwrite($fp, $header); + + // Read response + $xml = ""; + while (!feof($fp)) + $xml .= fgets($fp, 128); + + fclose($fp); + } else { + // Use curl + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL,$url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + $xml = curl_exec($ch); + curl_close($ch); } + //$this->_debugData($xml); + // Grab and parse content - $xml = $client->getContent(); preg_match_all('/([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER); return $matches; } + + function _debugData($data) { + $fh = @fopen("debug.log", 'a+'); + @fwrite($fh, $data); + @fclose($fh); + } } // Setup classname, should be the same as the name of the spellchecker class diff --git a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php index 81e3f15..5723d2f 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php +++ b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php @@ -6,6 +6,7 @@ * */ + class TinyPspellShell { var $lang; var $mode; @@ -27,7 +28,11 @@ class TinyPspellShell { $this->errorMsg = array(); $this->tmpfile = tempnam($config['tinypspellshell.tmp'], "tinyspell"); - $this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang; + + if(preg_match("#win#i",php_uname())) + $this->cmd = $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang." --encoding=utf-8 -H < $this->tmpfile 2>&1"; + else + $this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --encoding=utf-8 -H --lang=". $this->lang; } // Returns array with bad words or false if failed. @@ -36,7 +41,6 @@ class TinyPspellShell { fwrite($fh, "!\n"); foreach($wordArray as $key => $value) fwrite($fh, "^" . $value . "\n"); - fclose($fh); } else { $this->errorMsg[] = "PSpell not found."; @@ -44,7 +48,8 @@ class TinyPspellShell { } $data = shell_exec($this->cmd); - @unlink($this->tmpfile); + @unlink($this->tmpfile); + $returnData = array(); $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); @@ -66,15 +71,22 @@ class TinyPspellShell { // Returns array with suggestions or false if failed. function getSuggestion($word) { + if (function_exists("mb_convert_encoding")) + $word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8")); + else + $word = utf8_encode($word); + if ($fh = fopen($this->tmpfile, "w")) { fwrite($fh, "!\n"); fwrite($fh, "^$word\n"); fclose($fh); } else - wp_die("Error opening tmp file."); + die("Error opening tmp file."); $data = shell_exec($this->cmd); - @unlink($this->tmpfile); + + @unlink($this->tmpfile); + $returnData = array(); $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); @@ -94,6 +106,13 @@ class TinyPspellShell { } return $returnData; } + + function _debugData($data) { + $fh = @fopen("debug.log", 'a+'); + @fwrite($fh, $data); + @fclose($fh); + } + } // Setup classname, should be the same as the name of the spellchecker class diff --git a/wp-includes/js/tinymce/plugins/spellchecker/config.php b/wp-includes/js/tinymce/plugins/spellchecker/config.php index 2bfc9ec..f008d11 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/config.php +++ b/wp-includes/js/tinymce/plugins/spellchecker/config.php @@ -1,13 +1,14 @@ diff --git a/wp-includes/js/tinymce/plugins/spellchecker/css/content.css b/wp-includes/js/tinymce/plugins/spellchecker/css/content.css index fb82733..c56a453 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/css/content.css +++ b/wp-includes/js/tinymce/plugins/spellchecker/css/content.css @@ -1,5 +1,4 @@ .mceItemHiddenSpellWord { background: url('../images/wline.gif') repeat-x bottom left; - bo2rder-bottom: 1px dashed red; cursor: default; } diff --git a/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css b/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css index aa4a8ea..f2c6ac7 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css +++ b/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css @@ -31,4 +31,5 @@ font-family: Arial, Verdana, Tahoma, Helvetica; font-weight: bold; font-size: 11px; + background-color: #FFF; } diff --git a/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js b/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js index ab3fc6b..7760175 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js @@ -1,573 +1 @@ -/** - * $RCSfile: editor_plugin_src.js,v $ - * $Revision: 1.4 $ - * $Date: 2006/03/24 17:24:50 $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. - */ - -tinyMCE.importPluginLanguagePack('spellchecker', 'en,sv,nn,nb'); - -// Plucin static class -var TinyMCE_SpellCheckerPlugin = { - _contextMenu : new TinyMCE_Menu(), - _menu : new TinyMCE_Menu(), - _counter : 0, - - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_spellchecker.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - }, - - handleEvent : function(e) { - var elm = tinyMCE.isMSIE ? e.srcElement : e.target; - var inst = tinyMCE.selectedInstance, args = ''; - var self = TinyMCE_SpellCheckerPlugin; - var cm = self._contextMenu; - var p, p2, x, y, sx, sy, h, elm; - - // Handle click on word - if ((e.type == "click" || e.type == "contextmenu") && elm) { - do { - if (tinyMCE.getAttrib(elm, 'class') == "mceItemHiddenSpellWord") { - inst.spellCheckerElm = elm; - - // Setup arguments - args += 'id=' + inst.editorId + "|" + (++self._counter); - args += '&cmd=suggest&check=' + escape(elm.innerHTML); - args += '&lang=' + escape(inst.spellCheckerLang); - - elm = inst.spellCheckerElm; - p = tinyMCE.getAbsPosition(inst.iframeElement); - p2 = tinyMCE.getAbsPosition(elm); - h = parseInt(elm.offsetHeight); - sx = inst.getBody().scrollLeft; - sy = inst.getBody().scrollTop; - x = p.absLeft + p2.absLeft - sx; - y = p.absTop + p2.absTop - sy + h; - - cm.clear(); - cm.addTitle(tinyMCE.getLang('lang_spellchecker_wait', '', true)); - cm.show(); - cm.moveTo(x, y); - - inst.selection.selectNode(elm, false, false); - - self._sendAjax(self.baseURL + "/tinyspell.php", self._ajaxResponse, 'post', args); - - tinyMCE.cancelEvent(e); - return false; - } - } while ((elm = elm.parentNode)); - } - - return true; - }, - - initInstance : function(inst) { - var self = TinyMCE_SpellCheckerPlugin, m = self._menu, cm = self._contextMenu, e; - - tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/spellchecker/css/content.css"); - - if (!tinyMCE.hasMenu('spellcheckercontextmenu')) { - tinyMCE.importCSS(document, tinyMCE.baseURL + "/plugins/spellchecker/css/spellchecker.css"); - - cm.init({drop_menu : false}); - tinyMCE.addMenu('spellcheckercontextmenu', cm); - } - - if (!tinyMCE.hasMenu('spellcheckermenu')) { - m.init({}); - tinyMCE.addMenu('spellcheckermenu', m); - } - - inst.spellCheckerLang = 'en'; - self._buildSettingsMenu(inst, null); - - e = self._getBlockBoxLayer(inst).create('div', 'mceBlockBox', document.getElementById(inst.editorId + '_parent')); - self._getMsgBoxLayer(inst).create('div', 'mceMsgBox', document.getElementById(inst.editorId + '_parent')); - }, - - _getMsgBoxLayer : function(inst) { - if (!inst.spellCheckerMsgBoxL) - inst.spellCheckerMsgBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerMsgBox', false); - - return inst.spellCheckerMsgBoxL; - }, - - _getBlockBoxLayer : function(inst) { - if (!inst.spellCheckerBoxL) - inst.spellCheckerBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerBlockBox', false); - - return inst.spellCheckerBoxL; - }, - - _buildSettingsMenu : function(inst, lang) { - var i, ar = tinyMCE.getParam('spellchecker_languages', '+English=en').split(','), p; - var self = TinyMCE_SpellCheckerPlugin, m = self._menu, c; - - m.clear(); - m.addTitle(tinyMCE.getLang('lang_spellchecker_langs', '', true)); - - for (i=0; i'; - h += ''; - h += ''; - h += ''; - } else { - if (tinyMCE.isMSIE && !tinyMCE.isOpera) - h += ''; - else - h += ''; - - h += ''; - h += ''; - h += ''; - h += ''; - } - - return h; - }, - - _menuButtonEvent : function(e, o) { - if (o.className == 'mceMenuButtonFocus') - return; - - if (e == 'over') - o.className = o.className + ' mceMenuHover'; - else - o.className = o.className.replace(/\s.*$/, ''); - }, - - _toggleMenu : function(editor_id, id) { - var self = TinyMCE_SpellCheckerPlugin; - var e = document.getElementById(editor_id + '_spellchecker'); - var inst = tinyMCE.getInstanceById(editor_id); - - if (self._menu.isVisible()) { - tinyMCE.hideMenus(); - return; - } - - tinyMCE.lastMenuBtnClass = e.className.replace(/\s.*$/, ''); - tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButtonFocus'); - - self._menu.moveRelativeTo(e, 'bl'); - self._menu.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? 0 : 1, -1); - - if (tinyMCE.isOpera) - self._menu.moveBy(0, -2); - - self._onMenuEvent(inst, self._menu, 'show'); - - self._menu.show(); - - tinyMCE.lastSelectedMenuBtn = editor_id + '_spellchecker'; - }, - - _onMenuEvent : function(inst, m, n) { - TinyMCE_SpellCheckerPlugin._buildSettingsMenu(inst, inst.spellCheckerLang); - }, - - execCommand : function(editor_id, element, command, user_interface, value) { - var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_SpellCheckerPlugin, args = '', co, bb, mb, nl, i, e; - - // Handle commands - switch (command) { - case "mceSpellCheck": - if (!inst.spellcheckerOn) { - inst.spellCheckerBookmark = inst.selection.getBookmark(); - - // Setup arguments - args += 'id=' + inst.editorId + "|" + (++self._counter); - args += '&cmd=spell&check=' + escape(self._getWordList(inst.getBody())).replace(/%20/g, '+'); - args += '&lang=' + escape(inst.spellCheckerLang); - - co = document.getElementById(inst.editorId + '_parent').firstChild; - bb = self._getBlockBoxLayer(inst); - bb.moveRelativeTo(co, 'tl'); - bb.resizeTo(co.offsetWidth, co.offsetHeight); - bb.show(); - - // Setup message box - mb = self._getMsgBoxLayer(inst); - e = mb.getElement(); - e.innerHTML = '' + tinyMCE.getLang('lang_spellchecker_swait', '', true) + ''; - mb.show(); - mb.moveRelativeTo(co, 'cc'); - - if (tinyMCE.isMSIE && !tinyMCE.isOpera) { - nl = co.getElementsByTagName('select'); - for (i=0; i?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c'); - - for (i=0; i=0; i--) { - c = tinyMCE.getAttrib(nl[i], 'class'); - - if ((c == 'mceItemHiddenSpellWord' || c == 'mceItemHidden') && (word == null || nl[i].innerHTML == word)) - self._removeWord(nl[i]); - } - - if (b) - inst.selection.moveToBookmark(b); - }, - - _checkDone : function(inst) { - var i, w = 0, nl = inst.getDoc().getElementsByTagName("span") - var self = TinyMCE_SpellCheckerPlugin; - - for (i=nl.length-1; i>=0; i--) { - c = tinyMCE.getAttrib(nl[i], 'class'); - - if (c == 'mceItemHiddenSpellWord') - w++; - } - - if (w == 0) { - self._removeWords(inst.getDoc()); - inst.spellcheckerOn = false; - tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton'); - } - }, - - _removeWord : function(e) { - tinyMCE.setOuterHTML(e, e.innerHTML); - }, - - _markWords : function(doc, n, wl) { - var i, nv, nn, nl = tinyMCE.getNodeTree(n, new Array(), 3); - var r1, r2, r3, r4, r5, w = ''; - var re = TinyMCE_SpellCheckerPlugin._getWordSeparators(); - - for (i=0; i$1$2'); - nv = nv.replace(r3, '$1$2'); - - nn = doc.createElement('span'); - nn.className = "mceItemHidden"; - nn.innerHTML = nv; - - // Remove old text node - nl[i].parentNode.replaceChild(nn, nl[i]); - } - } - }, - - _buildMenu : function(sg, max) { - var i, self = TinyMCE_SpellCheckerPlugin, cm = self._contextMenu; - - cm.clear(); - - if (sg != null) { - cm.addTitle(tinyMCE.getLang('lang_spellchecker_sug', '', true)); - - for (i=0; i';h+='';h+='';h+='';}else{if(tinyMCE.isMSIE&&!tinyMCE.isOpera)h+='';else h+='';h+='';h+='';h+='';h+='';}return h;},_menuButtonEvent:function(e,o){var t=this;window.setTimeout(function(){t._menuButtonEvent2(e,o);},1);},_menuButtonEvent2:function(e,o){if(o.className=='mceMenuButtonFocus')return;if(e=='over')o.className=o.className+' mceMenuHover';else o.className=o.className.replace(/\s.*$/,'');},_toggleMenu:function(editor_id,id){var self=TinyMCE_SpellCheckerPlugin;var e=document.getElementById(editor_id+'_spellchecker');var inst=tinyMCE.getInstanceById(editor_id);if(self._menu.isVisible()){tinyMCE.hideMenus();return;}tinyMCE.lastMenuBtnClass=e.className.replace(/\s.*$/,'');tinyMCE.switchClass(editor_id+'_spellchecker','mceMenuButtonFocus');self._menu.moveRelativeTo(e,'bl');self._menu.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?0:1,-1);if(tinyMCE.isOpera)self._menu.moveBy(0,-2);self._onMenuEvent(inst,self._menu,'show');self._menu.show();tinyMCE.lastSelectedMenuBtn=editor_id+'_spellchecker';},_onMenuEvent:function(inst,m,n){TinyMCE_SpellCheckerPlugin._buildSettingsMenu(inst,inst.spellCheckerLang);},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),self=TinyMCE_SpellCheckerPlugin,args='',co,bb,mb,nl,i,e,mbs;switch(command){case"mceSpellCheck":if(!inst.spellcheckerOn){inst.spellCheckerBookmark=inst.selection.getBookmark();if(tinyMCE.isRealIE)tinyMCE.setInnerHTML(inst.getBody(),inst.getBody().innerHTML);args+='id='+inst.editorId+"|"+(++self._counter);args+='&cmd=spell&check='+encodeURIComponent(self._getWordList(inst.getBody())).replace(/\'/g,'%27');args+='&lang='+escape(inst.spellCheckerLang);co=document.getElementById(inst.editorId+'_parent').firstChild;bb=self._getBlockBoxLayer(inst);bb.moveRelativeTo(co,'tl');bb.resizeTo(co.offsetWidth,co.offsetHeight);bb.show();mb=self._getMsgBoxLayer(inst);e=mb.getElement();if(e.childNodes[0])e.removeChild(e.childNodes[0]);mbs=document.createElement("span");mbs.innerHTML=''+tinyMCE.getLang('lang_spellchecker_swait','',true)+'';e.appendChild(mbs);mb.show();mb.moveRelativeTo(co,'cc');if(tinyMCE.isMSIE&&!tinyMCE.isOpera){nl=co.getElementsByTagName('select');for(i=0;i?@[\]^_{|}\u201d\u201c');for(i=0;i0)wl[wl.length]=nl[i];}return wl.join(' ');},_removeWords:function(doc,word,cleanup){var i,c,nl=doc.getElementsByTagName("span");var self=TinyMCE_SpellCheckerPlugin;var inst=tinyMCE.selectedInstance,b=inst?inst.selection.getBookmark():null;word=typeof(word)=='undefined'?null:word;for(i=nl.length-1;i>=0;i--){c=tinyMCE.getAttrib(nl[i],'class');if((c=='mceItemHiddenSpellWord'||c=='mceItemHidden')&&(word==null||nl[i].innerHTML==word))self._removeWord(nl[i]);}if(b&&!cleanup)inst.selection.moveToBookmark(b);},_checkDone:function(inst){var self=TinyMCE_SpellCheckerPlugin;var w=self._countWords(inst);if(w==0){self._removeWords(inst.getDoc());inst.spellcheckerOn=false;tinyMCE.switchClass(inst.editorId+'_spellchecker','mceMenuButton');}},_countWords:function(inst){var i,w=0,nl=inst.getDoc().getElementsByTagName("span"),c;var self=TinyMCE_SpellCheckerPlugin;for(i=nl.length-1;i>=0;i--){c=tinyMCE.getAttrib(nl[i],'class');if(c=='mceItemHiddenSpellWord')w++;}return w;},_removeWord:function(e){if(e!=null)tinyMCE.setOuterHTML(e,e.innerHTML);},_markWords:function(doc,n,wl){var i,nv,nn,nl=tinyMCE.getNodeTree(n,new Array(),3);var r1,r2,r3,r4,r5,w='';var re=TinyMCE_SpellCheckerPlugin._getWordSeparators();for(i=0;i0)w+=wl[i]+((i==wl.length-1)?'':'|');}for(i=0;i$1$2');nv=nv.replace(r3,'$1$2');nn=doc.createElement('span');nn.className="mceItemHidden";nn.innerHTML=nv;nl[i].parentNode.replaceChild(nn,nl[i]);}}},_buildMenu:function(sg,max){var i,self=TinyMCE_SpellCheckerPlugin,cm=self._contextMenu;cm.clear();if(sg!=null){cm.addTitle(tinyMCE.getLang('lang_spellchecker_sug','',true));for(i=0;icheckWords($words); break; + case "suggest": $result = $tinyspell->getSuggestion($check); break; + default: // Just use this for now. $tinyspell->errorMsg[] = "No command."; @@ -109,19 +114,22 @@ switch($outputType) { case "xml": header('Content-type: text/xml; charset=utf-8'); - echo ''; - echo "\n"; + $body = ''; + $body .= "\n"; + if (count($result) == 0) - echo ''; + $body .= ''; else - echo ''. utf8_encode(implode(" ", $result)) .''; + $body .= ''. urlencode(implode(" ", $result)) .''; + echo $body; break; case "xmlerror"; header('Content-type: text/xml; charset=utf-8'); - echo ''; - echo "\n"; - echo 'errorMsg) .'" />'; + $body = ''; + $body .= "\n"; + $body .= 'errorMsg) .'" />'; + echo $body; break; case "html": var_dump($result); @@ -130,4 +138,5 @@ echo "Error"; break; } -?> + +?> diff --git a/wp-includes/js/tinymce/plugins/wordpress/wordpress.css b/wp-includes/js/tinymce/plugins/wordpress/wordpress.css index cbc9bac..00b454f 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/wordpress.css +++ b/wp-includes/js/tinymce/plugins/wordpress/wordpress.css @@ -48,7 +48,6 @@ pre { line-height: 6px; overflow: hidden; padding-left: 12px; - background-image: url('../images/anchor_symbol.gif'); background-position: bottom; background-repeat: no-repeat; } diff --git a/wp-includes/js/tinymce/wp-mce-help.php b/wp-includes/js/tinymce/wp-mce-help.php index fe90b0d..6d5f1e4 100644 --- a/wp-includes/js/tinymce/wp-mce-help.php +++ b/wp-includes/js/tinymce/wp-mce-help.php @@ -167,7 +167,7 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset')); @@ -154,9 +154,9 @@ case 'retrievepassword' :
  • -
  • «
  • +
  • -
  • «
  • +
  • @@ -208,7 +208,7 @@ default: $user_pass = ''; $using_cookie = FALSE; - if ( !isset( $_REQUEST['redirect_to'] ) ) + if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() ) $redirect_to = 'wp-admin/'; else $redirect_to = $_REQUEST['redirect_to']; @@ -277,7 +277,7 @@ default:

    - +

    @@ -287,9 +287,9 @@ default:
  • -
  • «
  • +
  • -
  • «
  • +
  • diff --git a/wp-settings.php b/wp-settings.php index c587e38..93ee03e 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -48,7 +48,7 @@ if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; // Fix for Dreamhost and other PHP as CGI hosts -if ( strstr( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) ) +if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false) unset($_SERVER['PATH_INFO']); // Fix empty PHP_SELF @@ -107,29 +107,37 @@ if ( file_exists(ABSPATH . 'wp-content/db.php') ) else require_once (ABSPATH . WPINC . '/wp-db.php'); -$wpdb->blogs = $table_prefix . 'blogs'; -$wpdb->users = $table_prefix . 'users'; -$wpdb->usermeta = $table_prefix . 'usermeta'; -$wpdb->site = $table_prefix . 'site'; -$wpdb->sitemeta = $table_prefix . 'sitemeta'; -$wpdb->sitecategories = $table_prefix . 'sitecategories'; -$wpdb->signups = $table_prefix . 'signups'; -$wpdb->registration_log = $table_prefix . 'registration_log'; -$wpdb->blog_versions = $table_prefix . 'blog_versions'; +// $table_prefix is deprecated as of 2.1 +$wpdb->prefix = $table_prefix; + +if ( preg_match('|[^a-z0-9_]|i', $wpdb->prefix) && !file_exists(ABSPATH . 'wp-content/db.php') ) + die("ERROR: $table_prefix in wp-config.php can only contain numbers, letters, and underscores."); + +// Table names + +$wpdb->blogs = $wpdb->prefix . 'blogs'; +$wpdb->site = $wpdb->prefix . 'site'; +$wpdb->sitemeta = $wpdb->prefix . 'sitemeta'; +$wpdb->sitecategories = $wpdb->prefix . 'sitecategories'; +$wpdb->signups = $wpdb->prefix . 'signups'; +$wpdb->registration_log = $wpdb->prefix . 'registration_log'; +$wpdb->blog_versions = $wpdb->prefix . 'blog_versions'; +$wpdb->users = $wpdb->prefix . 'users'; +$wpdb->usermeta = $wpdb->prefix . 'usermeta'; require_once ( ABSPATH . 'wpmu-settings.php' ); +$wpdb->prefix = $table_prefix; +$wpdb->posts = $wpdb->prefix . 'posts'; +$wpdb->categories = $wpdb->prefix . 'categories'; +$wpdb->post2cat = $wpdb->prefix . 'post2cat'; +$wpdb->comments = $wpdb->prefix . 'comments'; +$wpdb->link2cat = $wpdb->prefix . 'link2cat'; +$wpdb->links = $wpdb->prefix . 'links'; +$wpdb->linkcategories = $wpdb->prefix . 'linkcategories'; +$wpdb->options = $wpdb->prefix . 'options'; +$wpdb->postmeta = $wpdb->prefix . 'postmeta'; $wpdb->siteid = $site_id; $wpdb->blogid = $blog_id; -$wpdb->posts = $table_prefix . 'posts'; -$wpdb->categories = $table_prefix . 'categories'; -$wpdb->post2cat = $table_prefix . 'post2cat'; -$wpdb->comments = $table_prefix . 'comments'; -$wpdb->link2cat = $table_prefix . 'link2cat'; -$wpdb->links = $table_prefix . 'links'; -$wpdb->linkcategories = $table_prefix . 'linkcategories'; -$wpdb->options = $table_prefix . 'options'; -$wpdb->postmeta = $table_prefix . 'postmeta'; -$wpdb->prefix = $table_prefix; if ( defined('CUSTOM_USER_TABLE') ) $wpdb->users = CUSTOM_USER_TABLE; @@ -163,16 +171,13 @@ include_once(ABSPATH . WPINC . '/streams.php'); include_once(ABSPATH . WPINC . '/gettext.php'); require_once (ABSPATH . WPINC . '/l10n.php'); -$wpdb->hide_errors(); -$db_check = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'"); -if ( !$db_check && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) { - if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) +if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { + if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $link = 'install.php'; else $link = 'wp-admin/install.php'; - wp_die(sprintf(__("It doesn't look like you've installed WP yet. Try running install.php."), $link)); + wp_die(sprintf("It doesn't look like you've installed WP yet. Try running install.php.", $link)); } -$wpdb->show_errors(); require (ABSPATH . WPINC . '/formatting.php'); require (ABSPATH . WPINC . '/capabilities.php'); diff --git a/xmlrpc.php b/xmlrpc.php index 274496e..69937e0 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -149,7 +149,7 @@ class wp_xmlrpc_server extends IXR_Server { function escape(&$array) { global $wpdb; - if(is_string($array)) { + if(!is_array($array)) { return($wpdb->escape($array)); } else { @@ -594,7 +594,7 @@ class wp_xmlrpc_server extends IXR_Server { ); } - return $struct; + return array($struct); } @@ -1110,7 +1110,7 @@ class wp_xmlrpc_server extends IXR_Server { } // Only set a post parent if one was given. - if(!empty($content_struct["wp_page_parent_id"])) { + if(isset($content_struct["wp_page_parent_id"])) { $post_parent = $content_struct["wp_page_parent_id"]; } @@ -1176,11 +1176,11 @@ class wp_xmlrpc_server extends IXR_Server { $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array($to_ping) ) $to_ping = implode(' ', $to_ping); - - $comment_status = (!isset($content_struct['mt_allow_comments'])) ? - get_option('default_comment_status') - : $content_struct['mt_allow_comments']; + if(isset($content_struct["mt_allow_comments"])) { + $comment_status = $content_struct["mt_allow_comments"]; + } + // Do some timestamp voodoo $dateCreatedd = $content_struct['dateCreated']; if (!empty($dateCreatedd)) { @@ -1397,6 +1397,25 @@ class wp_xmlrpc_server extends IXR_Server { $overwrite = false; if(!empty($data["overwrite"]) && ($data["overwrite"] == true)) { $overwrite = true; + + // If the file isn't writable then error out now. + if(!is_writable($data["name"])) { + return(new IXR_Error(500, "File is not writable, over write failed.")); + } + + // We now know the file is good so don't use the sanitized name. + $name = $data["name"]; + + // Get postmeta info on the object. + $old_meta = $wpdb->get_row(" + SELECT * + FROM {$wpdb->postmeta} + WHERE meta_key = '_wp_attached_file' + AND meta_value = '{$name}' + "); + + // Get post info on the object. + $old_post = get_post($old_meta->post_id); } logIO('O', '(MW) Received '.strlen($bits).' bytes'); @@ -1431,13 +1450,21 @@ class wp_xmlrpc_server extends IXR_Server { 'guid' => $upload[ 'url' ] ); - // Only make a database entry if this is a new file. - if(!$overwrite) { - // Save the data - $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); - wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); + // If we are over writing then set the correct post_id and URL + // instead of getting new ones. + if($overwrite) { + $post_id = $old_meta->post_id; + $attachment["post_parent"] = $old_meta->post_id; + $attachment["ID"] = $old_meta->post_id; + + $upload["url"] = $old_post->guid; + $attachment["guid"] = $old_post->guid; } + // Save the data + $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); + wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); + return apply_filters( 'wp_handle_upload', array( 'file' => $upload[ 'file' ], 'url' => $upload[ 'url' ], 'type' => $type ) ); } -- cgit