Changeset 5700
- Timestamp:
- 06/14/2007 02:25:30 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-pages.php
r5587 r5700 42 42 </fieldset> 43 43 44 44 45 45 <fieldset><legend><?php _e('Page Type…'); ?></legend> 46 46 <select name='post_status'> -
trunk/wp-admin/export.php
r5674 r5700 134 134 another. This file is not intended to serve as a complete backup of your 135 135 blog. 136 136 137 137 To import this information into a WordPress blog follow these steps: 138 138 139 139 1. Log into that blog as an administrator. 140 140 2. Go to Manage > Import in the blog's admin. -
trunk/wp-admin/import/blogger.php
r5404 r5700 916 916 array_push($this->in_content, ">"); 917 917 } 918 918 919 919 array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); 920 920 } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { -
trunk/wp-admin/import/mt.php
r5684 r5700 273 273 $ping = new StdClass(); 274 274 $pings = array(); 275 275 276 276 echo "<div class='wrap'><ol>"; 277 277 -
trunk/wp-admin/import/utw.php
r5390 r5700 2 2 3 3 class UTW_Import { 4 4 5 5 function header() { 6 6 echo '<div class="wrap">'; … … 24 24 echo '</div>'; 25 25 } 26 27 26 27 28 28 function dispatch () { 29 29 if ( empty( $_GET['step'] ) ) { … … 32 32 $step = (int) $_GET['step']; 33 33 } 34 34 35 35 // load the header 36 36 $this->header(); 37 37 38 38 switch ( $step ) { 39 39 case 0 : … … 53 53 break; 54 54 } 55 55 56 56 // load the footer 57 57 $this->footer(); 58 58 } 59 60 59 60 61 61 function import_tags ( ) { 62 62 echo '<div class="narrow">'; 63 63 echo '<p><h3>'.__('Reading UTW Tags…').'</h3></p>'; 64 64 65 65 $tags = $this->get_utw_tags(); 66 66 67 67 // if we didn't get any tags back, that's all there is folks! 68 68 if ( !is_array($tags) ) { … … 78 78 79 79 add_option('utwimp_tags', $tags); 80 80 81 81 82 82 $count = count($tags); 83 83 84 84 echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>'; 85 85 echo '<p>' . __('The following tags were found:') . '</p>'; 86 86 87 87 echo '<ul>'; 88 88 89 89 foreach ( $tags as $tag_id => $tag_name ) { 90 90 91 91 echo '<li>' . $tag_name . '</li>'; 92 92 93 93 } 94 94 95 95 echo '</ul>'; 96 96 97 97 echo '<br />'; 98 98 99 99 echo '<p>' . __('If you don’t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '</p>'; 100 101 102 } 103 100 101 102 } 103 104 104 echo '<form action="admin.php?import=utw&step=2" method="post">'; 105 105 echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2 »').'" /></p>'; … … 107 107 echo '</div>'; 108 108 } 109 110 109 110 111 111 function import_posts ( ) { 112 112 echo '<div class="narrow">'; … … 129 129 130 130 add_option('utwimp_posts', $posts); 131 131 132 132 133 133 $count = count($posts); 134 134 135 135 echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>'; 136 136 137 137 } 138 138 … … 143 143 144 144 } 145 146 145 146 147 147 function import_t2p ( ) { 148 148 … … 152 152 // run that funky magic! 153 153 $tags_added = $this->tag2post(); 154 154 155 155 echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>'; 156 156 … … 161 161 162 162 } 163 164 163 164 165 165 function get_utw_tags ( ) { 166 166 167 167 global $wpdb; 168 168 169 169 // read in all the tags from the UTW tags table: should be wp_tags 170 170 $tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags"; 171 171 172 172 $tags = $wpdb->get_results($tags_query); 173 173 174 174 // rearrange these tags into something we can actually use 175 175 foreach ( $tags as $tag ) { 176 176 177 177 $new_tags[$tag->tag_id] = $tag->tag; 178 179 } 180 178 179 } 180 181 181 return $new_tags; 182 182 183 183 } 184 184 185 185 function get_utw_posts ( ) { 186 186 187 187 global $wpdb; 188 188 189 189 // read in all the posts from the UTW post->tag table: should be wp_post2tag 190 190 $posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag"; 191 191 192 192 $posts = $wpdb->get_results($posts_query); 193 193 194 194 return $posts; 195 196 } 197 198 195 196 } 197 198 199 199 function tag2post ( ) { 200 200 201 201 // get the tags and posts we imported in the last 2 steps 202 202 $tags = get_option('utwimp_tags'); 203 203 $posts = get_option('utwimp_posts'); 204 204 205 205 // null out our results 206 206 $tags_added = 0; 207 207 208 208 // loop through each post and add its tags to the db 209 209 foreach ( $posts as $this_post ) { 210 210 211 211 $the_post = (int) $this_post->post_id; 212 212 $the_tag = (int) $this_post->tag_id; 213 213 214 214 // what's the tag name for that id? 215 215 $the_tag = $tags[$the_tag]; 216 216 217 217 // screw it, just try to add the tag 218 218 wp_add_post_tags($the_post, $the_tag); 219 219 220 220 $tags_added++; 221 222 } 223 221 222 } 223 224 224 // that's it, all posts should be linked to their tags properly, pending any errors we just spit out! 225 225 return $tags_added; 226 227 228 } 229 230 226 227 228 } 229 230 231 231 function cleanup_import ( ) { 232 232 233 233 delete_option('utwimp_tags'); 234 234 delete_option('utwimp_posts'); 235 235 236 236 $this->done(); 237 238 } 239 240 237 238 } 239 240 241 241 function done ( ) { 242 242 243 243 echo '<div class="narrow">'; 244 244 echo '<p><h3>'.__('Import Complete!').'</h3></p>'; 245 245 246 246 echo '<p>' . __('OK, so we lied about this being a 5-step program! You’re done!') . '</p>'; 247 247 248 248 echo '<p>' . __('Now wasn’t that easy?') . '</p>'; 249 250 echo '</div>'; 251 252 } 253 249 250 echo '</div>'; 251 252 } 253 254 254 255 255 function UTW_Import ( ) { 256 256 257 257 // Nothing. 258 259 } 260 258 259 } 260 261 261 } 262 262 -
trunk/wp-admin/import/wordpress.php
r5448 r5700 252 252 echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>'; 253 253 } 254 254 255 255 function process_post($post) { 256 256 global $wpdb; … … 259 259 if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already 260 260 return 0; 261 261 262 262 // There are only ever one of these 263 263 $post_title = $this->get_tag( $post, 'title' ); … … 312 312 if ( $post_id && $post_ID && $this->posts_processed[$post_ID] ) 313 313 $this->posts_processed[$post_ID][1] = $post_id; // New ID. 314 314 315 315 // Add categories. 316 316 if (count($categories) > 0) { -
trunk/wp-admin/import/wp-cat2tag.php
r5554 r5700 4 4 var $categories_to_convert = array(); 5 5 var $all_categories = array(); 6 6 7 7 function header() { 8 8 print '<div class="wrap">'; 9 9 print '<h2>' . __('Convert Categories to Tags') . '</h2>'; 10 10 } 11 11 12 12 function footer() { 13 13 print '</div>'; 14 14 } 15 15 16 16 function populate_all_categories() { 17 17 global $wpdb; 18 18 19 19 $this->all_categories = get_categories('get=all'); 20 20 } 21 21 22 22 function welcome() { 23 23 $this->populate_all_categories(); 24 24 25 25 print '<div class="narrow">'; 26 26 27 27 if (count($this->all_categories) > 0) { 28 28 print '<p>' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '</p>'; 29 29 print '<p>' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '</p>'; 30 30 31 31 $this->categories_form(); 32 32 } else { 33 33 print '<p>'.__('You have no categories to convert!').'</p>'; 34 34 } 35 35 36 36 print '</div>'; 37 37 } 38 38 39 39 function categories_form() { 40 40 print '<form action="admin.php?import=wp-cat2tag&step=2" method="post">'; 41 41 print '<ul style="list-style:none">'; 42 42 43 43 $hier = _get_term_hierarchy('category'); 44 44 45 45 foreach ($this->all_categories as $category) { 46 46 if ((int) $category->parent == 0) { 47 47 print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>'; 48 48 49 49 if (isset($hier[$category->term_id])) { 50 50 $this->_category_children($category, $hier); 51 51 } 52 52 53 53 print '</li>'; 54 54 } 55 55 } 56 56 57 57 print '</ul>'; 58 58 59 59 print '<p class="submit"><input type="submit" name="maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert »') . '" /></p>'; 60 60 print '</form>'; 61 61 } 62 62 63 63 function _category_children($parent, $hier) { 64 64 print '<ul style="list-style:none">'; 65 65 66 66 foreach ($hier[$parent->term_id] as $child_id) { 67 67 $child =& get_category($child_id); 68 68 69 69 print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($child->term_id) . '" /> ' . $child->name . ' (' . $child->count . ')</label>'; 70 70 71 71 if (isset($hier[$child->term_id])) { 72 72 $this->_category_children($child, $hier); 73 73 } 74 74 75 75 print '</li>'; 76 76 } 77 77 78 78 print '</ul>'; 79 79 } 80 80 81 81 function _category_exists($cat_id) { 82 82 global $wpdb; 83 83 84 84 $cat_id = (int) $cat_id; 85 85 86 86 $maybe_exists = category_exists($cat_id); 87 87 88 88 if ( $maybe_exists ) { 89 89 return true; … … 92 92 } 93 93 } 94 94 95 95 function convert_them() { 96 96 global $wpdb; 97 97 98 98 if (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) { 99 99 print '<div class="narrow">'; … … 101 101 print '</div>'; 102 102 } 103 104 103 104 105 105 if ( empty($this->categories_to_convert) ) 106 106 $this->categories_to_convert = $_POST['cats_to_convert']; 107 107 $hier = _get_term_hierarchy('category'); 108 108 109 109 print '<ul>'; 110 110 111 111 foreach ($this->categories_to_convert as $cat_id) { 112 112 $cat_id = (int) $cat_id; 113 113 114 114 print '<li>' . __('Converting category') . ' #' . $cat_id . '... '; 115 115 116 116 if (!$this->_category_exists($cat_id)) { 117 117 _e('Category doesn\'t exist!'); 118 118 } else { 119 119 $category =& get_category($cat_id); 120 120 121 121 // Set the category itself to $type from above 122 122 $wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'"); 123 123 124 124 // Set all parents to 0 (root-level) if their parent was the converted tag 125 125 $wpdb->query("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = '{$category->term_id}' AND taxonomy = 'category'"); 126 126 127 127 // Clean the cache 128 128 clean_category_cache($category->term_id); 129 129 130 130 _e('Converted successfully.'); 131 131 } 132 132 133 133 print '</li>'; 134 134 } 135 135 136 136 print '</ul>'; 137 137 } 138 138 139 139 function convert_all_confirm() { 140 140 print '<div class="narrow">'; 141 141 142 142 print '<h3>' . __('Confirm') . '</h3>'; 143 143 144 144 print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>'; 145 145 146 146 print '<form action="admin.php?import=wp-cat2tag" method="post">'; 147 147 print '<p style="text-align:center" class="submit"><input type="submit" value="' . __('Yes') . '" name="yes_convert_all_cats" /> <input type="submit" value="' . __('No') . '" name="no_dont_do_it" /></p>'; 148 148 print '</form>'; 149 149 150 150 print '</div>'; 151 151 } 152 152 153 153 function convert_all() { 154 154 global $wpdb; … … 157 157 clean_category_cache($category->term_id); 158 158 } 159 159 160 160 function init() { 161 161 echo '<!--'; print_r($_POST); print_r($_GET); echo '-->'; 162 162 163 163 if (isset($_POST['maybe_convert_all_cats'])) { 164 164 $step = 3; … … 170 170 $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; 171 171 } 172 172 173 173 $this->header(); 174 174 175 175 if (!current_user_can('manage_categories')) { 176 176 print '<div class="narrow">'; … … 182 182 $this->welcome(); 183 183 break; 184 184 185 185 case 2 : 186 186 $this->convert_them(); 187 187 break; 188 188 189 189 case 3 : 190 190 $this->convert_all_confirm(); 191 191 break; 192 192 193 193 case 4 : 194 194 $this->convert_all(); … … 196 196 } 197 197 } 198 198 199 199 $this->footer(); 200 200 } 201 201 202 202 function WP_Categories_to_Tags() { 203 203 // Do nothing. -
trunk/wp-admin/includes/bookmark.php
r5637 r5700 47 47 48 48 $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'"); 49 49 50 50 do_action('deleted_link', $link_id); 51 51 -
trunk/wp-admin/includes/file.php
r5566 r5700 139 139 if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) 140 140 return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); 141 141 142 142 if ( !$ext ) 143 143 $ext = strrchr($file['name'], '.'); -
trunk/wp-admin/includes/image.php
r5566 r5700 122 122 if (function_exists('imageantialias')) 123 123 imageantialias( $dst, true ); 124 124 125 125 imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ); 126 126 -
trunk/wp-admin/includes/plugin.php
r5630 r5700 8 8 preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name ); 9 9 preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri ); 10 10 11 11 if ( preg_match( "|Version:(.*)|i", $plugin_data, $version )) 12 12 $version = trim( $version[1] ); -
trunk/wp-admin/includes/schema.php
r5551 r5700 393 393 function populate_roles_230() { 394 394 $role = get_role( 'administrator' ); 395 395 396 396 if ( !empty( $role ) ) { 397 397 $role->add_cap( 'unfiltered_upload' ); -
trunk/wp-admin/includes/template.php
r5692 r5700 150 150 151 151 $categories = get_terms('link_category', 'orderby=count&hide_empty=0'); 152 152 153 153 if ( empty($categories) ) 154 154 return; … … 422 422 if ( $for_post ) 423 423 $edit = ( ('draft' == $post->post_status ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 424 424 425 425 echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>'; 426 426 -
trunk/wp-admin/includes/theme.php
r5630 r5700 34 34 foreach ( $templates as $template ) { 35 35 $template_data = implode( '', file( ABSPATH.$template )); 36 36 37 37 preg_match( '|Template Name:(.*)$|mi', $template_data, $name ); 38 38 preg_match( '|Description:(.*)$|mi', $template_data, $description ); -
trunk/wp-admin/includes/upgrade.php
r5643 r5700 188 188 if ( $wp_current_db_version < 4351 ) 189 189 upgrade_old_slugs(); 190 190 191 191 if ( $wp_current_db_version < 5539 ) 192 192 upgrade_230(); 193 193 194 194 195 195 maybe_disable_automattic_widgets(); 196 196 … … 577 577 function upgrade_230() { 578 578 global $wp_current_db_version, $wpdb; 579 579 580 580 if ( $wp_current_db_version < 5200 ) { 581 581 populate_roles_230(); … … 629 629 $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; 630 630 } 631 631 632 632 if ( empty($count) ) { 633 633 $count = 0; … … 757 757 function __get_option($setting) { 758 758 global $wpdb; 759 759 760 760 if ( $setting == 'home' && defined( 'WP_HOME' ) ) { 761 761 return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); 762 762 } 763 763 764 764 if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { 765 765 return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); 766 766 } 767 767 768 768 $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); 769 769 … … 1209 1209 function maybe_disable_automattic_widgets() { 1210 1210 $plugins = __get_option( 'active_plugins' ); 1211 1211 1212 1212 foreach ( (array) $plugins as $plugin ) { 1213 1213 if ( basename( $plugin ) == 'widgets.php' ) { -
trunk/wp-admin/link-import.php
r5439 r5700 99 99 $opml = file_get_contents($opml_url); 100 100 } 101 101 102 102 include_once('link-parse-opml.php'); 103 103 -
trunk/wp-admin/moderation.php
r5663 r5700 20 20 if ( $action == 'update' ) { 21 21 check_admin_referer( 'moderate-comments' ); 22 22 23 23 if ( !current_user_can( 'moderate_comments' ) ) { 24 24 wp_die( __( 'Your level is not high enough to moderate comments.' ) ); 25 25 } 26 26 27 27 $item_ignored = 0; 28 28 $item_deleted = 0; 29 29 $item_approved = 0; 30 30 $item_spam = 0; 31 31 32 32 foreach ( $comment as $k => $v ) { 33 33 if ( $feelinglucky && $v == 'later' ) { 34 34 $v = 'delete'; 35 35 } 36 36 37 37 switch ( $v ) { 38 38 case 'later' : 39 39 $item_ignored++; 40 40 break; 41 41 42 42 case 'delete' : 43 43 wp_set_comment_status( $k, 'delete' ); 44 44 $item_deleted++; 45 45 break; 46 46 47 47 case 'spam' : 48 48 wp_set_comment_status( $k, 'spam' ); 49 49 $item_spam++; 50 50 break; 51 51 52 52 case 'approve' : 53 53 wp_set_comment_status( $k, 'approve' ); 54 54 55 55 if ( get_option( 'comments_notify' ) == true ) { 56 56 wp_notify_postauthor( $k ); 57 57 } 58 58 59 59 $item_approved++; 60 60 break; 61 61 } 62 62 } 63 63 64 64 wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam ); 65 65 exit; … … 78 78 $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0; 79 79 $spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0; 80 80 81 81 if ( $approved > 0 || $deleted > 0 || $spam > 0 ) { 82 82 echo '<div id="moderated" class="updated fade"><p>'; 83 83 84 84 if ( $approved > 0 ) { 85 85 printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved ); 86 86 echo '<br />'; 87 87 } 88 88 89 89 if ( $deleted > 0 ) { 90 90 printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted ); 91 91 echo '<br />'; 92 92 } 93 93 94 94 if ( $spam > 0 ) { 95 95 printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); 96 96 echo '<br />'; 97 97 } 98 98 99 99 echo '</p></div>'; 100 100 } … … 138 138 ?> 139 139 <h2><?php _e( 'Moderation Queue' ); ?></h2> 140 140 141 141 <?php 142 142 if ( $page_links ) { … … 144 144 } 145 145 ?> 146 146 147 147 <form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post"> 148 148 <?php wp_nonce_field( 'moderate-comments' ); ?> … … 151 151 <?php 152 152 $i = 0; 153 153 154 154 foreach ( $comments as $comment ) { 155 155 $class = 'js-unapproved'; 156 156 157 157 if ( $i++ % 2 ) { 158 158 $class .= ' alternate'; … … 166 166 | <?php _e( 'IP:' ); ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a> 167 167 </p> 168 168 169 169 <p> 170 170 <?php comment_text(); ?> … … 190 190 ?> 191 191 </ol> 192 192 193 193 <?php 194 194 if ( $page_links ) { … … 196 196 } 197 197 ?> 198 198 199 199 <div id="ajax-response"></div> 200 200 201 201 <noscript> 202 202 <p class="submit"> … … 204 204 </p> 205 205 </noscript> 206 206 207 207 <p class="submit"> 208 208 <input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments »' ); ?>" /> 209 209 </p> 210 210 211 211 <script type="text/javascript"> 212 212 // <![CDATA[ … … 218 218 } 219 219 } 220 220 221 221 document.write( '<p><strong><?php _e( 'Mark all:' ); ?></strong> <a href="javascript:mark_all_as(\'approve\')"><?php _e( 'Approved' ); ?></a> – <a href="javascript:mark_all_as(\'spam\')"><?php _e( 'Spam' ); ?></a> – <a href="javascript:mark_all_as(\'delete\')"><?php _e( 'Deleted' ); ?></a> – <a href="javascript:mark_all_as(\'later\')"><?php _e( 'Later' ); ?></a></p>' ); 222 222 // ]]> -
trunk/wp-admin/options-general.php
r5395 r5700 7 7 include('./admin-header.php'); 8 8 ?> 9 9 10 10 <div class="wrap"> 11 11 <h2><?php _e('General Options') ?></h2> -
trunk/wp-admin/options.php
r5541 r5700 35 35 } 36 36 } 37 37 38 38 $referred = remove_query_arg('updated' , wp_get_referer()); 39 39 $goback = add_query_arg('updated', 'true', wp_get_referer()); -
trunk/wp-admin/plugins.php
r5239 r5700 32 32 check_admin_referer('deactivate-all'); 33 33 $current = get_option('active_plugins'); 34 34 35 35 foreach ($current as $plugin) { 36 36 array_splice($current, array_search($plugin, $current), 1); 37 37 do_action('deactivate_' . $plugin); 38 38 } 39 39 40 40 update_option('active_plugins', array()); 41 41 wp_redirect('plugins.php?deactivate-all=true'); -
trunk/wp-admin/widgets.php
r5631 r5700 11 11 function wp_widgets_admin_head() { 12 12 global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls; 13 13 14 14 define( 'WP_WIDGETS_WIDTH', 1 + 262 * ( count( $wp_registered_sidebars ) ) ); 15 15 define( 'WP_WIDGETS_HEIGHT', 35 * ( count( $wp_registered_widgets ) ) ); … … 31 31 <?php 32 32 } 33 33 34 34 $cols = array(); 35 35 foreach ( $wp_registered_sidebars as $index => $sidebar ) { … … 37 37 } 38 38 $cols = implode( ', ', $cols ); 39 39 40 40 $widgets = array(); 41 41 foreach ( $wp_registered_widgets as $name => $widget ) { … … 180 180 function wp_widget_draggable( $name ) { 181 181 global $wp_registered_widgets, $wp_registered_widget_controls; 182 182 183 183 if ( !isset( $wp_registered_widgets[$name] ) ) { 184 184 return; 185 185 } 186 186 187 187 $sanitized_name = sanitize_title( $wp_registered_widgets[$name]['id'] ); 188 188 $link_title = __( 'Configure' ); … … 190 190 ? ' <div class="popper" id="' . $sanitized_name . 'popper" title="' . $link_title . '">≡</div>' 191 191 : ''; 192 192 193 193 $output = '<li class="module" id="widgetprefix-%1$s"><span class="handle">%2$s</span></li>'; 194 194 195 195 printf( $output, $sanitized_name, $wp_registered_widgets[$name]['name'] . $popper ); 196 196 } … … 205 205 <div class="wrap"> 206 206 <h2><?php _e( 'No Sidebars Defined' ); ?></h2> 207 207 208 208 <p><?php _e( 'You are seeing this message because the theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://automattic.com/code/widgets/themes/">follow these instructions</a>.' ); /* TODO: article on codex */; ?></p> 209 209 </div> 210 210 <?php 211 211 212 212 require_once 'admin-footer.php'; 213 213 exit; … … 222 222 if ( isset( $_POST['action'] ) ) { 223 223 check_admin_referer( 'widgets-save-widget-order' ); 224 224 225 225 switch ( $_POST['action'] ) { 226 226 case 'default' : … … 228 228 wp_set_sidebars_widgets( $sidebars_widgets ); 229 229 break; 230 230 231 231 case 'save_widget_order' : 232 232 $sidebars_widgets = array(); 233 233 234 234 foreach ( $wp_registered_sidebars as $index => $sidebar ) { 235 235 $postindex = $index . 'order'; 236 236 237 237 parse_str( $_POST[$postindex], $order ); 238 238 239 239 $new_order = $order[$index]; 240 240 241 241 if ( is_array( $new_order ) ) { 242 242 foreach ( $new_order as $sanitized_name ) { … … 249 249 } 250 250 } 251 251 252 252 wp_set_sidebars_widgets( $sidebars_widgets ); 253 253 break; … … 261 261 foreach ( $wp_registered_widgets as $name => $widget ) { 262 262 $is_active = false; 263 263 264 264 foreach ( $wp_registered_sidebars as $index => $sidebar ) { 265 265 if ( is_array( $sidebars_widgets[$index] ) && in_array( $name, $sidebars_widgets[$index] ) ) { … … 268 268 } 269 269 } 270 270 271 271 if ( !$is_active ) { 272 272 $inactive_widgets[] = $name; … … 298 298 <div class="wrap"> 299 299 <h2><?php _e( 'Sidebar Arrangement' ); ?></h2> 300 300 301 301 <p><?php _e( 'You can drag and drop widgets onto your sidebar below.' ); ?></p> 302 302 303 303 <form id="sbadmin" method="post" onsubmit="serializeAll();"> 304 304 <p class="submit"> … … 310 310 ?> 311 311 <input type="hidden" id="<?php echo $index; ?>order" name="<?php echo $index; ?>order" value="" /> 312 312 313 313 <div class="dropzone"> 314 314 <h3><?php echo $sidebar['name']; ?></h3> 315 315 316 316 <div id="<?php echo $index; ?>placematt" class="module placemat"> 317 317 <span class="handle"> … … 320 320 </span> 321 321 </div> 322 322 323 323 <ul id="<?php echo $index; ?>"> 324 324 <?php … … 334 334 } 335 335 ?> 336 336 337 337 <br class="clear" /> 338 338 339 339 </div> 340 340 341 341 <div id="palettediv"> 342 342 <h3><?php _e( 'Available Widgets' ); ?></h3> 343 343 344 344 <ul id="palette"> 345 345 <?php … … 351 351 </ul> 352 352 </div> 353 353 354 354 <script type="text/javascript"> 355 355 // <![CDATA[ … … 363 363 // ]]> 364 364 </script> 365 365 366 366 <p class="submit"> 367 367 <?php wp_nonce_field( 'widgets-save-widget-order' ); ?> … … 369 369 <input type="submit" value="<?php _e( 'Save Changes »' ); ?>" /> 370 370 </p> 371 371 372 372 <div id="controls"> 373 373 <?php foreach ( $wp_registered_widget_controls as $name => $widget ) { ?> … … 382 382 </div> 383 383 </form> 384 384 385 385 <br class="clear" /> 386 386 </div> 387 387 388 388 <div id="shadow"> </div> 389 389 390 390 <?php do_action( 'sidebar_admin_page' ); ?> 391 391 -
trunk/wp-app.php
r5547 r5700 110 110 while(!feof($fp)) { 111 111 $line = fgets($fp, 4096); 112 112 113 113 if($app_logging) $contents .= $line; 114 114 … … 163 163 array_push($this->in_content, ">"); 164 164 } 165 165 166 166 array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); 167 167 } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { -
trunk/wp-content/themes/default/sidebar.php
r5151 r5700 41 41 42 42 <?php } ?> 43 43 44 44 </li> <?php }?> 45 45 … … 68 68 </li> 69 69 <?php } ?> 70 70 71 71 <?php endif; ?> 72 72 </ul> -
trunk/wp-includes/author-template.php
r5699 r5700 363 363 function wp_list_authors($args = '') { 364 364 global $wpdb; 365 365 366 366 $defaults = array( 367 367 'optioncount' => false, 'exclude_admin' => true, -
trunk/wp-includes/bookmark-template.php
r5560 r5700 10 10 function wp_get_links($args = '') { 11 11 global $wpdb; 12 12 13 13 if ( strpos( $args, '=' ) === false ) { 14 14 $cat_id = $args; 15 15 $args = add_query_arg( 'category', $cat_id, $args ); 16 16 } 17 17 18 18 $defaults = array( 19 19 'category' => -1, 'before' => '', … … 24 24 'echo' => true 25 25 ); 26 26 27 27 $r = wp_parse_args( $args, $defaults ); 28 28 extract( $r ); … … 132 132 if ( $show_description && '' != $desc ) 133 133 $output .= $between . $desc; 134 134 135 135 if ($show_rating) { 136 136 $output .= $between . get_linkrating($row); … … 246 246 'after' => '</li>', 'between' => "\n" 247 247 ); 248 248 249 249 $r = wp_parse_args( $args, $defaults ); 250 250 extract( $r ); … … 303 303 if ( $show_description && '' != $desc ) 304 304 $output .= $between . $desc; 305 305 306 306 if ($show_rating) { 307 307 $output .= $between . get_linkrating($bookmark); 308 308 } 309 309 310 310 $output .= "$after\n"; 311 311 } // end while … … 326 326 'category_after' => '</li>' 327 327 ); 328 328 329 329 $r = wp_parse_args( $args, $defaults ); 330 330 extract( $r ); -
trunk/wp-includes/bookmark.php
r5561 r5700 26 26 function get_bookmarks($args = '') { 27 27 global $wpdb; 28 28 29 29 $defaults = array( 30 30 'orderby' => 'name', 'order' => 'ASC', … … 34 34 'exclude' => '' 35 35 ); 36 36 37 37 $r = wp_parse_args( $args, $defaults ); 38 38 extract( $r ); -
trunk/wp-includes/category-template.php
r5693 r5700 187 187 'name' => 'cat', 'class' => 'postform' 188 188 ); 189 189 190 190 $defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0; 191 191 192 192 $r = wp_parse_args( $args, $defaults ); 193 193 $r['include_last_update_time'] = $r['show_last_update']; … … 237 237 'hierarchical' => true, 'title_li' => __('Categories') 238 238 ); 239 239 240 240 $r = wp_parse_args( $args, $defaults ); 241 241 242 242 if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { 243 243 $r['pad_counts'] = true; 244 244 } 245 245 246 246 if ( isset( $r['show_date'] ) ) { 247 247 $r['include_last_update_time'] = $r['show_date']; 248 248 } 249 249 250 250 extract( $r ); 251 251 252 252 $categories = get_categories($r); 253 253 … … 263 263 } else { 264 264 global $wp_query; 265 265 266 266 if( !empty($show_option_all) ) 267 267 if ('list' == $style ) … … 269 269 else 270 270 $output .= '<a href="' . get_bloginfo('url') . '">' . $show_option_all . '</a>'; 271 271 272 272 if ( is_category() ) 273 273 $r['current_category'] = $wp_query->get_queried_object_id(); … … 410 410 function get_the_tags( $id = 0 ) { 411 411 global $post; 412 412 413 413 $id = (int) $id; 414 414 415 415 if ( ! $id && ! in_the_loop() ) 416 416 return false; // in-the-loop function 417 417 418 418 if ( !$id ) 419 419 $id = (int) $post->ID; … … 434 434 if ( empty( $tags ) ) 435 435 return false; 436 436 437 437 $tag_list = $before; 438 438 foreach ( $tags as $tag ) -
trunk/wp-includes/class-IXR.php
r3279 r5700 48 48 // If it is a normal PHP object convert it in to a struct 49 49 if (is_object($this->data)) { 50 50 51 51 $this->data = get_object_vars($this->data); 52 52 return 'struct'; -
trunk/wp-includes/class-phpmailer.php
r5682 r5700 114 114 */ 115 115 var $Sendmail = "/usr/sbin/sendmail"; 116 116 117 117 /** 118 118 * Path to PHPMailer plugins. This is now only useful if the SMTP class … … 223 223 var $LE = "\n"; 224 224 /**#@-*/ 225 225 226 226 ///////////////////////////////////////////////// 227 227 // VARIABLE METHODS … … 383 383 return $result; 384 384 } 385 385 386 386 /** 387 387 * Sends mail using the $Sendmail program. … … 403 403 fputs($mail, $header); 404 404 fputs($mail, $body); 405 405 406 406 $result = pclose($mail) >> 8 & 0xFF; 407 407 if($result != 0) … … 549 549 else 550 550 $this->smtp->Hello($this->ServerHostname()); 551 551 552 552 if($this->SMTPAuth) 553 553 { … … 605 605 } 606 606 $this->language = $PHPMAILER_LANG; 607 607 608 608 return true; 609 609 } … … 630 630 return $addr_str; 631 631 } 632 632 633 633 /** 634 634 * Formats an address correctly. … … 727 727 return $message; 728 728 } 729 729 730 730 /** 731 731 * Set the body wrapping. … … 736 736 if($this->WordWrap < 1) 737 737 return; 738 738 739 739 switch($this->message_type) 740 740 { … … 757 757 function CreateHeader() { 758 758 $result = ""; 759 759 760 760 // Set the boundaries 761 761 $uniq_id = md5(uniqid(time())); … … 768 768 else 769 769 $result .= $this->HeaderLine("Return-Path", trim($this->Sender)); 770 770 771 771 // To be created automatically by mail() 772 772 if($this->Mailer != "mail") … … 798 798 $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); 799 799 $result .= $this->HeaderLine("X-Priority", $this->Priority); 800 800 801 801 if($this->ConfirmReadingTo != "") 802 802 { … … 866 866 $result .= $this->GetBoundary($this->boundary[1], "", 867 867 "text/html", ""); 868 868 869 869 $result .= $this->EncodeString($this->Body, $this->Encoding); 870 870 $result .= $this->LE.$this->LE; 871 871 872 872 $result .= $this->EndBoundary($this->boundary[1]); 873 873 break; … … 879 879 $result .= $this->EncodeString($this->Body, $this->Encoding); 880 880 $result .= $this->LE; 881 881 882 882 $result .= $this->AttachAll(); 883 883 break; … … 888 888 "multipart/alternative", $this->LE, 889 889 $this->boundary[2], $this->LE.$this->LE); 890 890 891 891 // Create text body 892 892 $result .= $this->GetBoundary($this->boundary[2], "", … … 895 895 $result .= $this->EncodeString($this->AltBody, $this->Encoding); 896 896 $result .= $this->LE.$this->LE; 897 897 898 898 // Create the HTML body 899 899 $result .= $this->GetBoundary($this->boundary[2], "", 900 900 "text/html", "") . $this->LE; 901 901 902 902 $result .= $this->EncodeString($this->Body, $this->Encoding); 903 903 $result .= $this->LE.$this->LE; 904 904 905 905 $result .= $this->EndBoundary($this->boundary[2]); 906 906 907 907 $result .= $this->AttachAll(); 908 908 break; … … 930 930 $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding); 931 931 $result .= $this->LE; 932 932 933 933 return $result; 934 934 } 935 935 936 936 /** 937 937 * Returns the end of a message boundary. … … 941 941 return $this->LE . "--" . $boundary . "--" . $this->LE; 942 942 } 943 943 944 944 /** 945 945 * Sets the message type. … … 1044 1044 $disposition = $this->attachment[$i][6]; 1045 1045 $cid = $this->attachment[$i][7]; 1046 1046 1047 1047 $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); 1048 1048 $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE); … … 1074 1074 return join("", $mime); 1075 1075 } 1076 1076 1077 1077 /** 1078 1078 * Encodes attachment in requested format. Returns an … … 1136 1136 function EncodeHeader ($str, $position = 'text') { 1137 1137 $x = 0; 1138 1138 1139 1139 switch (strtolower($position)) { 1140 1140 case 'phrase': … … 1178 1178 $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); 1179 1179 $encoded = trim(str_replace("\n", $this->LE, $encoded)); 1180 1180 1181 1181 return $encoded; 1182 1182 } 1183 1183 1184 1184 /** 1185 1185 * Encode string to quoted-printable. … … 1227 1227 break; 1228 1228 } 1229 1229 1230 1230 // Replace every spaces to _ (more readable than =20) 1231 1231 $encoded = str_replace(" ", "_", $encoded); … … 1257 1257 $this->attachment[$cur][7] = 0; 1258 1258 } 1259 1259 1260 1260 /** 1261 1261 * Adds an embedded attachment. This can include images, sounds, and … … 1273 1273 function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", 1274 1274 $type = "application/octet-stream") { 1275 1275 1276 1276 if(!@is_file($path)) 1277 1277 { … … 1294 1294 $this->attachment[$cur][6] = "inline"; 1295 1295 $this->attachment[$cur][7] = $cid; 1296 1296 1297 1297 return true; 1298 1298 } 1299 1299 1300 1300 /** 1301 1301 * Returns true if an inline attachment is present. … … 1313 1313 } 1314 1314 } 1315 1315 1316 1316 return $result; 1317 1317 } … … 1411 1411 return $result; 1412 1412 } 1413 1413 1414 1414 /** 1415 1415 * Returns the appropriate server variable. Should work with both … … 1429 1429 $_SERVER = $HTTP_ENV_VARS; // must be Apache 1430 1430 } 1431 1431 1432 1432 if(isset($_SERVER[$varName])) 1433 1433 return $_SERVER[$varName]; … … 1460 1460 if(count($this->language) < 1) 1461 1461 $this->SetLanguage("en"); // set the default language 1462 1462 1463 1463 if(isset($this->language[$key])) 1464 1464 return $this->language[$key]; … … 1466 1466 return "Language string failed to load: " . $key; 1467 1467 } 1468 1468 1469 1469 /** 1470 1470 * Returns true if an error occurred. -
trunk/wp-includes/class-smtp.php
r5390 r5700 29 29 */ 30 30 var $SMTP_PORT = 25; 31 31 32 32 /** 33 33 * SMTP reply line ending … … 35 35 */ 36 36 var $CRLF = "\r\n"; 37 37 38 38 /** 39 39 * Sets whether debugging is turned on … … 509 509 510 510 $this->helo_rply = $rply; 511 511 512 512 return true; 513 513 } -
trunk/wp-includes/classes.php
r5640 r5700 693 693 'data' => '', 'supplemental' => array() 694 694 ); 695 695 696 696 $r = wp_parse_args( $args, $defaults ); 697 697 extract( $r ); -
trunk/wp-includes/cron.php
r5274 r5700 84 84 $cron_url = get_option( 'siteurl' ) . '/wp-cron.php'; 85 85 $parts = parse_url( $cron_url ); 86 86 87 87 if ($parts['scheme'] == 'https') { 88 88 // support for SSL was added in 4.3.0 … … 95 95 $argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 ); 96 96 } 97 97 98 98 if ( $argyle ) 99 99 fputs( $argyle, -
trunk/wp-includes/formatting.php
r5623 r5700 1086 1086 substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) ) 1087 1087 $url = 'http://' . $url; 1088 1088 1089 1089 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1090 1090 if ( !is_array($protocols) ) -
trunk/wp-includes/functions.php
r5694 r5700 707 707 function get_status_header_desc( $code ) { 708 708 global $wp_header_to_desc; 709 709 710 710 $code = (int) $code; 711 711 712 712 if ( isset( $wp_header_to_desc[$code] ) ) { 713 713 return $wp_header_to_desc[$code]; … … 719 719 function status_header( $header ) { 720 720 $text = get_status_header_desc( $header ); 721 721 722 722 if ( empty( $text ) ) 723 723 return false; … … 1297 1297 } 1298 1298 } 1299 1299 1300 1300 if ( is_array( $defaults ) ) { 1301 1301 return array_merge( $defaults, $r ); -
trunk/wp-includes/general-template.php
r5625 r5700 62 62 function bloginfo($show='') { 63 63 $info = get_bloginfo($show); 64 64 65 65 // Don't filter URL's. 66 66 if (strpos($show, 'url') === false && … … 323 323 function wp_get_archives($args = '') { 324 324 global $wpdb, $wp_locale; 325 325 326 326 $defaults = array( 327 327 'type' => 'monthly', 'limit' => '', … … 329 329 'after' => '', 'show_post_count' => false 330 330 ); 331 331 332 332 $r = wp_parse_args( $args, $defaults ); 333 333 extract( $r ); … … 594 594 if ( $ak_post_titles ) { 595 595 foreach ( $ak_post_titles as $ak_post_title ) { 596 596 597 597 $post_title = apply_filters( "the_title", $ak_post_title->post_title ); 598 598 $post_title = str_replace('"', '"', wptexturize( $post_title )); 599 599 600 600 if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) 601 601 $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; … … 818 818 function user_can_richedit() { 819 819 global $wp_rich_edit, $pagenow; 820 820 821 821 if ( !isset( $wp_rich_edit) ) { 822 822 if ( get_user_option( 'rich_editing' ) == 'true' && -
trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
r5214 r5700 50 50 function _xmlChars($string) { 51 51 $trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); 52 52 53 53 foreach ($trans as $k => $v) 54 54 $trans[$k] = "&#".ord($k).";"; -
trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php
r4985 r5700 50 50 $data = shell_exec($this->cmd); 51 51 @unlink($this->tmpfile); 52 52 53 53 $returnData = array(); 54 54 $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); -
trunk/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php
r5614 r5700 116 116 $result = $tinyspell->checkWords($words); 117 117 break; 118 118 119 119 case "suggest": 120 120 $result = $tinyspell->getSuggestion($check); … … 139 139 $body = '<?xml version="1.0" encoding="utf-8" ?>'; 140 140 $body .= "\n"; 141 141 142 142 if (count($result) == 0) 143 143 $body .= '<res id="' . $id . '" cmd="'. $cmd .'" />'; -
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r5429 r5700 49 49 $mce_popups_css = str_replace('http://', 'https://', $mce_popups_css); 50 50 } 51 51 52 52 $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower(get_locale()); 53 53 ?> -
trunk/wp-includes/js/tinymce/tiny_mce_gzip.php
r5333 r5700 111 111 // Patch loading functions 112 112 //$content .= "tinyMCE_GZ.start();"; 113 113 114 114 // Do init based on index 115 115 $content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"; -
trunk/wp-includes/kses.php
r5383 r5700 183 183 'var' => array() 184 184 ); 185 185 186 186 $allowedtags = array( 187 187 'a' => array( -
trunk/wp-includes/link-template.php
r5611 r5700 274 274 function get_edit_post_link( $id = 0 ) { 275 275 $post = &get_post( $id ); 276 276 277 277 if ( $post->post_type == 'attachment' ) { 278 278 return; … … 280 280 if ( !current_user_can( 'edit_page', $post->ID ) ) 281 281 return; 282 282 283 283 $file = 'page'; 284 284 } else { 285 285 if ( !current_user_can( 'edit_post', $post->ID ) ) 286 286 return; 287 287 288 288 $file = 'post'; 289 289 } 290 290 291 291 return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . '/wp-admin/' . $file . '.php?action=edit&post=' . $post->ID, $post->ID ); 292 292 } … … 300 300 if ( !current_user_can( 'edit_page', $post->ID ) ) 301 301 return; 302 302 303 303 $file = 'page'; 304 304 } else { 305 305 if ( !current_user_can( 'edit_post', $post->ID ) ) 306 306 return; 307 307 308 308 $file = 'post'; 309 309 } … … 316 316 $comment = &get_comment( $comment_id ); 317 317 $post = &get_post( $comment->comment_post_ID ); 318 318 319 319 if ( $post->post_type == 'attachment' ) { 320 320 return; … … 454 454 function get_pagenum_link($pagenum = 1) { 455 455 global $wp_rewrite; 456 456 457 457 $pagenum = (int) $pagenum; 458 458 459 459 $request = remove_query_arg( 'paged' ); 460 460 461 461 $home_root = parse_url(get_option('home')); 462 462 $home_root = $home_root['path']; 463 463 $home_root = preg_quote( trailingslashit( $home_root ), '|' ); 464 464 465 465 $request = preg_replace('|^'. $home_root . '|', '', $request); 466 466 $request = preg_replace('|^/+|', '', $request); 467 467 468 468 if ( !$wp_rewrite->using_permalinks() || is_admin() ) { 469 469 $base = trailingslashit( get_bloginfo( 'home' ) ); … … 477 477 $qs_regex = '|\?.*?$|'; 478 478 preg_match( $qs_regex, $request, $qs_match ); 479 479 480 480 if ( $qs_match[0] ) { 481 481 $query_string = $qs_match[0]; … … 484 484 $query_string = ''; 485 485 } 486 486 487 487 $request = preg_replace( '|page/(.+)/?$|', '', $request); 488 488 489 489 $base = trailingslashit( get_bloginfo( 'url' ) ); 490 490 491 491 if ( $wp_rewrite->using_index_permalinks() && $pagenum > 1 ) { 492 492 $base .= 'index.php/'; 493 493 } 494 494 495 495 if ( $pagenum > 1 ) { 496 496 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' ); 497 497 } 498 498 499 499 $result = $base . $request . $query_string; 500 500 } 501 501 502 502 return $result; 503 503 } -
trunk/wp-includes/locale.php
r5308 r5700 93 93 $trans = __('number_format_decimals'); 94 94 $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans; 95 95 96 96 $trans = __('number_format_decimal_point'); 97 97 $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; … … 99 99 $trans = __('number_format_thousands_sep'); 100 100 $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; 101 101 102 102 // Import global locale vars set during inclusion of $locale.php. 103 103 foreach ( $this->locale_vars as $var ) { -
trunk/wp-includes/pluggable.php
r5683 r5700 160 160 function wp_mail( $to, $subject, $message, $headers = '' ) { 161 161 global $phpmailer; 162 162 163 163 // (Re)create it, if it's gone missing 164 164 if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) { … … 167 167 $phpmailer = new PHPMailer(); 168 168 } 169 169 170 170 // Compact the input, apply the filters, and extract them back out 171 171 extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) ); 172 172 173 173 // Default headers 174 174 if ( empty( $headers ) ) { … … 181 181 $tempheaders = (array) explode( "\n", $headers ); 182 182 $headers = array(); 183 183 184 184 // If it's actually got contents 185 185 if ( !empty( $tempheaders ) ) { … … 188 188 // Explode them out 189 189 list( $name, $content ) = explode( ':', trim( $header ), 2 ); 190 190 191 191 // Cleanup crew 192 192 $name = trim( $name ); 193 193 $content = trim( $content ); 194 194 195 195 // Mainly for legacy -- process a From: header if it's there 196 196 if ( $name == 'From' ) { … … 200 200 $from_name = str_replace( '"', '', $from_name ); 201 201 $from_name = trim( $from_name ); 202 202 203 203 $from_email = substr( $content, strpos( '<', $content ) + 1 ); 204 204 $from_email = str_replace( '>', '', $from_email ); … … 222 222 } 223 223 } 224 224 225 225 // Empty out the values that may be set 226 226 $phpmailer->ClearAddresses(); … … 231 231 $phpmailer->ClearCustomHeaders(); 232 232 $phpmailer->ClearReplyTos(); 233 233 234 234 // From email and name 235 235 // If we don't have a name from the input headers … … 237 237 $from_name = 'WordPress'; 238 238 } 239 239 240 240 // If we don't have an email from the input headers 241 241 if ( !isset( $from_email ) ) { … … 245 245 $sitename = substr( $sitename, 4 ); 246 246 } 247 247 248 248 $from_email = 'wordpress@' . $sitename; 249 249 } 250 250 251 251 // Set the from name and email 252 252 $phpmailer->From = apply_filters( 'wp_mail_from', $from_email ); 253 253 $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); 254 254 255 255 // Set destination address 256 256 $phpmailer->AddAddress( $to ); 257 257 258 258 // Set mail's subject and body 259 259 $phpmailer->Subject = $subject; 260 260 $phpmailer->Body = $message; 261 261 262 262 // Set to use PHP's mail() 263 263 $phpmailer->IsMail(); 264 264 265 265 // Set Content-Type and charset 266 266 // If we don't have a content-type from the input headers … … 268 268 $content_type = 'text/plain'; 269 269 } 270 270 271 271 // Set whether it's plaintext or not, depending on $content_type 272 272 if ( $content_type == 'text/html' ) { … … 275 275 $phpmailer->IsHTML( false ); 276 276 } 277 277 278 278 // If we don't have a charset from the input headers 279 279 if ( !isset( $charset ) ) { 280 280 $charset = get_bloginfo( 'charset' ); 281 281 } 282 282 283 283 // Set the content-type and charset 284 284 $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', 'text/plain' ); 285 285 $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); 286 286 287 287 // Set custom headers 288 288 if ( !empty( $headers ) ) { … … 291 291 } 292 292 } 293 293 294 294 do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); 295 295 296 296 // Send! 297 297 $result = @$phpmailer->Send(); 298 298 299 299 return $result; 300 300 } … … 534 534 535 535 @wp_mail($user->user_email, $subject, $notify_message, $message_headers); 536 536 537 537 return true; 538 538 } … … 550 550 if( get_option( "moderation_notify" ) == 0 ) 551 551 return true; 552 552 553 553 $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1"); 554 554 $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1"); -
trunk/wp-includes/post-template.php
r5615 r5700 142 142 'more_file' => '', 'echo' => 1 143 143 ); 144 144 145 145 $r = wp_parse_args( $args, $defaults ); 146 146 extract( $r ); … … 255 255 'name' => 'page_id', 'show_option_none' => '' 256 256 ); 257 257 258 258 $r = wp_parse_args( $args, $defaults ); 259 259 extract( $r ); … … 286 286 'authors' => '', 'sort_column' => 'menu_order, post_title' 287 287 ); 288 288 289 289 $r = wp_parse_args( $args, $defaults ); 290 290 extract( $r ); -
trunk/wp-includes/post.php
r5685 r5700 28 28 function &get_children($args = '', $output = OBJECT) { 29 29 global $post_cache, $wpdb, $blog_id; 30 30 31 31 if ( empty( $args ) ) { 32 32 if ( isset( $GLOBALS['post'] ) ) { … … 40 40 $args = 'post_parent=' . (int) $args; 41 41 } 42 42 43 43 $defaults = array( 44 44 'numberposts' => -1, 'post_type' => '', 45 45 'post_status' => '', 'post_parent' => 0 46 46 ); 47 47 48 48 $r = wp_parse_args( $args, $defaults ); 49 49 … … 175 175 function get_posts($args) { 176 176 global $wpdb; 177 177 178 178 $defaults = array( 179 179 'numberposts' => 5, 'offset' => 0, … … 184 184 'post_status' => 'publish', 'post_parent' => 0 185 185 ); 186 186 187 187 $r = wp_parse_args( $args, $defaults ); 188 188 extract( $r ); 189 189 190 190 $numberposts = (int) $numberposts; 191 191 $offset = (int) $offset; … … 431 431 432 432 do_action('deleted_post', $postid); 433 433 434 434 return $post; 435 435 } … … 450 450 $defaults = array('fields' => 'all'); 451 451 $args = wp_parse_args( $args, $defaults ); 452 452 453 453 $tags = get_object_terms($post_id, 'post_tag', $args); 454 454 … … 778 778 /* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */ 779 779 global $wpdb; 780 780 781 781 $post_id = (int) $post_id; 782 782 783 783 if ( !$post_id ) 784 784 return false; … … 1041 1041 function &get_pages($args = '') { 1042 1042 global $wpdb; 1043 1043 1044 1044 $defaults = array( 1045 1045 'child_of' => 0, 'sort_order' => 'ASC', … … 1049 1049 'authors' => '' 1050 1050 ); 1051 1051 1052 1052 $r = wp_parse_args( $args, $defaults ); 1053 1053 extract( $r ); -
trunk/wp-includes/query.php
r5660 r5700 462 462 463 463 $qv['attachment_id'] = (int) $qv['attachment_id']; 464 464 465 465 if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) { 466 466 $this->is_single = true; … … 1022 1022 if ( is_admin() ) 1023 1023 $where .= " OR post_status = 'future' OR post_status = 'draft'"; 1024 1024 1025 1025 if ( is_user_logged_in() ) { 1026 1026 $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'"; -
trunk/wp-includes/rewrite.php
r5283 r5700 64 64 function url_to_postid($url) { 65 65 global $wp_rewrite; 66 66 67 67 $url = apply_filters('url_to_postid', $url); 68 68 -
trunk/wp-includes/script-loader.php
r5637 r5700 12 12 function default_scripts() { 13 13 $this->add( 'dbx', '/wp-includes/js/dbx.js', false, '2.05' ); 14 14 15 15 $this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' ); 16 16 17 17 $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); 18 18 19 19 $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' ); 20 20 $this->localize( 'quicktags', 'quicktagsL10n', array( … … 29 29 'enterImageDescription' => __('Enter a description of the image') 30 30 ) ); 31 31 32 32 $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); 33 33 34 34 $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070528' ); 35 35 $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); 36 36 $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070528' ); 37 37 38 38 $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.1'); 39 39 40 40 $this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306'); 41 41 $this->localize( 'autosave', 'autosaveL10n', array( … … 46 46 'savingText' => __('Saving Draft...') 47 47 ) ); 48 48 49 49 $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306'); 50 50 $this->localize( 'wp-ajax', 'WPAjaxL10n', array( … … 54 54 'whoaText' => __("Slow down, I'm still sending your data!") 55 55 ) ); 56 56 57 57 $this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070306' ); 58 58 $this->localize( 'listman', 'listManL10n', array( … … 60 60 'delText' => __('Are you sure you want to delete this %thing%?') 61 61 ) ); 62 62 63 63 $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.7.1-b2'); 64 64 $this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.7.1-b2'); … … 69 69 $this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.7.1-b2'); 70 70 $this->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.7.1-b2'); 71 71 72 72 $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118'); 73 73 74 74 $this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.1.2'); 75 75 $this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '1.0.3'); 76 76 $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2'); 77 77 78 78 if ( is_admin() ) { 79 79 global $pagenow; … … 183 183 $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src; 184 184 $src = $this->scripts[$handle]->src; 185 185 186 186 if (!preg_match('|^https?://|', $src)) { 187 187 $src = get_option('siteurl') . $src; 188 188 } 189 189 190 190 $src = add_query_arg('ver', $ver, $src); 191 191 $src = clean_url(apply_filters( 'script_loader_src', $src )); -
trunk/wp-includes/streams.php
r4003 r5700 29 29 return false; 30 30 } 31 31 32 32 // should return new position 33 33 function seekto($position) { 34 34 return false; 35 35 } 36 36 37 37 // returns current position 38 38 function currentpos() { 39 39 return false; 40 40 } 41 41 42 42 // returns length of entire stream (limit for seekto()s) 43 43 function length() { … … 115 115 } 116 116 $this->_pos = ftell($this->_fd); 117 117 118 118 return $data; 119 119 } else return ''; -
trunk/wp-includes/taxonomy.php
r5658 r5700 99 99 $wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'"); 100 100 } 101 101 102 102 $tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id"); 103 103 … … 136 136 wp_update_term_count($terms, $taxonomy); 137 137 } 138 138 139 139 // TODO clear the cache 140 140 } … … 240 240 $wpdb->query("UPDATE $wpdb->terms SET slug = '$slug' WHERE term_id = '$term_id'"); 241 241 } 242 242 243 243 $tt_id = $wpdb->get_var("SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.term_id = $term_id"); 244 244 … … 301 301 return $wpdb->get_row("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = '$taxonomy'", ARRAY_A); 302 302 } 303 303 304 304 /** 305 305 * Given an array of terms, returns those that are defined term slugs. Ignores integers. … … 317 317 return $wpdb->get_col("SELECT slug FROM $wpdb->terms WHERE slug IN ($terms)"); 318 318 } 319 319 320 320 /** 321 321 * Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy … … 332 332 if ( ! is_taxonomy($taxonomy) ) 333 333 return false; 334 334 335 335 if ( !is_array($terms) ) 336 336 $terms = array($terms); -
trunk/wp-includes/theme.php
r5630 r5700 71 71 'strong' => array() 72 72 ); 73 73 74 74 $theme_data = implode( '', file( $theme_file ) ); 75 75 $theme_data = str_replace ( '\r', '\n', $theme_data ); … … 80 80 preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ); 81 81 preg_match( '|Template:(.*)$|mi', $theme_data, $template ); 82 82 83 83 if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) 84 84 $version = wp_kses( trim( $version[1] ), $themes_allowed_tags ); 85 85 else 86 86 $version = ''; 87 87 88 88 if ( preg_match('|Status:(.*)|i', $theme_data, $status) ) 89 89 $status = wp_kses( trim( $status[1] ), $themes_allowed_tags ); 90 90 else 91 91 $status = 'publish'; 92 92 93 93 $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags ); 94 94 $theme_uri = clean_url( trim( $theme_uri[1] ) ); 95 95 $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) ); 96 96 $template = wp_kses( trim( $template[1] ), $themes_allowed_tags ); 97 97 98 98 $author_uri = clean_url( trim( $author_uri[1] ) ); 99 99 100 100 if ( empty( $author_uri[1] ) ) { 101 101 $author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags ); -
trunk/wp-includes/user.php
r5587 r5700 189 189 'selected' => 0, 'name' => 'user', 'class' => '' 190 190 ); 191 191 192 192 $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0; 193 193 194 194 $r = wp_parse_args( $args, $defaults ); 195 195 extract( $r ); -
trunk/wp-includes/vars.php
r5446 r5700 39 39 100 => 'Continue', 40 40 101 => 'Switching Protocols', 41 41 42 42 200 => 'OK', 43 43 201 => 'Created', … … 47 47 205 => 'Reset Content', 48 48 206 => 'Partial Content', 49 49 50 50 300 => 'Multiple Choices', 51 51 301 => 'Moved Permanently', … … 55 55 305 => 'Use Proxy', 56 56 307 => 'Temporary Redirect', 57 57 58 58 400 => 'Bad Request', 59 59 401 => 'Unauthorized', … … 73 73 416 => 'Requested Range Not Satisfiable', 74 74 417 => 'Expectation Failed', 75 75 76 76 500 => 'Internal Server Error', 77 77 501 => 'Not Implemented', -
trunk/wp-includes/widgets.php
r5688 r5700 60 60 function unregister_sidebar( $name ) { 61 61 global $wp_registered_sidebars; 62 62 63 63 if ( isset( $wp_registered_sidebars[$name] ) ) 64 64 unset( $wp_registered_sidebars[$name] ); … … 330 330 extract( $args ); 331 331 $options = get_option( 'widget_pages' ); 332 332 333 333 $title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title']; 334 334 $sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby']; 335 335 $exclude = empty( $options['exclude'] ) ? '' : '&exclude=' . $options['exclude']; 336 336 337 337 if ( $sortby == 'menu_order' ) { 338 338 $sortby = 'menu_order, post_title'; 339 339 } 340 340 341 341 $out = wp_list_pages( 'title_li=&echo=0&sort_column=' . $sortby . $exclude ); 342 342 343 343 if ( !empty( $out ) ) { 344 344 ?> … … 357 357 if ( $_POST['pages-submit'] ) { 358 358 $newoptions['title'] = strip_tags(stripslashes($_POST['pages-title'])); 359 359 360 360 $sortby = stripslashes( $_POST['pages-sortby'] ); 361 361 362 362 if ( in_array( $sortby, array( 'post_title', 'menu_order', 'ID' ) ) ) { 363 363 $newoptions['sortby'] = $sortby; … … 365 365 $newoptions['sortby'] = 'menu_order'; 366 366 } 367 367 368 368 $newoptions['exclude'] = strip_tags( stripslashes( $_POST['pages-exclude'] ) ); 369 369 } … … 799 799 wp_register_sidebar_widget('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments', $class); 800 800 wp_register_widget_control('recent-comments', __('Recent Comments'), 'wp_widget_recent_comments_control', $dims); 801 801 802 802 if ( is_active_widget('wp_widget_recent_comments') ) 803 803 add_action('wp_head', 'wp_widget_recent_comments_style'); -
trunk/wp-includes/wp-db.php
r5510 r5700 259 259 if ( $query ) 260 260 $this->query($query); 261 261 262 262 if ( !isset($this->last_result[$y]) ) 263 263 return null; … … 373 373 if ( !$this->show_errors ) 374 374 return false; 375 375 376 376 header('Content-Type: text/html; charset=utf-8'); 377 377 -
trunk/wp-mail.php
r5396 r5700 118 118 } 119 119 $content = trim($content); 120 120 121 121 if (stripos($content_transfer_encoding, "quoted-printable") !== false) { 122 122 $content = quoted_printable_decode($content); -
trunk/wp-settings.php
r5690 r5700 147 147 else 148 148 $link = 'wp-admin/install.php'; 149 149 150 150 wp_die( sprintf( 'It doesn’t look like you’ve installed WP yet. Try running <a href="%s">install.php</a>.', $link ) ); 151 151 } -
trunk/xmlrpc.php
r5671 r5700 506 506 $category["description"] = ""; 507 507 } 508 508 509 509 $new_category = array( 510 510 "cat_name" => $category["name"], … … 785 785 return $this->error; 786 786 } 787 787 788 788 $cap = ($publish) ? 'publish_posts' : 'edit_posts'; 789 789 $user = set_current_user(0, $user_login); … … 1217 1217 $comment_status = (int) $content_struct["mt_allow_comments"]; 1218 1218 } 1219 1219 1220 1220 // Do some timestamp voodoo 1221 1221 $dateCreatedd = $content_struct['dateCreated'];
Note: See TracChangeset
for help on using the changeset viewer.