diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-22 09:04:34 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-22 09:04:34 +0000 |
| commit | 7b4d8e6aed1cdf72fc2ee40c3c916377deb0955b (patch) | |
| tree | 58fccc47a5e0143adae8e399072337e81319277e | |
| parent | 615f78060a57a8c1ae602b6192f1b93ba612b3fe (diff) | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@482 7be80a69-a1ef-0310-a953-fb0f7c49ff36
| -rw-r--r-- | wp-inst/readme.html | 2 | ||||
| -rw-r--r-- | wp-inst/wp-admin/admin.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-admin/edit-form-advanced.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-admin/templates.php | 30 | ||||
| -rw-r--r-- | wp-inst/wp-includes/functions.php | 1 | ||||
| -rw-r--r-- | wp-inst/wp-includes/template-functions-category.php | 3 | ||||
| -rw-r--r-- | wp-inst/wp-includes/template-functions-links.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-login.php | 2 |
8 files changed, 31 insertions, 13 deletions
diff --git a/wp-inst/readme.html b/wp-inst/readme.html index 8203b19..bfe4db3 100644 --- a/wp-inst/readme.html +++ b/wp-inst/readme.html @@ -59,7 +59,7 @@ <h1>Upgrading</h1> <p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p> -<h2>Upgrading from any previous WordPress to 1.5:</h2> +<h2>Upgrading from any previous WordPress to 2.0:</h2> <ol> <li>Delete your old WP files, saving ones you've modified </li> <li>Upload the new files</li> diff --git a/wp-inst/wp-admin/admin.php b/wp-inst/wp-admin/admin.php index 6d1a183..202fd2c 100644 --- a/wp-inst/wp-admin/admin.php +++ b/wp-inst/wp-admin/admin.php @@ -45,7 +45,7 @@ require(ABSPATH . '/wp-admin/menu.php'); // Handle plugin admin pages. if (isset($_GET['page'])) { $plugin_page = stripslashes($_GET['page']); - $plugin_page = plugin_basename($_GET['page']); + $plugin_page = plugin_basename($plugin_page); $page_hook = get_plugin_page_hook($plugin_page, $pagenow); if ( $page_hook ) { diff --git a/wp-inst/wp-admin/edit-form-advanced.php b/wp-inst/wp-admin/edit-form-advanced.php index 0061ce9..1907da4 100644 --- a/wp-inst/wp-admin/edit-form-advanced.php +++ b/wp-inst/wp-admin/edit-form-advanced.php @@ -151,7 +151,7 @@ endforeach; ?> <?php the_quicktags(); ?> -<div><textarea title="true" rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="2" id="content"><?php echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div> +<div><textarea <?php if ( user_can_richedit() ) echo 'title="true" '; ?>rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="2" id="content"><?php echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div> </fieldset> <script type="text/javascript"> diff --git a/wp-inst/wp-admin/templates.php b/wp-inst/wp-admin/templates.php index 8862cdb..f1c2124 100644 --- a/wp-inst/wp-admin/templates.php +++ b/wp-inst/wp-admin/templates.php @@ -42,12 +42,16 @@ case 'update': $newcontent = stripslashes($_POST['newcontent']); if (is_writeable($real_file)) { - $f = fopen($real_file, 'w+'); - fwrite($f, $newcontent); - fclose($f); - header("Location: templates.php?file=$file&a=te"); + $f = @ fopen($real_file, 'w+'); + if ( $f ) { + fwrite($f, $newcontent); + fclose($f); + header("Location: templates.php?file=$file&a=te"); + } else { + header("Location: templates.php?file=$file&a=err"); + } } else { - header("Location: templates.php?file=$file"); + header("Location: templates.php?file=$file&a=err"); } exit(); @@ -67,17 +71,25 @@ default: update_recently_edited($file); if (!is_file($real_file)) - $error = 1; + $error = true; if (!$error) { - $f = fopen($real_file, 'r'); - $content = fread($f, filesize($real_file)); - $content = htmlspecialchars($content); + $f = @ fopen($real_file, 'r'); + if ( $f ) { + $content = fread($f, filesize($real_file)); + $content = htmlspecialchars($content); + } else { + $error = true; + } } ?> <?php if (isset($_GET['a'])) : ?> + <?php if ( 'err' == $_GET['a'] ) : ?> + <div id="message" class="error"><p><?php _e('Could not save file.') ?></p></div> + <? else: ?> <div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div> + <?endif; ?> <?php endif; ?> <div class="wrap"> <?php diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php index 8cd8503..74b8c56 100644 --- a/wp-inst/wp-includes/functions.php +++ b/wp-inst/wp-includes/functions.php @@ -2259,6 +2259,7 @@ function register_deactivation_hook($file, $function) { } function plugin_basename($file) { + $file = preg_replace('|\\\\+|', '\\\\', $file); $file = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', $file); return $file; } diff --git a/wp-inst/wp-includes/template-functions-category.php b/wp-inst/wp-includes/template-functions-category.php index c39be27..1858bec 100644 --- a/wp-inst/wp-includes/template-functions-category.php +++ b/wp-inst/wp-includes/template-functions-category.php @@ -126,6 +126,9 @@ function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = } function get_category_children($id, $before = '/', $after = '') { + if ( 0 == $id ) + return ''; + $cat_ids = get_all_category_ids(); foreach ( $cat_ids as $cat_id ) { if ( $cat_id == $id) diff --git a/wp-inst/wp-includes/template-functions-links.php b/wp-inst/wp-includes/template-functions-links.php index 0f97db9..543fbaf 100644 --- a/wp-inst/wp-includes/template-functions-links.php +++ b/wp-inst/wp-includes/template-functions-links.php @@ -214,7 +214,7 @@ function edit_post_link($link = 'Edit This', $before = '', $after = '') { } if ( is_attachment() ) - $file = 'attachments'; + return; else $file = 'post'; diff --git a/wp-inst/wp-login.php b/wp-inst/wp-login.php index d402a5d..4ba075f 100644 --- a/wp-inst/wp-login.php +++ b/wp-inst/wp-login.php @@ -138,6 +138,8 @@ case 'resetpass' : $new_pass = substr( md5( uniqid( microtime() ) ), 0, 7); $wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$new_pass'), user_activation_key = '' WHERE user_login = '$user->user_login'"); + wp_cache_delete($users->ID, 'users'); + wp_cache_delete($users->user_login, 'userlogins'); $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n"; $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n"; $message .= get_settings('siteurl') . "/wp-login.php\r\n"; |
