From 72e9496bfc2f7a962cf4f428ccab25c7a0175aaa Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 16 Jan 2007 21:27:04 +0000 Subject: WP Merge to rev 4753 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@849 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/category.php | 4 ++-- wp-includes/classes.php | 6 ++++-- wp-includes/deprecated.php | 15 +++++++++++++++ wp-includes/functions.php | 18 +++++++++++++++--- wp-includes/gettext.php | 6 +++++- wp-includes/js/tinymce/plugins/autosave/langs/cs.js | 0 wp-includes/js/tinymce/plugins/autosave/langs/sv.js | 0 .../tinymce/plugins/inlinepopups/editor_plugin_src.js | 0 wp-includes/js/tinymce/plugins/inlinepopups/readme.txt | 0 wp-includes/js/tinymce/plugins/paste/editor_plugin.js | 1 - wp-includes/js/tinymce/tiny_mce_config.php | 4 ---- wp-includes/js/tinymce/wp-mce-help.php | 2 +- wp-includes/post-template.php | 5 +++-- wp-includes/post.php | 4 ++-- wp-includes/registration-functions.php | 4 ++++ wp-includes/rss-functions.php | 4 ++++ wp-includes/script-loader.php | 7 ++----- 17 files changed, 57 insertions(+), 23 deletions(-) delete mode 100644 wp-includes/js/tinymce/plugins/autosave/langs/cs.js delete mode 100644 wp-includes/js/tinymce/plugins/autosave/langs/sv.js delete mode 100644 wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin_src.js delete mode 100644 wp-includes/js/tinymce/plugins/inlinepopups/readme.txt create mode 100644 wp-includes/registration-functions.php create mode 100644 wp-includes/rss-functions.php (limited to 'wp-includes') diff --git a/wp-includes/category.php b/wp-includes/category.php index 7f47161..7fdc334 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -5,7 +5,7 @@ function get_all_category_ids() { if ( ! $cat_ids = wp_cache_get('all_category_ids', 'category') ) { $cat_ids = $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories"); - wp_cache_add('all_category_ids', $cat_ids, 'category'); + wp_cache_set('all_category_ids', $cat_ids, 'category'); } return $cat_ids; @@ -148,7 +148,7 @@ function &get_category(&$category, $output = OBJECT) { } else { if ( ! $_category = wp_cache_get($category, 'category') ) { $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1"); - wp_cache_add($category, $_category, 'category'); + wp_cache_set($category, $_category, 'category'); } } diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 62cee05..47470d3 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -224,6 +224,8 @@ class WP { foreach (array_keys($this->query_vars) as $wpvar) { if ( '' != $this->query_vars[$wpvar] ) { $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&'; + if ( !is_scalar($this->query_vars[$wpvar]) ) // Discard non-scalars. + continue; $this->query_string .= $wpvar . '=' . rawurlencode($this->query_vars[$wpvar]); } } @@ -498,10 +500,10 @@ class Walker_Page extends Walker { return $output; } - function start_el($output, $page, $depth, $current_page, $show_date, $date_format) { + function start_el($output, $page, $depth, $current_page, $args) { if ( $depth ) $indent = str_repeat("\t", $depth); - + extract($args); $css_class = 'page_item'; $_current_page = get_page( $current_page ); if ( $page->ID == $current_page ) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 6afe8d2..d0027a5 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -1,4 +1,19 @@ posts; +$tableusers = $wpdb->users; +$tablecategories = $wpdb->categories; +$tablepost2cat = $wpdb->post2cat; +$tablecomments = $wpdb->comments; +$tablelinks = $wpdb->links; +$tablelinkcategories = 'linkcategories_is_gone'; +$tableoptions = $wpdb->options; +$tablepostmeta = $wpdb->postmeta; + /* * Deprecated functios come here to die. */ diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 4f103e9..bb7965e 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -791,10 +791,21 @@ function add_magic_quotes($array) { } function wp_remote_fopen( $uri ) { + $timeout = 10; + $parsed_url = @parse_url($uri); + + if ( !$parsed_url || !is_array($parsed_url) ) + return false; + + if ( !isset($parsed_url['scheme']) || !in_array($parsed_url['scheme'], array('http','https')) ) + $uri = 'http://' . $uri; + if ( ini_get('allow_url_fopen') ) { $fp = @fopen( $uri, 'r' ); if ( !$fp ) return false; + + //stream_set_timeout($fp, $timeout); // Requires php 4.3 $linea = ''; while( $remote_read = fread($fp, 4096) ) $linea .= $remote_read; @@ -805,6 +816,7 @@ function wp_remote_fopen( $uri ) { curl_setopt ($handle, CURLOPT_URL, $uri); curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 1); curl_setopt ($handle, CURLOPT_RETURNTRANSFER, 1); + curl_setopt ($handle, CURLOPT_TIMEOUT, $timeout); $buffer = curl_exec($handle); curl_close($handle); return $buffer; @@ -833,10 +845,10 @@ function status_header( $header ) { elseif ( 410 == $header ) $text = 'Gone'; -// if ( substr(php_sapi_name(), 0, 3) == 'cgi' ) + if ( version_compare(phpversion(), '4.3.0', '>=') ) + @header("HTTP/1.1 $header $text", true, $header); + else @header("HTTP/1.1 $header $text"); -// else -// @header("Status: $header $text"); } function nocache_headers() { diff --git a/wp-includes/gettext.php b/wp-includes/gettext.php index ed94ca9..a35b0b9 100644 --- a/wp-includes/gettext.php +++ b/wp-includes/gettext.php @@ -302,7 +302,11 @@ class gettext_reader { $string = str_replace('nplurals',"\$total",$string); $string = str_replace("n",$n,$string); $string = str_replace('plural',"\$plural",$string); - + + # poEdit doesn't put any semicolons, which + # results in parse error in eval + $string .= ';'; + $total = 0; $plural = 0; diff --git a/wp-includes/js/tinymce/plugins/autosave/langs/cs.js b/wp-includes/js/tinymce/plugins/autosave/langs/cs.js deleted file mode 100644 index e69de29..0000000 diff --git a/wp-includes/js/tinymce/plugins/autosave/langs/sv.js b/wp-includes/js/tinymce/plugins/autosave/langs/sv.js deleted file mode 100644 index e69de29..0000000 diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin_src.js b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin_src.js deleted file mode 100644 index e69de29..0000000 diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/readme.txt b/wp-includes/js/tinymce/plugins/inlinepopups/readme.txt deleted file mode 100644 index e69de29..0000000 diff --git a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js index de5edbe..1306c0b 100644 --- a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js @@ -383,4 +383,3 @@ var TinyMCE_PastePlugin = { }; tinyMCE.addPlugin("paste", TinyMCE_PastePlugin); - diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 01f5ccd..808cfb6 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -31,9 +31,6 @@ $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator', 'link', 'unlink', 'image', 'wp_more', 'separator', 'spellchecker', 'separator', 'wp_help', 'wp_adv_start', 'wp_adv', 'separator', 'formatselect', 'underline', 'justifyfull', 'forecolor', 'separator', 'pastetext', 'pasteword', 'separator', 'removeformat', 'cleanup', 'separator', 'charmap', 'separator', 'undo', 'redo', 'wp_adv_end')); $mce_buttons = implode($mce_buttons, ','); - if ( !user_can_richedit() ) - $mce_buttons = str_replace('wp_help', 'wp_help,code', $mce_buttons); - $mce_buttons_2 = apply_filters('mce_buttons_2', array()); $mce_buttons_2 = implode($mce_buttons_2, ','); @@ -65,7 +62,6 @@ initArray = { theme_advanced_toolbar_align : "left", theme_advanced_path_location : "bottom", theme_advanced_resizing : true, - theme_advanced_source_editor_wrap : true, browsers : "", dialog_type : "modal", theme_advanced_resize_horizontal : false, diff --git a/wp-includes/js/tinymce/wp-mce-help.php b/wp-includes/js/tinymce/wp-mce-help.php index 2daf7ef..0893127 100644 --- a/wp-includes/js/tinymce/wp-mce-help.php +++ b/wp-includes/js/tinymce/wp-mce-help.php @@ -140,7 +140,7 @@

-

') ?> +

diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 5ecebd9..4951baa 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -289,7 +289,7 @@ function wp_list_pages($args = '') { global $wp_query; $current_page = $wp_query->get_queried_object_id(); - $output .= walk_page_tree($pages, $r['depth'], $current_page, $r['show_date'], $r['date_format']); + $output .= walk_page_tree($pages, $r['depth'], $current_page, $r); if ( $r['title_li'] ) $output .= ''; @@ -368,8 +368,9 @@ function get_attachment_icon_src( $id = 0, $fullsize = false ) { $src_file = $icon_dir . '/' . basename($src); } - if ( !isset($src) ) + if ( !isset($src) || !$src ) return false; + return array($src, $src_file); } diff --git a/wp-includes/post.php b/wp-includes/post.php index c3d3b6a..058db08 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -904,7 +904,7 @@ function get_all_page_ids() { if ( ! $page_ids = wp_cache_get('all_page_ids', 'pages') ) { $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'"); - wp_cache_add('all_page_ids', $page_ids, 'pages'); + wp_cache_set('all_page_ids', $page_ids, 'pages'); } return $page_ids; @@ -946,7 +946,7 @@ function &get_page(&$page, $output = OBJECT) { return get_post($_page, $output); // Potential issue: we're not checking to see if the post_type = 'page' // So all non-'post' posts will get cached as pages. - wp_cache_add($_page->ID, $_page, 'pages'); + wp_cache_set($_page->ID, $_page, 'pages'); } } } diff --git a/wp-includes/registration-functions.php b/wp-includes/registration-functions.php new file mode 100644 index 0000000..d270cd2 --- /dev/null +++ b/wp-includes/registration-functions.php @@ -0,0 +1,4 @@ + diff --git a/wp-includes/rss-functions.php b/wp-includes/rss-functions.php new file mode 100644 index 0000000..c07f867 --- /dev/null +++ b/wp-includes/rss-functions.php @@ -0,0 +1,4 @@ + diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 43e076d..bcc8bc5 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -38,7 +38,7 @@ class WP_Scripts { $this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3847' ); $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '4583' ); $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' ); - $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20061223' ); + $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20070116' ); } } @@ -146,10 +146,7 @@ class WP_Scripts { foreach ( (array) $handles as $handle ) { $handle = explode('?', $handle); if ( !in_array($handle[0], $this->queue) && isset($this->scripts[$handle[0]]) ) { - if ( 'wp_tiny_mce' == $handle[0] ) // HACK: Put tinyMCE first. - array_unshift($this->queue, $handle[0]); - else - $this->queue[] = $handle[0]; + $this->queue[] = $handle[0]; if ( isset($handle[1]) ) $this->args[$handle[0]] = $handle[1]; } -- cgit