diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-01-24 14:02:03 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-01-24 14:02:03 +0000 |
commit | dbd5b2e2e7e46eda5233d61f01793e41a8d8e6fd (patch) | |
tree | 36cc2bc24306895ce5b20353d87156d4eeb6963c | |
parent | 6c1930bf126a5059115dfe7895ac448b86518c8b (diff) | |
download | wordpress-mu-dbd5b2e2e7e46eda5233d61f01793e41a8d8e6fd.tar.gz wordpress-mu-dbd5b2e2e7e46eda5233d61f01793e41a8d8e6fd.tar.xz wordpress-mu-dbd5b2e2e7e46eda5233d61f01793e41a8d8e6fd.zip |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@514 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r-- | wp-inst/wp-admin/admin-functions.php | 1 | ||||
-rw-r--r-- | wp-inst/wp-admin/plugins.php | 7 | ||||
-rw-r--r-- | wp-inst/wp-admin/post.php | 2 | ||||
-rw-r--r-- | wp-inst/wp-admin/themes.php | 2 | ||||
-rw-r--r-- | wp-inst/wp-includes/classes.php | 27 | ||||
-rw-r--r-- | wp-inst/wp-includes/functions-compat.php | 10 | ||||
-rw-r--r-- | wp-inst/wp-includes/functions.php | 5 | ||||
-rw-r--r-- | wp-inst/wp-links-opml.php | 7 | ||||
-rw-r--r-- | wp-inst/wp-mail.php | 6 |
9 files changed, 47 insertions, 20 deletions
diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php index 7f516da..6fc0ec3 100644 --- a/wp-inst/wp-admin/admin-functions.php +++ b/wp-inst/wp-admin/admin-functions.php @@ -1616,6 +1616,7 @@ function get_importers() { function current_theme_info() { $themes = get_themes(); $current_theme = get_current_theme(); + $ct->name = $current_theme; $ct->title = $themes[$current_theme]['Title']; $ct->version = $themes[$current_theme]['Version']; $ct->parent_theme = $themes[$current_theme]['Parent Theme']; diff --git a/wp-inst/wp-admin/plugins.php b/wp-inst/wp-admin/plugins.php index daf4de5..948bfcd 100644 --- a/wp-inst/wp-admin/plugins.php +++ b/wp-inst/wp-admin/plugins.php @@ -94,6 +94,13 @@ if (empty($plugins)) { </tr> <?php $style = ''; + + function sort_plugins($plug1, $plug2) { + return strnatcasecmp($plug1['Name'], $plug2['Name']); + } + + uksort($plugins, 'sort_plugins'); + foreach($plugins as $plugin_file => $plugin_data) { $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate'; diff --git a/wp-inst/wp-admin/post.php b/wp-inst/wp-admin/post.php index a5b18f0..026a453 100644 --- a/wp-inst/wp-admin/post.php +++ b/wp-inst/wp-admin/post.php @@ -80,7 +80,7 @@ case 'edit': ?> <div id='preview' class='wrap'> <h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit ↑'); ?></a></small></h2> - <iframe src="<?php the_permalink(); ?>" width="100%" height="600" ></iframe> + <iframe src="<?php echo add_query_arg('preview', 'true', get_permalink($post->ID)); ?>" width="100%" height="600" ></iframe> </div> <?php break; diff --git a/wp-inst/wp-admin/themes.php b/wp-inst/wp-admin/themes.php index 8821bf7..565d2aa 100644 --- a/wp-inst/wp-admin/themes.php +++ b/wp-inst/wp-admin/themes.php @@ -73,7 +73,7 @@ $theme_names = array_keys($themes); natcasesort($theme_names); foreach ($theme_names as $theme_name) { - if ( $theme_name == $current_theme ) + if ( $theme_name == $ct->name ) continue; $template = $themes[$theme_name]['Template']; $stylesheet = $themes[$theme_name]['Stylesheet']; diff --git a/wp-inst/wp-includes/classes.php b/wp-inst/wp-includes/classes.php index 8e4d2d5..cdd9a6e 100644 --- a/wp-inst/wp-includes/classes.php +++ b/wp-inst/wp-includes/classes.php @@ -226,6 +226,11 @@ class WP_Query { if ('' != $qv['comments_popup']) { $this->is_comments_popup = true; } + + //if we're previewing inside the write screen + if ('' != $qv['preview']) { + $this->is_preview = true; + } if (strstr($_SERVER['PHP_SELF'], 'wp-admin/')) { $this->is_admin = true; @@ -971,13 +976,13 @@ class WP_Rewrite { if( is_array( $attachment_uris ) ) { foreach ($attachment_uris as $uri => $pagename) { $this->add_rewrite_tag('%pagename%', "($uri)", 'attachment='); - $rewrite_rules += $this->generate_rewrite_rules($page_structure); + $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure)); } } if( is_array( $uris ) ) { foreach ($uris as $uri => $pagename) { $this->add_rewrite_tag('%pagename%', "($uri)", 'pagename='); - $rewrite_rules += $this->generate_rewrite_rules($page_structure); + $rewrite_rules = array_merge($rewrite_rules, $this->generate_rewrite_rules($page_structure)); } } @@ -1239,7 +1244,7 @@ class WP_Rewrite { if ($feed) $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2); if ($paged) - $rewrite = $rewrite + array($pagematch => $pagequery); + $rewrite = array_merge($rewrite, array($pagematch => $pagequery)); if ($num_toks) { $post = false; @@ -1274,19 +1279,17 @@ class WP_Rewrite { $query = $index . '?' . $query; } - $rewrite = $rewrite + array($match => $query); + $rewrite = array_merge($rewrite, array($match => $query)); if ($post) { - $rewrite = array($trackbackmatch => $trackbackquery) + $rewrite; + $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite); if ( ! $page ) - $rewrite = $rewrite + array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery); - $rewrite = $rewrite + array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery); + $rewrite = array_merge($rewrite, array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery)); + $rewrite = array_merge($rewrite, array($sub2 => $subquery, $sub2tb => $subtbquery, $sub2feed => $subfeedquery, $sub2feed2 => $subfeedquery)); } } - - $post_rewrite = $rewrite + $post_rewrite; + $post_rewrite = array_merge($rewrite, $post_rewrite); } - return $post_rewrite; } @@ -1339,7 +1342,7 @@ class WP_Rewrite { $page_rewrite = apply_filters('page_rewrite_rules', $page_rewrite); // Put them together. - $this->rules = $page_rewrite + $root_rewrite + $comments_rewrite + $search_rewrite + $category_rewrite + $author_rewrite + $date_rewrite + $post_rewrite; + $this->rules = array_merge($page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite); do_action('generate_rewrite_rules', array(&$this)); $this->rules = apply_filters('rewrite_rules_array', $this->rules); @@ -1456,7 +1459,7 @@ class WP_Rewrite { } class WP { - var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id'); + var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview'); var $private_query_vars = array('posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'show_post_type'); diff --git a/wp-inst/wp-includes/functions-compat.php b/wp-inst/wp-includes/functions-compat.php index 7f631e0..b6d706c 100644 --- a/wp-inst/wp-includes/functions-compat.php +++ b/wp-inst/wp-includes/functions-compat.php @@ -47,6 +47,14 @@ function printr($var, $do_not_echo = false) { return $code; } +/* compatibility with PHP versions older than 4.3 */ +if ( !function_exists('file_get_contents') ) { + function file_get_contents( $file ) { + $file = file($file); + return !$file ? false : implode('', $file); + } +} + if (!defined('CASE_LOWER')) { define('CASE_LOWER', 0); } @@ -64,7 +72,7 @@ if (!defined('CASE_UPPER')) { * @link http://php.net/function.array_change_key_case * @author Stephan Schmidt <schst@php.net> * @author Aidan Lister <aidan@php.net> - * @version $Revision: 3400 $ + * @version $Revision: 3471 $ * @since PHP 4.2.0 * @require PHP 4.0.0 (user_error) */ diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php index 4a7e9bb..245599e 100644 --- a/wp-inst/wp-includes/functions.php +++ b/wp-inst/wp-includes/functions.php @@ -2049,7 +2049,10 @@ add_query_arg(associative_array, oldquery_or_uri) function add_query_arg() { $ret = ''; if ( is_array(func_get_arg(0)) ) { - $uri = @func_get_arg(1); + if ( @func_num_args() < 2 ) + $uri = $_SERVER['REQUEST_URI']; + else + $uri = @func_get_arg(1); } else { if ( @func_num_args() < 3 ) $uri = $_SERVER['REQUEST_URI']; diff --git a/wp-inst/wp-links-opml.php b/wp-inst/wp-links-opml.php index be4c44d..5245f66 100644 --- a/wp-inst/wp-links-opml.php +++ b/wp-inst/wp-links-opml.php @@ -29,6 +29,7 @@ if ((empty($link_cat)) || ($link_cat == 'all') || ($link_cat == '0')) { <?php $sql = "SELECT $wpdb->links.link_url, link_rss, $wpdb->links.link_name, $wpdb->links.link_category, $wpdb->linkcategories.cat_name, link_updated FROM $wpdb->links JOIN $wpdb->linkcategories on $wpdb->links.link_category = $wpdb->linkcategories.cat_id + AND $wpdb->links.link_visible = 'Y' $sql_cat ORDER BY $wpdb->linkcategories.cat_name, $wpdb->links.link_name \n"; //echo("<!-- $sql -->"); @@ -51,8 +52,10 @@ FROM $wpdb->links <outline text="<?php echo wp_specialchars($result->link_name); ?>" type="link" xmlUrl="<?php echo wp_specialchars($result->link_rss); ?>" htmlUrl="<?php echo wp_specialchars($result->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $result->link_updated) echo $result->link_updated; ?>" /> <?php } // end foreach +?> + </outline> +<?php } // end if ?> - </outline> - </body> +</body> </opml> diff --git a/wp-inst/wp-mail.php b/wp-inst/wp-mail.php index f47f0aa..d6f23a8 100644 --- a/wp-inst/wp-mail.php +++ b/wp-inst/wp-mail.php @@ -61,8 +61,10 @@ for ($i=1; $i <= $count; $i++) : if (preg_match('/From: /', $line) | preg_match('Reply-To: /', $line)) { $author=trim($line); if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) { - echo "Author = {$regs[1]} <p>"; - $result = $wpdb->get_row("SELECT ID FROM $tableusers WHERE user_email='$regs[1]' ORDER BY ID DESC LIMIT 1"); + $author = $regs[1]; + echo "Author = {$author} <p>"; + $author = $wpdb->escape($author); + $result = $wpdb->get_row("SELECT ID FROM $wpdb->users WHERE user_email='$author' LIMIT 1"); if (!$result) $post_author = 1; else |