Changeset 12752
- Timestamp:
- 01/18/2010 08:34:48 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-header.php
r12546 r12752 190 190 191 191 function toggle_text(force) { 192 if (jQuery('#textcolor').val() == 'blank') {192 if (jQuery('#textcolor').val() == 'blank') { 193 193 //Show text 194 194 jQuery( buttons.toString() ).show(); -
trunk/wp-admin/import/blogger.php
r12270 r12752 782 782 // First line of headers is the HTTP response code 783 783 $http_response_line = array_shift($response_header_lines); 784 if (preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; }784 if (preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } 785 785 786 786 // put the rest of the headers in an array … … 959 959 $this->depth++; 960 960 961 if (!empty($this->in_content)) {961 if (!empty($this->in_content)) { 962 962 $attrs_prefix = array(); 963 963 … … 967 967 } 968 968 $attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix))); 969 if (strlen($attrs_str) > 0) {969 if (strlen($attrs_str) > 0) { 970 970 $attrs_str = " " . $attrs_str; 971 971 } 972 972 973 973 $xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0]))); 974 if (strlen($xmlns_str) > 0) {974 if (strlen($xmlns_str) > 0) { 975 975 $xmlns_str = " " . $xmlns_str; 976 976 } 977 977 978 978 // handle self-closing tags (case: a new child found right-away, no text node) 979 if (count($this->in_content) == 2) {979 if (count($this->in_content) == 2) { 980 980 array_push($this->in_content, ">"); 981 981 } 982 982 983 983 array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); 984 } else if (in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {984 } else if (in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { 985 985 $this->in_content = array(); 986 986 $this->is_xhtml = $attrs['type'] == 'xhtml'; 987 987 array_push($this->in_content, array($tag,$this->depth)); 988 } else if ($tag == 'link') {988 } else if ($tag == 'link') { 989 989 array_push($this->entry->links, $attrs); 990 } else if ($tag == 'category') {990 } else if ($tag == 'category') { 991 991 array_push($this->entry->categories, $attrs['term']); 992 992 } … … 999 999 $tag = array_pop(split(":", $name)); 1000 1000 1001 if (!empty($this->in_content)) {1002 if ($this->in_content[0][0] == $tag &&1001 if (!empty($this->in_content)) { 1002 if ($this->in_content[0][0] == $tag && 1003 1003 $this->in_content[0][1] == $this->depth) { 1004 1004 array_shift($this->in_content); 1005 if ($this->is_xhtml) {1005 if ($this->is_xhtml) { 1006 1006 $this->in_content = array_slice($this->in_content, 2, count($this->in_content)-3); 1007 1007 } … … 1036 1036 function cdata($parser, $data) { 1037 1037 #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n"; 1038 if (!empty($this->in_content)) {1038 if (!empty($this->in_content)) { 1039 1039 // handle self-closing tags (case: text node found, need to close element started) 1040 1040 if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { … … 1054 1054 $name = array_pop($components); 1055 1055 1056 if (!empty($components)) {1056 if (!empty($components)) { 1057 1057 $ns = join(":",$components); 1058 foreach ($this->ns_contexts as $context) {1059 foreach ($context as $mapping) {1060 if ($mapping[1] == $ns && strlen($mapping[0]) > 0) {1058 foreach ($this->ns_contexts as $context) { 1059 foreach ($context as $mapping) { 1060 if ($mapping[1] == $ns && strlen($mapping[0]) > 0) { 1061 1061 return "$mapping[0]:$name"; 1062 1062 } -
trunk/wp-admin/import/blogware.php
r12104 r12752 63 63 preg_match('|<item type=\"(.*?)\">|is', $post, $post_type); 64 64 $post_type = $post_type[1]; 65 if ($post_type == "photo") {65 if ($post_type == "photo") { 66 66 preg_match('|<photoFilename>(.*?)</photoFilename>|is', $post, $post_title); 67 67 } else { … … 83 83 } 84 84 85 if (strcasecmp($post_type, "photo") === 0) {85 if (strcasecmp($post_type, "photo") === 0) { 86 86 preg_match('|<sizedPhotoUrl>(.*?)</sizedPhotoUrl>|is', $post, $post_content); 87 87 $post_content = '<img src="'.trim($post_content[1]).'" />'; … … 118 118 break; 119 119 } 120 if (0 != count($categories))120 if (0 != count($categories)) 121 121 wp_create_categories($categories, $post_id); 122 122 } -
trunk/wp-admin/import/dotclear.php
r12513 r12752 13 13 **/ 14 14 15 if(!function_exists('get_comment_count')) 16 { 15 if (!function_exists('get_comment_count')) { 17 16 /** 18 17 * Get the comment count for posts. … … 31 30 } 32 31 33 if(!function_exists('link_exists')) 34 { 32 if (!function_exists('link_exists')) { 35 33 /** 36 34 * Check whether link already exists. … … 181 179 $dccat2wpcat = array(); 182 180 // Do the Magic 183 if(is_array($categories)) 184 { 181 if (is_array($categories)) { 185 182 echo '<p>'.__('Importing Categories...').'<br /><br /></p>'; 186 foreach ($categories as $category) 187 { 183 foreach ($categories as $category) { 188 184 $count++; 189 185 extract($category); … … 194 190 $desc = $wpdb->escape(csc ($cat_desc)); 195 191 196 if($cinfo = category_exists($name)) 197 { 192 if ($cinfo = category_exists($name)) { 198 193 $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); 199 } 200 else 201 { 194 } else { 202 195 $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); 203 196 } … … 214 207 } 215 208 216 function users2wp($users='') 217 { 209 function users2wp($users='') { 218 210 // General Housekeeping 219 211 global $wpdb; … … 222 214 223 215 // Midnight Mojo 224 if(is_array($users)) 225 { 216 if (is_array($users)) { 226 217 echo '<p>'.__('Importing Users...').'<br /><br /></p>'; 227 foreach($users as $user) 228 { 218 foreach ($users as $user) { 229 219 $count++; 230 220 extract($user); … … 234 224 $RealName = $wpdb->escape(csc ($user_pseudo)); 235 225 236 if($uinfo = get_userdatabylogin($name)) 237 { 226 if ($uinfo = get_userdatabylogin($name)) { 238 227 239 228 $ret_id = wp_insert_user(array( … … 245 234 'display_name' => $Realname) 246 235 ); 247 } 248 else 249 { 236 } else { 250 237 $ret_id = wp_insert_user(array( 251 238 'user_login' => $user_id, … … 263 250 $user = new WP_User($ret_id); 264 251 $wp_perms = $user_level + 1; 265 if (10 == $wp_perms) { $user->set_role('administrator'); }266 else if (9 == $wp_perms) { $user->set_role('editor'); }267 else if (5 <= $wp_perms) { $user->set_role('editor'); }268 else if (4 <= $wp_perms) { $user->set_role('author'); }269 else if (3 <= $wp_perms) { $user->set_role('contributor'); }270 else if (2 <= $wp_perms) { $user->set_role('contributor'); }252 if (10 == $wp_perms) { $user->set_role('administrator'); } 253 else if (9 == $wp_perms) { $user->set_role('editor'); } 254 else if (5 <= $wp_perms) { $user->set_role('editor'); } 255 else if (4 <= $wp_perms) { $user->set_role('author'); } 256 else if (3 <= $wp_perms) { $user->set_role('contributor'); } 257 else if (2 <= $wp_perms) { $user->set_role('contributor'); } 271 258 else { $user->set_role('subscriber'); } 272 259 … … 290 277 }// End function user2wp() 291 278 292 function posts2wp($posts='') 293 { 279 function posts2wp($posts='') { 294 280 // General Housekeeping 295 281 global $wpdb; … … 299 285 300 286 // Do the Magic 301 if(is_array($posts)) 302 { 287 if (is_array($posts)) { 303 288 echo '<p>'.__('Importing Posts...').'<br /><br /></p>'; 304 289 foreach($posts as $post) … … 328 313 // Import Post data into WordPress 329 314 330 if($pinfo = post_exists($Title,$post_content)) 331 { 315 if ($pinfo = post_exists($Title,$post_content)) { 332 316 $ret_id = wp_insert_post(array( 333 317 'ID' => $pinfo, … … 348 332 if ( is_wp_error( $ret_id ) ) 349 333 return $ret_id; 350 } 351 else 352 { 334 } else { 353 335 $ret_id = wp_insert_post(array( 354 336 'post_author' => $authorid, … … 376 358 $category1 = $category1->term_id; 377 359 378 if ($cat1 = $category1) { $cats[1] = $cat1; }379 380 if (!empty($cats)) { wp_set_post_categories($ret_id, $cats); }360 if ($cat1 = $category1) { $cats[1] = $cat1; } 361 362 if (!empty($cats)) { wp_set_post_categories($ret_id, $cats); } 381 363 } 382 364 } … … 388 370 } 389 371 390 function comments2wp($comments='') 391 { 372 function comments2wp($comments='') { 392 373 // General Housekeeping 393 374 global $wpdb; … … 397 378 398 379 // Magic Mojo 399 if(is_array($comments)) 400 { 380 if (is_array($comments)) { 401 381 echo '<p>'.__('Importing Comments...').'<br /><br /></p>'; 402 foreach($comments as $comment) 403 { 382 foreach ($comments as $comment) { 404 383 $count++; 405 384 extract($comment); … … 450 429 } 451 430 452 function links2wp($links='') 453 { 431 function links2wp($links='') { 454 432 // General Housekeeping 455 433 global $wpdb; … … 457 435 458 436 // Deal with the links 459 if(is_array($links)) 460 { 437 if (is_array($links)) { 461 438 echo '<p>'.__('Importing Links...').'<br /><br /></p>'; 462 foreach($links as $link) 463 { 439 foreach ($links as $link) { 464 440 $count++; 465 441 extract($link); … … 476 452 $description = $wpdb->escape(csc ($title)); 477 453 478 if ($linfo = link_exists($linkname)) {454 if ($linfo = link_exists($linkname)) { 479 455 $ret_id = wp_insert_link(array( 480 456 'link_id' => $linfo, … … 505 481 } 506 482 507 function import_categories() 508 { 483 function import_categories() { 509 484 // Category Import 510 485 $cats = $this->get_dc_cats(); … … 521 496 } 522 497 523 function import_users() 524 { 498 function import_users() { 525 499 // User Import 526 500 $users = $this->get_dc_users(); … … 533 507 } 534 508 535 function import_posts() 536 { 509 function import_posts() { 537 510 // Post Import 538 511 $posts = $this->get_dc_posts(); … … 547 520 } 548 521 549 function import_comments() 550 { 522 function import_comments() { 551 523 // Comment Import 552 524 $comments = $this->get_dc_comments(); … … 572 544 } 573 545 574 function cleanup_dcimport() 575 { 546 function cleanup_dcimport() { 576 547 delete_option('dcdbprefix'); 577 548 delete_option('dc_cats'); … … 590 561 } 591 562 592 function tips() 593 { 563 function tips() { 594 564 echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>'; 595 565 echo '<h3>'.__('Users').'</h3>'; … … 609 579 } 610 580 611 function db_form() 612 { 581 function db_form() { 613 582 echo '<table class="form-table">'; 614 583 printf('<tr><th><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('DotClear Database User:')); … … 621 590 } 622 591 623 function dispatch() 624 { 592 function dispatch() { 625 593 626 594 if (empty ($_GET['step'])) … … 630 598 $this->header(); 631 599 632 if ( $step > 0 ) 633 { 600 if ( $step > 0 ) { 634 601 check_admin_referer('import-dotclear'); 635 602 636 if($_POST['dbuser']) 637 { 603 if ($_POST['dbuser']) { 638 604 if(get_option('dcuser')) 639 605 delete_option('dcuser'); 640 606 add_option('dcuser', sanitize_user($_POST['dbuser'], true)); 641 607 } 642 if($_POST['dbpass']) 643 { 608 if ($_POST['dbpass']) { 644 609 if(get_option('dcpass')) 645 610 delete_option('dcpass'); … … 647 612 } 648 613 649 if($_POST['dbname']) 650 { 651 if(get_option('dcname')) 614 if ($_POST['dbname']) { 615 if (get_option('dcname')) 652 616 delete_option('dcname'); 653 617 add_option('dcname', sanitize_user($_POST['dbname'], true)); 654 618 } 655 if($_POST['dbhost']) 656 { 619 if ($_POST['dbhost']) { 657 620 if(get_option('dchost')) 658 621 delete_option('dchost'); 659 622 add_option('dchost', sanitize_user($_POST['dbhost'], true)); 660 623 } 661 if($_POST['dccharset']) 662 { 663 if(get_option('dccharset')) 624 if ($_POST['dccharset']) { 625 if (get_option('dccharset')) 664 626 delete_option('dccharset'); 665 627 add_option('dccharset', sanitize_user($_POST['dccharset'], true)); 666 628 } 667 if($_POST['dbprefix']) 668 { 669 if(get_option('dcdbprefix')) 629 if ($_POST['dbprefix']) { 630 if (get_option('dcdbprefix')) 670 631 delete_option('dcdbprefix'); 671 632 add_option('dcdbprefix', sanitize_user($_POST['dbprefix'], true)); … … 675 636 } 676 637 677 switch ($step) 678 { 638 switch ($step) { 679 639 default: 680 640 case 0 : … … 706 666 } 707 667 708 function Dotclear_Import() 709 { 668 function Dotclear_Import() { 710 669 // Nothing. 711 670 } -
trunk/wp-admin/includes/class-wp-filesystem-base.php
r11831 r12752 157 157 return $folder; 158 158 } 159 if ( $return = $this->search_for_folder($folder) )159 if ( $return = $this->search_for_folder($folder) ) 160 160 $this->cache[ $folder ] = $return; 161 161 return $return; … … 289 289 $attarray = preg_split('//', $mode); 290 290 291 for ($i=0; $i < count($attarray); $i++)292 if ($key = array_search($attarray[$i], $legal))291 for ($i=0; $i < count($attarray); $i++) 292 if ($key = array_search($attarray[$i], $legal)) 293 293 $realmode .= $legal[$key]; 294 294 -
trunk/wp-admin/includes/class-wp-filesystem-ssh2.php
r12723 r12752 172 172 function cwd() { 173 173 $cwd = $this->run_command('pwd'); 174 if ( $cwd )174 if ( $cwd ) 175 175 $cwd = trailingslashit($cwd); 176 176 return $cwd; … … 240 240 241 241 function copy($source, $destination, $overwrite = false ) { 242 if ( ! $overwrite && $this->exists($destination) )242 if ( ! $overwrite && $this->exists($destination) ) 243 243 return false; 244 244 $content = $this->get_contents($source); 245 if ( false === $content)245 if ( false === $content) 246 246 return false; 247 247 return $this->put_contents($destination, $content); -
trunk/wp-admin/includes/class-wp-upgrader.php
r12673 r12752 913 913 914 914 $this->plugin = $this->upgrader->plugin_info(); 915 if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){915 if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){ 916 916 show_message(__('Reactivating the plugin…')); 917 917 echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>'; -
trunk/wp-admin/includes/file.php
r12733 r12752 110 110 */ 111 111 function list_files( $folder = '', $levels = 100 ) { 112 if ( empty($folder) )112 if ( empty($folder) ) 113 113 return false; 114 114 115 if ( ! $levels )115 if ( ! $levels ) 116 116 return false; 117 117 … … 123 123 if ( is_dir( $folder . '/' . $file ) ) { 124 124 $files2 = list_files( $folder . '/' . $file, $levels - 1); 125 if ( $files2 )125 if ( $files2 ) 126 126 $files = array_merge($files, $files2 ); 127 127 else … … 622 622 if ( ! class_exists("WP_Filesystem_$method") ) { 623 623 $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method); 624 if ( ! file_exists($abstraction_file) )624 if ( ! file_exists($abstraction_file) ) 625 625 return; 626 626 … … 671 671 $method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets' 672 672 673 if ( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){673 if ( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){ 674 674 if ( !$context ) 675 675 $context = WP_CONTENT_DIR; … … 808 808 <tr valign="top"> 809 809 <th scope="row"><label for="hostname"><?php _e('Hostname') ?></label></th> 810 <td><input name="hostname" type="text" id="hostname" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php if ( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td>810 <td><input name="hostname" type="text" id="hostname" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php if ( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td> 811 811 </tr> 812 812 813 813 <tr valign="top"> 814 814 <th scope="row"><label for="username"><?php _e('Username') ?></label></th> 815 <td><input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php if ( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td>815 <td><input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php if ( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td> 816 816 </tr> 817 817 … … 828 828 <label for="private_key"><?php _e('Private Key:') ?></label> 829 829 </div></th> 830 <td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php if ( defined('FTP_PUBKEY') ) echo ' disabled="disabled"' ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php if( defined('FTP_PRIKEY') ) echo ' disabled="disabled"' ?> size="40" />830 <td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php if ( defined('FTP_PUBKEY') ) echo ' disabled="disabled"' ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php if ( defined('FTP_PRIKEY') ) echo ' disabled="disabled"' ?> size="40" /> 831 831 <div><?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?></div></td> 832 832 </tr> -
trunk/wp-admin/includes/misc.php
r12733 r12752 267 267 */ 268 268 function show_message($message) { 269 if ( is_wp_error($message) ){270 if ( $message->get_error_data() )269 if ( is_wp_error($message) ){ 270 if ( $message->get_error_data() ) 271 271 $message = $message->get_error_message() . ': ' . $message->get_error_data(); 272 272 else -
trunk/wp-admin/includes/ms.php
r12674 r12752 4 4 return $file; 5 5 } 6 if ( $file['error'] != '0' ) // there's already an error6 if ( $file['error'] != '0' ) // there's already an error 7 7 return $file; 8 8 … … 14 14 $space_left = $space_allowed - $space_used; 15 15 $file_size = filesize( $file['tmp_name'] ); 16 if ( $space_left < $file_size )16 if ( $space_left < $file_size ) 17 17 $file['error'] = sprintf( __( 'Not enough space to upload. %1$s Kb needed.' ), number_format( ($file_size - $space_left) /1024 ) ); 18 if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )18 if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) 19 19 $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s Kb in size.'), get_site_option( 'fileupload_maxk', 1500 ) ); 20 if ( upload_is_user_over_quota( false ) ) {20 if ( upload_is_user_over_quota( false ) ) { 21 21 $file['error'] = __('You have used your space quota. Please delete files before uploading.'); 22 22 } 23 if ( $file['error'] != '0' )23 if ( $file['error'] != '0' ) 24 24 wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' ); 25 25 … … 91 91 if ( is_array( $blogs ) ) { 92 92 foreach( $blogs as $n => $blog ) { 93 if ( $blog[ 'blog_id' ] == $blog_id ) {93 if ( $blog[ 'blog_id' ] == $blog_id ) { 94 94 unset( $blogs[ $n ] ); 95 95 } … … 139 139 140 140 function confirm_delete_users( $users ) { 141 if ( !is_array( $users ) )141 if ( !is_array( $users ) ) 142 142 return false; 143 143 … … 148 148 wp_nonce_field( 'allusers' ); 149 149 foreach ( (array) $_POST['allusers'] as $key => $val ) { 150 if ( $val != '' && $val != '0' ) {150 if ( $val != '' && $val != '0' ) { 151 151 $user = new WP_User( $val ); 152 152 if ( in_array( $user->user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) ) { … … 155 155 echo "<input type='hidden' name='user[]' value='{$val}'/>\n"; 156 156 $blogs = get_blogs_of_user( $val, true ); 157 if ( !empty( $blogs ) ) {157 if ( !empty( $blogs ) ) { 158 158 foreach ( (array) $blogs as $key => $details ) { 159 159 $blog_users = get_users_of_blog( $details->userblog_id ); 160 if ( is_array( $blog_users ) && !empty( $blog_users ) ) {160 if ( is_array( $blog_users ) && !empty( $blog_users ) ) { 161 161 echo "<p><a href='http://{$details->domain}{$details->path}'>{$details->blogname}</a> "; 162 162 echo "<select name='blog[$val][{$key}]'>"; 163 163 $out = ''; 164 164 foreach( $blog_users as $user ) { 165 if ( $user->user_id != $val )165 if ( $user->user_id != $val ) 166 166 $out .= "<option value='{$user->user_id}'>{$user->user_login}</option>"; 167 167 } 168 if ( $out == '' )168 if ( $out == '' ) 169 169 $out = "<option value='1'>admin</option>"; 170 170 echo $out; … … 183 183 $themes = get_themes(); 184 184 185 if ( $blog_id != 0 )185 if ( $blog_id != 0 ) 186 186 switch_to_blog( $blog_id ); 187 187 188 188 $blog_allowed_themes = get_option( "allowedthemes" ); 189 if ( !is_array( $blog_allowed_themes ) || empty( $blog_allowed_themes ) ) { // convert old allowed_themes to new allowedthemes189 if ( !is_array( $blog_allowed_themes ) || empty( $blog_allowed_themes ) ) { // convert old allowed_themes to new allowedthemes 190 190 $blog_allowed_themes = get_option( "allowed_themes" ); 191 191 192 if ( is_array( $blog_allowed_themes ) ) {192 if ( is_array( $blog_allowed_themes ) ) { 193 193 foreach( (array) $themes as $key => $theme ) { 194 194 $theme_key = wp_specialchars( $theme[ 'Stylesheet' ] ); 195 if ( isset( $blog_allowed_themes[ $key ] ) == true ) {195 if ( isset( $blog_allowed_themes[ $key ] ) == true ) { 196 196 $blog_allowedthemes[ $theme_key ] = 1; 197 197 } … … 203 203 } 204 204 205 if ( $blog_id != 0 )205 if ( $blog_id != 0 ) 206 206 restore_current_blog(); 207 207 … … 257 257 function update_profile_email() { 258 258 global $current_user, $wpdb; 259 if ( isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {259 if ( isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) { 260 260 $new_email = get_option( $current_user->ID . '_new_email' ); 261 if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {261 if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) { 262 262 $user->ID = $current_user->ID; 263 263 $user->user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) ); … … 278 278 $errors = new WP_Error(); 279 279 280 if ( $current_user->id != $_POST[ 'user_id' ] )280 if ( $current_user->id != $_POST[ 'user_id' ] ) 281 281 return false; 282 282 283 if ( $current_user->user_email != $_POST[ 'email' ] ) {283 if ( $current_user->user_email != $_POST[ 'email' ] ) { 284 284 if ( !is_email( $_POST[ 'email' ] ) ) { 285 285 $errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) ); … … 287 287 } 288 288 289 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST[ 'email' ] ) ) ) {289 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST[ 'email' ] ) ) ) { 290 290 $errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address is already used." ), array( 'form-field' => 'email' ) ); 291 291 delete_option( $current_user->ID . '_new_email' ); … … 328 328 function new_user_email_admin_notice() { 329 329 global $current_user; 330 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET[ 'updated' ] ) && $email = get_option( $current_user->ID . '_new_email' ) )330 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET[ 'updated' ] ) && $email = get_option( $current_user->ID . '_new_email' ) ) 331 331 echo "<div id='update-nag'>" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email[ 'newemail' ] ) . "</div>"; 332 332 } … … 336 336 $themes = get_themes(); 337 337 $allowed_themes = get_site_option( 'allowedthemes' ); 338 if ( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) {338 if ( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) { 339 339 $allowed_themes = get_site_option( "allowed_themes" ); // convert old allowed_themes format 340 if ( !is_array( $allowed_themes ) ) {340 if ( !is_array( $allowed_themes ) ) { 341 341 $allowed_themes = array(); 342 342 } else { 343 343 foreach( (array) $themes as $key => $theme ) { 344 344 $theme_key = wp_specialchars( $theme[ 'Stylesheet' ] ); 345 if ( isset( $allowed_themes[ $key ] ) == true ) {345 if ( isset( $allowed_themes[ $key ] ) == true ) { 346 346 $allowedthemes[ $theme_key ] = 1; 347 347 } … … 355 355 function get_space_allowed() { 356 356 $spaceAllowed = get_option("blog_upload_space"); 357 if ( $spaceAllowed == false )357 if ( $spaceAllowed == false ) 358 358 $spaceAllowed = get_site_option("blog_upload_space"); 359 if ( empty($spaceAllowed) || !is_numeric($spaceAllowed) )359 if ( empty($spaceAllowed) || !is_numeric($spaceAllowed) ) 360 360 $spaceAllowed = 50; 361 361 … … 370 370 else $percentused = ( $used / $space ) * 100; 371 371 372 if ( $space > 1000 ) {372 if ( $space > 1000 ) { 373 373 $space = number_format( $space / 1024 ); 374 374 $space .= __('GB'); … … 408 408 <?php 409 409 } 410 if ( current_user_can('edit_posts') )410 if ( current_user_can('edit_posts') ) 411 411 add_action('activity_box_end', 'dashboard_quota'); 412 412 … … 414 414 function upload_space_setting( $id ) { 415 415 $quota = get_blog_option($id, "blog_upload_space"); 416 if ( !$quota )416 if ( !$quota ) 417 417 $quota = ''; 418 418 … … 431 431 $wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) ); 432 432 433 if ( $refresh == 1 )433 if ( $refresh == 1 ) 434 434 refresh_user_details($id); 435 435 436 if ( $pref == 'spam' ) {437 if ( $value == 1 )436 if ( $pref == 'spam' ) { 437 if ( $value == 1 ) 438 438 do_action( "make_spam_user", $id ); 439 439 else … … 483 483 $size = $size / 1024 / 1024; 484 484 485 if ( ($spaceAllowed - $size) <= 0 ) {485 if ( ($spaceAllowed - $size) <= 0 ) { 486 486 wp_die( __('Sorry, you must delete files before you can upload any more.') ); 487 487 } … … 497 497 498 498 function sync_category_tag_slugs( $term, $taxonomy ) { 499 if ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) {500 if ( is_object( $term ) ) {499 if ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) { 500 if ( is_object( $term ) ) { 501 501 $term->slug = sanitize_title( $term->name ); 502 502 } else { … … 521 521 $blog = get_active_blog_for_user( $current_user->ID ); 522 522 $dashboard_blog = get_dashboard_blog(); 523 if ( is_object( $blog ) ) {523 if ( is_object( $blog ) ) { 524 524 $protocol = ( is_ssl() ? 'https://' : 'http://' ); 525 525 wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case" … … 626 626 $mu_media_buttons = get_site_option( 'mu_media_buttons' ); 627 627 $out = ''; 628 if ( $mu_media_buttons[ 'image' ] ) {628 if ( $mu_media_buttons[ 'image' ] ) { 629 629 $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&type=image"); 630 630 $image_title = __('Add an Image'); 631 631 $out .= "<a href='{$image_upload_iframe_src}&TB_iframe=true' id='add_image' class='thickbox' title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>"; 632 632 } 633 if ( $mu_media_buttons[ 'video' ] ) {633 if ( $mu_media_buttons[ 'video' ] ) { 634 634 $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&type=video"); 635 635 $video_title = __('Add Video'); 636 636 $out .= "<a href='{$video_upload_iframe_src}&TB_iframe=true' id='add_video' class='thickbox' title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>"; 637 637 } 638 if ( $mu_media_buttons[ 'audio' ] ) {638 if ( $mu_media_buttons[ 'audio' ] ) { 639 639 $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&type=audio"); 640 640 $audio_title = __('Add Audio'); … … 649 649 /* Warn the admin if SECRET SALT information is missing from wp-config.php */ 650 650 function secret_salt_warning() { 651 if ( !is_super_admin() )651 if ( !is_super_admin() ) 652 652 return; 653 653 $secret_keys = array( 'NONCE_KEY', 'AUTH_KEY', 'AUTH_SALT', 'LOGGED_IN_KEY', 'LOGGED_IN_SALT', 'SECURE_AUTH_KEY', 'SECURE_AUTH_SALT' ); 654 654 $out = ''; 655 655 foreach( $secret_keys as $key ) { 656 if ( !defined( $key ) )656 if ( !defined( $key ) ) 657 657 $out .= "define( '$key', '" . wp_generate_password() . wp_generate_password() . "' );<br />"; 658 658 } 659 if ( $out != '' ) {659 if ( $out != '' ) { 660 660 $msg = sprintf( __( 'Warning! WordPress encrypts user cookies, but you must add the following lines to <strong>%swp-config.php</strong> for it to be more secure.<br />Please add the code before the line, <code>/* That\'s all, stop editing! Happy blogging. */</code>' ), ABSPATH ); 661 661 $msg .= "<blockquote>$out</blockquote>"; … … 687 687 function admin_notice_feed() { 688 688 global $current_user; 689 if ( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' )689 if ( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' ) 690 690 return; 691 691 692 if ( isset( $_GET[ 'feed_dismiss' ] ) )692 if ( isset( $_GET[ 'feed_dismiss' ] ) ) 693 693 update_user_option( $current_user->id, 'admin_feed_dismiss', $_GET[ 'feed_dismiss' ], true ); 694 694 695 695 $url = get_site_option( 'admin_notice_feed' ); 696 if ( $url == '' )696 if ( $url == '' ) 697 697 return; 698 698 include_once( ABSPATH . 'wp-includes/rss.php' ); 699 699 $rss = @fetch_rss( $url ); 700 if ( isset($rss->items) && 1 <= count($rss->items) ) {701 if ( md5( $rss->items[0][ 'title' ] ) == get_user_option( 'admin_feed_dismiss', $current_user->id ) )700 if ( isset($rss->items) && 1 <= count($rss->items) ) { 701 if ( md5( $rss->items[0][ 'title' ] ) == get_user_option( 'admin_feed_dismiss', $current_user->id ) ) 702 702 return; 703 703 $item = $rss->items[0]; … … 715 715 $msg .= "<p>" . $content . " <a href='$link'>" . __( 'Read More' ) . "</a> <a href='index.php?feed_dismiss=" . md5( $item[ 'title' ] ) . "'>" . __( "Dismiss" ) . "</a></p>"; 716 716 echo "<div class='updated fade'>$msg</div>"; 717 } elseif ( is_super_admin() ) {717 } elseif ( is_super_admin() ) { 718 718 printf("<div id='update-nag'>" . __("Your feed at %s is empty.") . "</div>", wp_specialchars( $url )); 719 719 } … … 723 723 function site_admin_notice() { 724 724 global $current_user, $wp_db_version; 725 if ( !is_super_admin() )725 if ( !is_super_admin() ) 726 726 return false; 727 727 printf("<div id='update-nag'>" . __("Hi %s! You're logged in as a site administrator.") . "</div>", $current_user->user_login); … … 733 733 734 734 function avoid_blog_page_permalink_collision( $data, $postarr ) { 735 if ( is_subdomain_install() )735 if ( is_subdomain_install() ) 736 736 return $data; 737 if ( $data[ 'post_type' ] != 'page' )737 if ( $data[ 'post_type' ] != 'page' ) 738 738 return $data; 739 if ( !isset( $data[ 'post_name' ] ) || $data[ 'post_name' ] == '' )739 if ( !isset( $data[ 'post_name' ] ) || $data[ 'post_name' ] == '' ) 740 740 return $data; 741 if ( !is_main_blog() )741 if ( !is_main_blog() ) 742 742 return $data; 743 743 … … 748 748 $c ++; 749 749 } 750 if ( $post_name != $data[ 'post_name' ] ) {750 if ( $post_name != $data[ 'post_name' ] ) { 751 751 $data[ 'post_name' ] = $post_name; 752 752 } … … 1034 1034 function remove_edit_plugin_link( $action_links, $plugin_file, $plugin_data, $context ) { 1035 1035 foreach( $action_links as $t => $link ) { 1036 if ( !strpos( $link, __( "Open this file in the Plugin Editor" ) ) )1036 if ( !strpos( $link, __( "Open this file in the Plugin Editor" ) ) ) 1037 1037 $links[ $t ] = $link; 1038 1038 } … … 1051 1051 $all_blogs = get_blogs_of_user( $current_user->ID ); 1052 1052 $primary_blog = get_usermeta($current_user->ID, 'primary_blog'); 1053 if ( count( $all_blogs ) > 1 ) {1053 if ( count( $all_blogs ) > 1 ) { 1054 1054 $found = false; 1055 1055 ?> 1056 1056 <select name="primary_blog"> 1057 1057 <?php foreach( (array) $all_blogs as $blog ) { 1058 if ( $primary_blog == $blog->userblog_id )1058 if ( $primary_blog == $blog->userblog_id ) 1059 1059 $found = true; 1060 ?><option value='<?php echo $blog->userblog_id ?>'<?php if ( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php1060 ?><option value='<?php echo $blog->userblog_id ?>'<?php if ( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php 1061 1061 } ?> 1062 1062 </select> 1063 1063 <?php 1064 if ( !$found ) {1064 if ( !$found ) { 1065 1065 $blog = array_shift( $all_blogs ); 1066 1066 update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id ); 1067 1067 } 1068 } elseif ( count( $all_blogs ) == 1 ) {1068 } elseif ( count( $all_blogs ) == 1 ) { 1069 1069 $blog = array_shift( $all_blogs ); 1070 1070 echo $blog->domain; 1071 if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list.1071 if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list. 1072 1072 update_usermeta( $current_user->ID, 'primary_blog', $blog->userblog_id ); 1073 1073 } else { … … 1082 1082 add_action ( 'myblogs_allblogs_options', 'choose_primary_blog' ); 1083 1083 1084 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) {1084 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) { 1085 1085 add_action( 'admin_init', 'update_profile_email' ); 1086 1086 add_action( 'admin_init', 'profile_page_email_warning_ob_start' ); … … 1133 1133 1134 1134 $blogs = get_blogs_of_user( $current_user->ID ); 1135 if ( !$blogs || ( is_array( $blogs ) && empty( $blogs ) ) ) {1135 if ( !$blogs || ( is_array( $blogs ) && empty( $blogs ) ) ) { 1136 1136 wp_die( __( 'You must be a member of at least one blog to use this page.' ) ); 1137 1137 } … … 1141 1141 ?> 1142 1142 <div class="wrap"> 1143 <?php if ( $_GET[ 'updated' ] ) { ?>1143 <?php if ( $_GET[ 'updated' ] ) { ?> 1144 1144 <div id="message" class="updated fade"><p><strong><?php _e( 'Your blog options have been updated.' ); ?></strong></p></div> 1145 1145 <?php } ?> -
trunk/wp-admin/includes/plugin-install.php
r12742 r12752 29 29 function plugins_api($action, $args = null) { 30 30 31 if ( is_array($args) )31 if ( is_array($args) ) 32 32 $args = (object)$args; 33 33 … … 326 326 <tbody class="plugins"> 327 327 <?php 328 if ( empty($plugins) )328 if ( empty($plugins) ) 329 329 echo '<tr><td colspan="5">', __('No plugins match your request.'), '</td></tr>'; 330 330 331 foreach ( (array) $plugins as $plugin ){331 foreach ( (array) $plugins as $plugin ){ 332 332 if ( is_object($plugin) ) 333 333 $plugin = (array) $plugin; … … 350 350 351 351 $author = $plugin['author']; 352 if ( ! empty($plugin['author']) )352 if ( ! empty($plugin['author']) ) 353 353 $author = ' <cite>' . sprintf( __('By %s'), $author ) . '.</cite>'; 354 354 355 355 $author = wp_kses($author, $plugins_allowedtags); 356 356 357 if ( isset($plugin['homepage']) )357 if ( isset($plugin['homepage']) ) 358 358 $title = '<a target="_blank" href="' . esc_attr($plugin['homepage']) . '">' . $title . '</a>'; 359 359 … … 424 424 425 425 $section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English. 426 if ( empty($section) || ! isset($api->sections[ $section ]) )426 if ( empty($section) || ! isset($api->sections[ $section ]) ) 427 427 $section = array_shift( $section_titles = array_keys((array)$api->sections) ); 428 428 -
trunk/wp-admin/includes/plugin.php
r12733 r12752 93 93 94 94 //Translate fields 95 if ( $translate && ! empty($plugin_data['TextDomain']) ) {96 if ( ! empty( $plugin_data['DomainPath'] ) )95 if ( $translate && ! empty($plugin_data['TextDomain']) ) { 96 if ( ! empty( $plugin_data['DomainPath'] ) ) 97 97 load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']); 98 98 else … … 114 114 115 115 $plugin_data['Description'] = wptexturize( $plugin_data['Description'] ); 116 if ( ! empty($plugin_data['Author']) )116 if ( ! empty($plugin_data['Author']) ) 117 117 $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>'; 118 118 } … … 199 199 $wp_plugins = array (); 200 200 $plugin_root = WP_PLUGIN_DIR; 201 if ( !empty($plugin_folder) )201 if ( !empty($plugin_folder) ) 202 202 $plugin_root .= $plugin_folder; 203 203 … … 331 331 foreach ( $plugins as $plugin ) { 332 332 $plugin = plugin_basename($plugin); 333 if ( ! is_plugin_active($plugin) )333 if ( ! is_plugin_active($plugin) ) 334 334 continue; 335 335 if ( ! $silent ) … … 399 399 global $wp_filesystem; 400 400 401 if ( empty($plugins) )401 if ( empty($plugins) ) 402 402 return false; 403 403 … … 411 411 $data = ob_get_contents(); 412 412 ob_end_clean(); 413 if ( ! empty($data) ){413 if ( ! empty($data) ){ 414 414 include_once( ABSPATH . 'wp-admin/admin-header.php'); 415 415 echo $data; … … 424 424 $data = ob_get_contents(); 425 425 ob_end_clean(); 426 if ( ! empty($data) ){426 if ( ! empty($data) ){ 427 427 include_once( ABSPATH . 'wp-admin/admin-header.php'); 428 428 echo $data; … … 1065 1065 */ 1066 1066 function add_option_whitelist( $new_options, $options = '' ) { 1067 if ( $options == '' ) {1067 if ( $options == '' ) { 1068 1068 global $whitelist_options; 1069 1069 } else { … … 1095 1095 */ 1096 1096 function remove_option_whitelist( $del_options, $options = '' ) { 1097 if ( $options == '' ) {1097 if ( $options == '' ) { 1098 1098 global $whitelist_options; 1099 1099 } else { … … 1104 1104 if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) { 1105 1105 $pos = array_search( $key, $whitelist_options[ $page ] ); 1106 if ( $pos !== false )1106 if ( $pos !== false ) 1107 1107 unset( $whitelist_options[ $page ][ $pos ] ); 1108 1108 } -
trunk/wp-admin/includes/post.php
r12733 r12752 536 536 function write_post() { 537 537 $result = wp_write_post(); 538 if ( is_wp_error( $result ) )538 if ( is_wp_error( $result ) ) 539 539 wp_die( $result->get_error_message() ); 540 540 else -
trunk/wp-admin/includes/template.php
r12728 r12752 1308 1308 <div class="post_password">' . esc_html( $post->post_password ) . '</div>'; 1309 1309 1310 if ( $post->post_type == 'page' )1310 if ( $post->post_type == 'page' ) 1311 1311 echo ' 1312 1312 <div class="post_parent">' . $post->post_parent . '</div> … … 1314 1314 <div class="menu_order">' . $post->menu_order . '</div>'; 1315 1315 1316 if ( $post->post_type == 'post' )1316 if ( $post->post_type == 'post' ) 1317 1317 echo ' 1318 1318 <div class="tags_input">' . esc_html( str_replace( ',', ', ', get_tags_to_edit($post->ID) ) ) . '</div> -
trunk/wp-admin/includes/theme.php
r12733 r12752 66 66 $data = ob_get_contents(); 67 67 ob_end_clean(); 68 if ( ! empty($data) ){68 if ( ! empty($data) ) { 69 69 include_once( ABSPATH . 'wp-admin/admin-header.php'); 70 70 echo $data; -
trunk/wp-admin/includes/update.php
r12726 r12752 83 83 84 84 function core_update_footer( $msg = '' ) { 85 if ( is_multisite() && !is_super_admin() )85 if ( is_multisite() && !is_super_admin() ) 86 86 return false; 87 87 … … 119 119 120 120 function update_nag() { 121 if ( is_multisite() && !is_super_admin() )121 if ( is_multisite() && !is_super_admin() ) 122 122 return false; 123 123 … … 143 143 // Called directly from dashboard 144 144 function update_right_now_message() { 145 if ( is_multisite() && !is_super_admin() )145 if ( is_multisite() && !is_super_admin() ) 146 146 return false; 147 147 … … 206 206 207 207 function wp_update_plugin($plugin, $feedback = '') { 208 if ( is_multisite() && !is_super_admin() )208 if ( is_multisite() && !is_super_admin() ) 209 209 return false; 210 210 -
trunk/wp-admin/includes/upgrade.php
r12584 r12752 268 268 return; 269 269 270 if ( ! is_blog_installed() )270 if ( ! is_blog_installed() ) 271 271 return; 272 272 … … 632 632 // populate comment_count field of posts table 633 633 $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" ); 634 if ( is_array( $comments ) )634 if ( is_array( $comments ) ) 635 635 foreach ($comments as $comment) 636 636 $wpdb->update( $wpdb->posts, array('comment_count' => $comment->c), array('ID' => $comment->comment_post_ID) ); … … 1200 1200 1201 1201 // Separate individual queries into an array 1202 if ( !is_array($queries) ) {1202 if ( !is_array($queries) ) { 1203 1203 $queries = explode( ';', $queries ); 1204 if ('' == $queries[count($queries) - 1]) array_pop($queries);1204 if ('' == $queries[count($queries) - 1]) array_pop($queries); 1205 1205 } 1206 1206 … … 1211 1211 // Create a tablename index for an array ($cqueries) of queries 1212 1212 foreach($queries as $qry) { 1213 if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {1213 if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) { 1214 1214 $cqueries[trim( strtolower($matches[1]), '`' )] = $qry; 1215 1215 $for_update[$matches[1]] = 'Created table '.$matches[1]; 1216 } 1217 else if(preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) { 1216 } else if (preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) { 1218 1217 array_unshift($cqueries, $qry); 1219 } 1220 else if(preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) { 1218 } else if (preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) { 1221 1219 $iqueries[] = $qry; 1222 } 1223 else if(preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) { 1220 } else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) { 1224 1221 $iqueries[] = $qry; 1225 } 1226 else { 1222 } else { 1227 1223 // Unrecognized query type 1228 1224 } … … 1230 1226 1231 1227 // Check to see which tables and fields exist 1232 if ($tables = $wpdb->get_col('SHOW TABLES;')) {1228 if ($tables = $wpdb->get_col('SHOW TABLES;')) { 1233 1229 // For every table in the database 1234 foreach ($tables as $table) {1230 foreach ($tables as $table) { 1235 1231 // If a table query exists for the database table... 1236 if ( array_key_exists(strtolower($table), $cqueries) ) {1232 if ( array_key_exists(strtolower($table), $cqueries) ) { 1237 1233 // Clear the field and index arrays 1238 1234 unset($cfields); … … 1248 1244 1249 1245 // For every field line specified in the query 1250 foreach ($flds as $fld) {1246 foreach ($flds as $fld) { 1251 1247 // Extract the field name 1252 1248 preg_match("|^([^ ]*)|", trim($fld), $fvals); … … 1255 1251 // Verify the found field name 1256 1252 $validfield = true; 1257 switch(strtolower($fieldname)) 1258 { 1253 switch (strtolower($fieldname)) { 1259 1254 case '': 1260 1255 case 'primary': … … 1270 1265 1271 1266 // If it's a valid field, add it to the field array 1272 if ($validfield) {1267 if ($validfield) { 1273 1268 $cfields[strtolower($fieldname)] = trim($fld, ", \n"); 1274 1269 } … … 1279 1274 1280 1275 // For every field in the table 1281 foreach ($tablefields as $tablefield) {1276 foreach ($tablefields as $tablefield) { 1282 1277 // If the table field exists in the field array... 1283 if (array_key_exists(strtolower($tablefield->Field), $cfields)) {1278 if (array_key_exists(strtolower($tablefield->Field), $cfields)) { 1284 1279 // Get the field type from the query 1285 1280 preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches); … … 1287 1282 1288 1283 // Is actual field type different from the field type in query? 1289 if ($tablefield->Type != $fieldtype) {1284 if ($tablefield->Type != $fieldtype) { 1290 1285 // Add a query to change the column type 1291 1286 $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)]; … … 1295 1290 // Get the default value from the array 1296 1291 //echo "{$cfields[strtolower($tablefield->Field)]}<br>"; 1297 if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {1292 if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) { 1298 1293 $default_value = $matches[1]; 1299 if($tablefield->Default != $default_value) 1300 { 1294 if ($tablefield->Default != $default_value) { 1301 1295 // Add a query to change the column's default value 1302 1296 $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'"; … … 1307 1301 // Remove the field from the array (so it's not added) 1308 1302 unset($cfields[strtolower($tablefield->Field)]); 1309 } 1310 else { 1303 } else { 1311 1304 // This field exists in the table, but not in the creation queries? 1312 1305 } … … 1314 1307 1315 1308 // For every remaining field specified for the table 1316 foreach ($cfields as $fieldname => $fielddef) {1309 foreach ($cfields as $fieldname => $fielddef) { 1317 1310 // Push a query line into $cqueries that adds the field to that table 1318 1311 $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef"; … … 1324 1317 $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};"); 1325 1318 1326 if ($tableindices) {1319 if ($tableindices) { 1327 1320 // Clear the index array 1328 1321 unset($index_ary); 1329 1322 1330 1323 // For every index in the table 1331 foreach ($tableindices as $tableindex) {1324 foreach ($tableindices as $tableindex) { 1332 1325 // Add the index to the index data array 1333 1326 $keyname = $tableindex->Key_name; … … 1337 1330 1338 1331 // For each actual index in the index array 1339 foreach ($index_ary as $index_name => $index_data) {1332 foreach ($index_ary as $index_name => $index_data) { 1340 1333 // Build a create string to compare to the query 1341 1334 $index_string = ''; 1342 if ($index_name == 'PRIMARY') {1335 if ($index_name == 'PRIMARY') { 1343 1336 $index_string .= 'PRIMARY '; 1344 } 1345 else if($index_data['unique']) { 1337 } else if($index_data['unique']) { 1346 1338 $index_string .= 'UNIQUE '; 1347 1339 } 1348 1340 $index_string .= 'KEY '; 1349 if ($index_name != 'PRIMARY') {1341 if ($index_name != 'PRIMARY') { 1350 1342 $index_string .= $index_name; 1351 1343 } 1352 1344 $index_columns = ''; 1353 1345 // For each column in the index 1354 foreach ($index_data['columns'] as $column_data) {1355 if ($index_columns != '') $index_columns .= ',';1346 foreach ($index_data['columns'] as $column_data) { 1347 if ($index_columns != '') $index_columns .= ','; 1356 1348 // Add the field to the column list string 1357 1349 $index_columns .= $column_data['fieldname']; 1358 if ($column_data['subpart'] != '') {1350 if ($column_data['subpart'] != '') { 1359 1351 $index_columns .= '('.$column_data['subpart'].')'; 1360 1352 } … … 1362 1354 // Add the column list to the index create string 1363 1355 $index_string .= ' ('.$index_columns.')'; 1364 if (!(($aindex = array_search($index_string, $indices)) === false)) {1356 if (!(($aindex = array_search($index_string, $indices)) === false)) { 1365 1357 unset($indices[$aindex]); 1366 1358 //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n"; … … 1387 1379 1388 1380 $allqueries = array_merge($cqueries, $iqueries); 1389 if ($execute) {1390 foreach ($allqueries as $query) {1381 if ($execute) { 1382 foreach ($allqueries as $query) { 1391 1383 //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">".print_r($query, true)."</pre>\n"; 1392 1384 $wpdb->query($query); -
trunk/wp-admin/ms-edit.php
r12736 r12752 205 205 206 206 if ( $_POST['update_home_url'] == 'update' ) { 207 if ( get_option( 'siteurl' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] )207 if ( get_option( 'siteurl' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) 208 208 update_option( 'siteurl', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); 209 209 210 if ( get_option( 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] )210 if ( get_option( 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) 211 211 update_option( 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); 212 212 } … … 246 246 247 247 // remove user 248 if ( is_array( $_POST[ 'blogusers' ] ) ) {248 if ( is_array( $_POST[ 'blogusers' ] ) ) { 249 249 reset( $_POST[ 'blogusers' ] ); 250 250 foreach ( (array) $_POST[ 'blogusers' ] as $key => $val ) -
trunk/wp-admin/ms-options.php
r12674 r12752 47 47 <th scope="row"><?php _e('Allow new registrations') ?></th> 48 48 <?php 49 if ( !get_site_option('registration') )49 if ( !get_site_option('registration') ) 50 50 update_site_option( 'registration', 'all' ); 51 51 ?> … … 56 56 <label><input name="registration" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked="checked"' : ''; ?> /> <?php _e('Only logged in users can create new blogs.'); ?></label><br /> 57 57 <p><?php _e('Disable or enable registration and who or what can be registered. (Default=all)'); ?></p> 58 <?php if ( is_subdomain_install() ) {58 <?php if ( is_subdomain_install() ) { 59 59 echo "<p>" . __('If registration is disabled, please set "NOBLOGREDIRECT" in wp-config.php to a url you will redirect visitors to if they visit a non existant blog.') . "</p>"; 60 60 } ?> … … 65 65 <th scope="row"><?php _e('Registration notification') ?></th> 66 66 <?php 67 if ( !get_site_option('registrationnotification') )67 if ( !get_site_option('registrationnotification') ) 68 68 update_site_option( 'registrationnotification', 'yes' ); 69 69 ?> … … 202 202 <th scope="row"><?php _e('Upload media button') ?></th> 203 203 <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?> 204 <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1' <?php if ( $mu_media_buttons[ 'image' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Images' ); ?></label><br />205 <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1' <?php if ( $mu_media_buttons[ 'video' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Videos' ); ?></label><br />206 <label><input type='checkbox' id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value='1' <?php if ( $mu_media_buttons[ 'audio' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Music' ); ?></label><br />204 <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1' <?php if ( $mu_media_buttons[ 'image' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Images' ); ?></label><br /> 205 <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1' <?php if ( $mu_media_buttons[ 'video' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Videos' ); ?></label><br /> 206 <label><input type='checkbox' id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value='1' <?php if ( $mu_media_buttons[ 'audio' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Music' ); ?></label><br /> 207 207 <?php _e( 'The media upload buttons to display on the "Write Post" page. Make sure you update the "Upload File Types" below as well.' ); ?></td> 208 208 </tr> … … 210 210 <th scope="row"><?php _e('Blog upload space check') ?></th> 211 211 <td> 212 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0' <?php if ( !get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Enabled' ); ?></label><br />213 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='1' <?php if ( get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Disabled' ); ?></label><br />212 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0' <?php if ( !get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Enabled' ); ?></label><br /> 213 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='1' <?php if ( get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Disabled' ); ?></label><br /> 214 214 <?php _e( 'By default there is a limit on the total size of files uploaded but it can be disabled here.' ); ?></td> 215 215 </tr> … … 232 232 <td><input name="admin_notice_feed" style="width: 95%" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br /> 233 233 <?php _e( 'Display the latest post from this RSS or Atom feed on all blog dashboards. Leave blank to disable.' ); ?><br /> 234 <?php if ( get_site_option( 'admin_notice_feed' ) != 'http://' . $current_site->domain . $current_site->path . 'feed/' )234 <?php if ( get_site_option( 'admin_notice_feed' ) != 'http://' . $current_site->domain . $current_site->path . 'feed/' ) 235 235 echo __( "A good one to use would be the feed from your main blog: " ) . 'http://' . $current_site->domain . $current_site->path . 'feed/'; ?></td> 236 236 </tr> … … 252 252 <table class="form-table"> 253 253 <?php 254 if ( is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) )254 if ( is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) ) 255 255 while( ( $lang_file = readdir( $dh ) ) !== false ) 256 if ( substr( $lang_file, -3 ) == '.mo' )256 if ( substr( $lang_file, -3 ) == '.mo' ) 257 257 $lang_files[] = $lang_file; 258 258 $lang = get_site_option('WPLANG'); 259 if ( is_array($lang_files) && !empty($lang_files) ) {259 if ( is_array($lang_files) && !empty($lang_files) ) { 260 260 ?> 261 261 <tr valign="top"> -
trunk/wp-admin/ms-sites.php
r12733 r12752 96 96 <th scope="row"><?php _e('Path') ?></th> 97 97 <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details['path']) ?>" size="40" style='margin-bottom:5px;' /> 98 <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if ( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>98 <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if ( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td> 99 99 </tr> 100 100 <tr class="form-field"> … … 109 109 <th scope="row"><?php _e('Public') ?></th> 110 110 <td> 111 <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if ( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>112 <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if ( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>111 <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if ( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 112 <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if ( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 113 113 </td> 114 114 </tr> … … 116 116 <th scope="row"><?php _e( 'Archived' ); ?></th> 117 117 <td> 118 <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if ( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>119 <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if ( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>118 <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if ( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 119 <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if ( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 120 120 </td> 121 121 </tr> … … 123 123 <th scope="row"><?php _e( 'Mature' ); ?></th> 124 124 <td> 125 <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if ( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>126 <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if ( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>125 <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if ( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 126 <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if ( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 127 127 </td> 128 128 </tr> … … 130 130 <th scope="row"><?php _e( 'Spam' ); ?></th> 131 131 <td> 132 <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if ( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>133 <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if ( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>132 <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if ( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 133 <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if ( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 134 134 </td> 135 135 </tr> … … 137 137 <th scope="row"><?php _e( 'Deleted' ); ?></th> 138 138 <td> 139 <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if ( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>140 <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if ( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>139 <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if ( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?> 140 <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if ( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?> 141 141 </td> 142 142 </tr> … … 152 152 $editblog_default_role = 'subscriber'; 153 153 foreach ( $options as $key => $val ) { 154 if ( $val['option_name'] == 'default_role' ) {154 if ( $val['option_name'] == 'default_role' ) { 155 155 $editblog_default_role = $val['option_value']; 156 156 } … … 192 192 $blog_allowed_themes = wpmu_get_blog_allowedthemes( $id ); 193 193 $allowed_themes = get_site_option( "allowedthemes" ); 194 if ( $allowed_themes == false ) {194 if ( $allowed_themes == false ) { 195 195 $allowed_themes = array_keys( $themes ); 196 196 } … … 198 198 foreach( $themes as $key => $theme ) { 199 199 $theme_key = wp_specialchars( $theme['Stylesheet'] ); 200 if ( isset($allowed_themes[$theme_key] ) == false ) {200 if ( isset($allowed_themes[$theme_key] ) == false ) { 201 201 $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : ''; 202 202 $out .= '<tr class="form-field form-required"> … … 223 223 // Blog users 224 224 $blogusers = get_users_of_blog( $id ); 225 if ( is_array( $blogusers ) ) {225 if ( is_array( $blogusers ) ) { 226 226 echo '<div id="blogedit_blogusers" class="postbox"><h3 class="hndle"><span>' . __('Blog Users') . '</span></h3><div class="inside">'; 227 227 echo '<table class="form-table">'; … … 230 230 foreach ( (array) $blogusers as $key => $val ) { 231 231 $t = @unserialize( $val->meta_value ); 232 if ( is_array( $t ) ) {232 if ( is_array( $t ) ) { 233 233 reset( $t ); 234 234 $existing_role = key( $t ); 235 235 } 236 236 echo '<tr><td><a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a></td>'; 237 if ( $val->user_id != $current_user->data->ID ) {237 if ( $val->user_id != $current_user->data->ID ) { 238 238 ?> 239 239 <td> … … 317 317 $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "; 318 318 319 if ( isset($_GET['blog_name']) ) {319 if ( isset($_GET['blog_name']) ) { 320 320 $query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) "; 321 } elseif ( isset($_GET['blog_id']) ) {321 } elseif ( isset($_GET['blog_id']) ) { 322 322 $query .= " AND blog_id = '". absint( $_GET['blog_id'] )."' "; 323 } elseif ( isset($_GET['blog_ip']) ) {323 } elseif ( isset($_GET['blog_ip']) ) { 324 324 $query = "SELECT * 325 325 FROM {$wpdb->blogs}, {$wpdb->registration_log} … … 329 329 } 330 330 331 if ( isset( $_GET['sortby'] ) == false ) {331 if ( isset( $_GET['sortby'] ) == false ) { 332 332 $_GET['sortby'] = 'id'; 333 333 } 334 334 335 if ( $_GET['sortby'] == 'registered' ) {335 if ( $_GET['sortby'] == 'registered' ) { 336 336 $query .= ' ORDER BY registered '; 337 } elseif ( $_GET['sortby'] == 'id' ) {337 } elseif ( $_GET['sortby'] == 'id' ) { 338 338 $query .= ' ORDER BY ' . $wpdb->blogs . '.blog_id '; 339 } elseif ( $_GET['sortby'] == 'lastupdated' ) {339 } elseif ( $_GET['sortby'] == 'lastupdated' ) { 340 340 $query .= ' ORDER BY last_updated '; 341 } elseif ( $_GET['sortby'] == 'blogname' ) {341 } elseif ( $_GET['sortby'] == 'blogname' ) { 342 342 $query .= ' ORDER BY domain '; 343 343 } … … 345 345 $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; 346 346 347 if ( !empty($s) ) {347 if ( !empty($s) ) { 348 348 $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) ); 349 349 } else { … … 356 356 // Pagination 357 357 $url2 = "&order=" . $_GET['order'] . "&sortby=" . $_GET['sortby'] . "&s="; 358 if ( $_GET[ 'blog_ip' ] ) {358 if ( $_GET[ 'blog_ip' ] ) { 359 359 $url2 .= "&ip_address=" . urlencode( $s ); 360 360 } else { … … 396 396 <br class="clear" /> 397 397 398 <?php if ( isset($_GET['s']) && !empty($_GET['s']) ) : ?>398 <?php if ( isset($_GET['s']) && !empty($_GET['s']) ) : ?> 399 399 <p><a href="ms-users.php?action=users&s=<?php echo urlencode( stripslashes( $s ) ) ?>"><?php _e('Search Users:') ?> <strong><?php echo stripslashes( $s ); ?></strong></a></p> 400 400 <?php endif; ?> … … 411 411 ); 412 412 413 if ( has_filter( 'wpmublogsaction' ) )413 if ( has_filter( 'wpmublogsaction' ) ) 414 414 $posts_columns['plugins'] = __('Actions'); 415 415 … … 417 417 418 418 $sortby_url = "s="; 419 if ( $_GET[ 'blog_ip' ] ) {419 if ( $_GET[ 'blog_ip' ] ) { 420 420 $sortby_url .= "&ip_address=" . urlencode( $s ); 421 421 } else { … … 430 430 <?php foreach($posts_columns as $column_id => $column_display_name) { 431 431 $column_link = "<a href='ms-sites.php?{$sortby_url}&sortby={$column_id}&"; 432 if ( $_GET['sortby'] == $column_id ) {432 if ( $_GET['sortby'] == $column_id ) { 433 433 $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&' : 'order=DESC&'; 434 434 } … … 452 452 $bgcolour = ""; 453 453 foreach ( $status_list as $status => $col ) { 454 if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {454 if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) { 455 455 $bgcolour = "style='background: $col'"; 456 456 } … … 480 480 $controlActions[] = "<a href='{$protocol}{$blog['domain']}{$blog['path']}wp-admin/' class='edit'>" . __('Backend') . '</a>'; 481 481 482 if ( get_blog_status( $blog['blog_id'], "deleted" ) == '1' )482 if ( get_blog_status( $blog['blog_id'], "deleted" ) == '1' ) 483 483 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=activateblog&ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) . '">' . __('Activate') . '</a>'; 484 484 else 485 485 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=deactivateblog&ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to deactivate the blog %s" ), $blogname ) ) . '">' . __('Deactivate') . '</a>'; 486 486 487 if ( get_blog_status( $blog['blog_id'], "archived" ) == '1' )487 if ( get_blog_status( $blog['blog_id'], "archived" ) == '1' ) 488 488 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to unarchive the blog %s" ), $blogname ) ) . '">' . __('Unarchive') . '</a>'; 489 489 else 490 490 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to archive the blog %s" ), $blogname ) ) . '">' . __('Archive') . '</a>'; 491 491 492 if ( get_blog_status( $blog['blog_id'], "spam" ) == '1' )492 if ( get_blog_status( $blog['blog_id'], "spam" ) == '1' ) 493 493 $controlActions[] = '<a class="delete" href="ms-edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( "You are about to unspam the blog %s" ), $blogname ) ) . '">' . __('Not Spam') . '</a>'; 494 494 else … … 535 535 echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />'; 536 536 } 537 if ( $blogusers_warning != '' ) {537 if ( $blogusers_warning != '' ) { 538 538 echo '<strong>' . $blogusers_warning . '</strong><br />'; 539 539 } … … 545 545 546 546 case 'plugins': ?> 547 <?php if ( has_filter( 'wpmublogsaction' ) ) { ?>547 <?php if ( has_filter( 'wpmublogsaction' ) ) { ?> 548 548 <td valign="top"> 549 549 <?php do_action( "wpmublogsaction", $blog['blog_id'] ); ?> … … 553 553 554 554 default: ?> 555 <?php if ( has_filter( 'manage_blogs_custom_column' ) ) { ?>555 <?php if ( has_filter( 'manage_blogs_custom_column' ) ) { ?> 556 556 <td valign="top"> 557 557 <?php do_action('manage_blogs_custom_column', $column_name, $blog['blog_id']); ?> -
trunk/wp-admin/ms-upgrade-site.php
r12646 r12752 26 26 27 27 $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A ); 28 if ( is_array( $blogs ) ) {28 if ( is_array( $blogs ) ) { 29 29 echo "<ul>"; 30 30 foreach( (array) $blogs as $details ) { 31 if ( $details['spam'] == 0 && $details['deleted'] == 0 && $details['archived'] == 0 ) {31 if ( $details['spam'] == 0 && $details['deleted'] == 0 && $details['archived'] == 0 ) { 32 32 $siteurl = $wpdb->get_var("SELECT option_value from {$wpdb->base_prefix}{$details['blog_id']}_options WHERE option_name = 'siteurl'"); 33 33 echo "<li>$siteurl</li>"; 34 34 $response = wp_remote_get( trailingslashit( $siteurl ) . "wp-admin/upgrade.php?step=1", array( 'timeout' => 120, 'httpversion' => '1.1' ) ); 35 if ( is_wp_error( $response ) ) {35 if ( is_wp_error( $response ) ) { 36 36 wp_die( "<strong>Warning!</strong> Problem upgrading {$siteurl}. Your server may not be able to connect to blogs running on it.<br /> Error message: <em>" . $response->get_error_message() ."</em>" ); 37 37 } -
trunk/wp-admin/ms-users.php
r12725 r12752 50 50 $query = "SELECT * FROM {$wpdb->users}"; 51 51 52 if ( !empty( $s ) ) {52 if ( !empty( $s ) ) { 53 53 $search = '%' . trim( $s ) . '%'; 54 54 $query .= " WHERE user_login LIKE '$search' OR user_email LIKE '$search'"; 55 55 } 56 56 57 if ( !isset($_GET['sortby']) ) {57 if ( !isset($_GET['sortby']) ) { 58 58 $_GET['sortby'] = 'id'; 59 59 } 60 60 61 if ( $_GET['sortby'] == 'email' ) {61 if ( $_GET['sortby'] == 'email' ) { 62 62 $query .= ' ORDER BY user_email '; 63 } elseif ( $_GET['sortby'] == 'id' ) {63 } elseif ( $_GET['sortby'] == 'id' ) { 64 64 $query .= ' ORDER BY ID '; 65 } elseif ( $_GET['sortby'] == 'login' ) {65 } elseif ( $_GET['sortby'] == 'login' ) { 66 66 $query .= ' ORDER BY user_login '; 67 } elseif ( $_GET['sortby'] == 'name' ) {67 } elseif ( $_GET['sortby'] == 'name' ) { 68 68 $query .= ' ORDER BY display_name '; 69 } elseif ( $_GET['sortby'] == 'registered' ) {69 } elseif ( $_GET['sortby'] == 'registered' ) { 70 70 $query .= ' ORDER BY user_registered '; 71 71 } … … 73 73 $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; 74 74 75 if ( !empty( $s )) {75 if ( !empty( $s )) { 76 76 $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(ID)', $query) ); 77 77 } else { … … 124 124 </div> 125 125 126 <?php if ( isset($_GET['s']) && $_GET['s'] != '' ) : ?>126 <?php if ( isset($_GET['s']) && $_GET['s'] != '' ) : ?> 127 127 <p><a href="ms-sites.php?action=blogs&s=<?php echo urlencode( stripslashes( $s ) ); ?>&blog_name=Search+blogs+by+name"><?php _e('Search Blogs for') ?> <strong><?php echo stripslashes( $s ) ?></strong></a></p> 128 128 <?php endif; ?> … … 144 144 <tr> 145 145 <?php foreach( (array) $posts_columns as $column_id => $column_display_name) { 146 if ( $column_id == 'blogs' ) {146 if ( $column_id == 'blogs' ) { 147 147 echo '<th scope="col">'.__('Blogs').'</th>'; 148 } elseif ( $column_id == 'checkbox') {148 } elseif ( $column_id == 'checkbox') { 149 149 echo '<th scope="col" class="check-column"><input type="checkbox" /></th>'; 150 150 } else { ?> 151 <th scope="col"><a href="ms-users.php?sortby=<?php echo $column_id ?>&<?php if ( $_GET['sortby'] == $column_id ) { if( $_GET['order'] == 'DESC' ) { echo "order=ASC&" ; } else { echo "order=DESC&"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a></th>151 <th scope="col"><a href="ms-users.php?sortby=<?php echo $column_id ?>&<?php if ( $_GET['sortby'] == $column_id ) { if ( $_GET['order'] == 'DESC' ) { echo "order=ASC&" ; } else { echo "order=DESC&"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a></th> 152 152 <?php } ?> 153 153 <?php } ?> … … 164 164 $bgcolour = ""; 165 165 foreach ( $status_list as $status => $col ) { 166 if ( $user[$status] ) {166 if ( $user[$status] ) { 167 167 $bgcolour = "style='background: $col'"; 168 168 } … … 217 217 <td> 218 218 <?php 219 if ( is_array( $blogs ) ) {219 if ( is_array( $blogs ) ) { 220 220 foreach ( (array) $blogs as $key => $val ) { 221 221 $path = ($val->path == '/') ? '' : $val->path; … … 228 228 // View 229 229 echo '<a '; 230 if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )230 if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 ) 231 231 echo 'style="background-color: #f66" '; 232 232 echo 'target="_new" href="http://'.$val->domain . $val->path.'">' . __('View') . '</a>'; … … 276 276 277 277 <?php 278 if ( apply_filters('show_adduser_fields', true) ) :278 if ( apply_filters('show_adduser_fields', true) ) : 279 279 ?> 280 280 <div class="wrap"> -
trunk/wp-admin/options-general.php
r12733 r12752 295 295 if ( is_multisite() && is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) ) 296 296 while( ( $lang_file = readdir( $dh ) ) !== false ) 297 if ( substr( $lang_file, -3 ) == '.mo' )297 if ( substr( $lang_file, -3 ) == '.mo' ) 298 298 $lang_files[] = $lang_file; 299 299 $lang = get_option('WPLANG'); 300 300 301 if ( is_array($lang_files) && !empty($lang_files) ) {301 if ( is_array($lang_files) && !empty($lang_files) ) { 302 302 ?> 303 303 <tr valign="top"> -
trunk/wp-admin/options.php
r12733 r12752 41 41 if ( is_multisite() && is_super_admin() && $_GET[ 'adminhash' ] ) { 42 42 $new_admin_details = get_option( 'adminhash' ); 43 if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) {43 if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) { 44 44 update_option( "admin_email", $new_admin_details[ 'newemail' ] ); 45 45 delete_option( "adminhash" ); … … 131 131 $disabled = ''; 132 132 $option->option_name = esc_attr($option->option_name); 133 if ( $option->option_name == '' )133 if ( $option->option_name == '' ) 134 134 continue; 135 135 if ( is_serialized($option->option_value) ) { -
trunk/wp-admin/plugin-install.php
r12728 r12752 37 37 38 38 //If a non-valid menu tab has been selected, And its not a non-menu action. 39 if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {39 if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) { 40 40 $tab_actions = array_keys($tabs); 41 41 $tab = $tab_actions[0]; 42 42 } 43 if ( empty($paged) )43 if ( empty($paged) ) 44 44 $paged = 1; 45 45 -
trunk/wp-admin/plugins.php
r12728 r12752 166 166 if ( '.' == dirname($plugin) ) { 167 167 $files_to_delete[] = WP_PLUGIN_DIR . '/' . $plugin; 168 if ( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) )168 if ( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) ) 169 169 $plugin_info[ $plugin ] = $data; 170 170 } else { 171 171 //Locate all the files in that folder: 172 172 $files = list_files( WP_PLUGIN_DIR . '/' . dirname($plugin) ); 173 if ( $files ) {173 if ( $files ) { 174 174 $files_to_delete = array_merge($files_to_delete, $files); 175 175 } … … 506 506 </select> 507 507 <input type="submit" name="doaction_active" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary action" /> 508 <?php if ( 'recent' == $context ) : ?>508 <?php if ( 'recent' == $context ) : ?> 509 509 <input type="submit" name="clear-recent-list" value="<?php esc_attr_e('Clear List') ?>" class="button-secondary" /> 510 510 <?php endif; ?> -
trunk/wp-admin/press-this.php
r12733 r12752 39 39 40 40 $upload = false; 41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) {41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { 42 42 foreach( (array) $_POST['photo_src'] as $key => $image) { 43 43 // see if files exist in content - we don't want to upload non-used selected files. … … 47 47 48 48 // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes 49 if ( !is_wp_error($upload) )49 if ( !is_wp_error($upload) ) 50 50 $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); 51 51 } … … 185 185 function get_images_from_uri($uri) { 186 186 $uri = preg_replace('/\/#.+?$/','', $uri); 187 if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )187 if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') ) 188 188 return "'" . esc_attr( html_entity_decode($uri) ) . "'"; 189 189 $content = wp_remote_fopen($uri); … … 199 199 foreach ($matches[3] as $src) { 200 200 // if no http in url 201 if (strpos($src, 'http') === false)201 if (strpos($src, 'http') === false) 202 202 // if it doesn't have a relative uri 203 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0)203 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) 204 204 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); 205 205 else … … 554 554 <a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="images/media-button-video.gif"/></a> 555 555 </li> 556 <?php if ( user_can_richedit() ) { ?>556 <?php if ( user_can_richedit() ) { ?> 557 557 <li id="switcher"> 558 558 <?php wp_print_scripts( 'quicktags' ); ?> -
trunk/wp-admin/theme-editor.php
r12733 r12752 159 159 // If we have two files of the same name prefer the one in the Template Directory 160 160 // This means that we display the correct files for child themes which overload Templates as well as Styles 161 if ( array_key_exists($description, $template_mapping ) ) {161 if ( array_key_exists($description, $template_mapping ) ) { 162 162 if ( false !== strpos( $template_file, $template_dir ) ) { 163 163 $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc ); -
trunk/wp-admin/theme-install.php
r12728 r12752 42 42 43 43 //If a non-valid menu tab has been selected, And its not a non-menu action. 44 if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) {44 if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) { 45 45 $tab_actions = array_keys($tabs); 46 46 $tab = $tab_actions[0]; 47 47 } 48 if ( empty($paged) )48 if ( empty($paged) ) 49 49 $paged = 1; 50 50 -
trunk/wp-admin/themes.php
r12743 r12752 17 17 $ct = current_theme_info(); 18 18 $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() ); 19 if ( $allowed_themes == false )19 if ( $allowed_themes == false ) 20 20 $allowed_themes = array(); 21 21 22 22 $blog_allowed_themes = wpmu_get_blog_allowedthemes(); 23 if ( is_array( $blog_allowed_themes ) )23 if ( is_array( $blog_allowed_themes ) ) 24 24 $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes ); 25 if ( $blog_id != 1 )25 if ( $blog_id != 1 ) 26 26 unset( $allowed_themes[ "h3" ] ); 27 27 28 if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false )28 if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false ) 29 29 $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true; 30 30 31 31 reset( $themes ); 32 foreach ( $themes as $key => $theme ) {33 if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) {32 foreach ( $themes as $key => $theme ) { 33 if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) { 34 34 unset( $themes[ $key ] ); 35 35 } … … 68 68 69 69 require_once('admin-header.php'); 70 if ( is_multisite() && is_super_admin() ) {70 if ( is_multisite() && is_super_admin() ) { 71 71 ?><div id="message0" class="updated fade"><p><?php _e('Administrator: new themes must be activated in the <a href="wpmu-themes.php">Themes Admin</a> page before they appear here.'); ?></p></div><?php 72 72 } -
trunk/wp-admin/update.php
r12383 r12752 41 41 42 42 check_admin_referer('activate-plugin_' . $plugin); 43 if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {43 if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { 44 44 wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); 45 45 activate_plugin($plugin); … … 48 48 } 49 49 iframe_header( __('Plugin Reactivation'), true ); 50 if ( isset($_GET['success']) )50 if ( isset($_GET['success']) ) 51 51 echo '<p>' . __('Plugin reactivated successfully.') . '</p>'; 52 52 53 if ( isset($_GET['failure']) ){53 if ( isset($_GET['failure']) ){ 54 54 echo '<p>' . __('Plugin failed to reactivate due to a fatal error.') . '</p>'; 55 55 -
trunk/wp-admin/upgrade.php
r12744 r12752 86 86 $backto = esc_url_raw( $backto ); 87 87 $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/'); 88 if ( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) ) {88 if ( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) ) { 89 89 $wpdb->query( "UPDATE {$wpdb->blog_versions} SET db_version = '{$wp_db_version}' WHERE blog_id = '{$wpdb->blogid}'" ); 90 90 } else { -
trunk/wp-admin/user-edit.php
r12733 r12752 93 93 $delete_role = false; 94 94 $blog_prefix = $wpdb->get_blog_prefix(); 95 if ( $user_id != $current_user->ID ) {95 if ( $user_id != $current_user->ID ) { 96 96 $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'" ); 97 if ( null == $cap && $_POST[ 'role' ] == '' ) {97 if ( null == $cap && $_POST[ 'role' ] == '' ) { 98 98 $_POST[ 'role' ] = 'contributor'; 99 99 $delete_role = true; … … 102 102 if ( !isset( $errors ) || ( isset( $errors ) && is_object( $errors ) && false == $errors->get_error_codes() ) ) 103 103 $errors = edit_user($user_id); 104 if ( $delete_role ) // stops users being added to current blog when they are edited104 if ( $delete_role ) // stops users being added to current blog when they are edited 105 105 update_usermeta( $user_id, $blog_prefix . 'capabilities' , '' ); 106 106 } -
trunk/wp-admin/user-new.php
r12722 r12752 54 54 $user_login = preg_replace( "/\s+/", '', sanitize_user( $_REQUEST[ 'user_login' ], true ) ); 55 55 $user_details = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE user_login = %s AND user_email = %s", $user_login, $_REQUEST[ 'email' ] ) ); 56 if ( $user_details ) {56 if ( $user_details ) { 57 57 // Adding an existing user to this blog 58 58 $new_user_email = wp_specialchars(trim($_REQUEST['email'])); … … 60 60 $username = $user_details->user_login; 61 61 $user_id = $user_details->ID; 62 if ( ($username != null && is_site_admin( $username ) == false ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) {62 if ( ($username != null && is_site_admin( $username ) == false ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) { 63 63 $redirect = add_query_arg( array('update' => 'addexisting'), 'user-new.php' ); 64 64 } else { -
trunk/wp-admin/users.php
r12722 r12752 93 93 wp_die(__('You can’t delete that user.')); 94 94 95 if ($id == $current_user->ID) {95 if ($id == $current_user->ID) { 96 96 $update = 'err_admin_del'; 97 97 continue; -
trunk/wp-app.php
r12734 r12752 285 285 286 286 // redirect to /service in case no path is found. 287 if (strlen($path) == 0 || $path == '/')287 if (strlen($path) == 0 || $path == '/') 288 288 $this->redirect($this->get_service_url()); 289 289 … … 664 664 665 665 $parser = new AtomParser(); 666 if (!$parser->parse()) {666 if (!$parser->parse()) { 667 667 $this->bad_request(); 668 668 } … … 806 806 $location = "{$upload_dir['basedir']}/{$location}"; 807 807 808 if (!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))808 if (!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) 809 809 $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); 810 810 … … 900 900 function get_attachments_url($page = null) { 901 901 $url = $this->app_base . $this->MEDIA_PATH; 902 if (isset($page) && is_int($page)) {902 if (isset($page) && is_int($page)) { 903 903 $url .= "/$page"; 904 904 } … … 937 937 */ 938 938 function get_entry_url($postID = null) { 939 if (!isset($postID)) {939 if (!isset($postID)) { 940 940 global $post; 941 941 $postID = (int) $post->ID; … … 968 968 */ 969 969 function get_media_url($postID = null) { 970 if (!isset($postID)) {970 if (!isset($postID)) { 971 971 global $post; 972 972 $postID = (int) $post->ID; … … 1001 1001 log_app('function',"set_current_entry($postID)"); 1002 1002 1003 if (!isset($postID)) {1003 if (!isset($postID)) { 1004 1004 // $this->bad_request(); 1005 1005 $this->not_found(); … … 1008 1008 $entry = wp_get_single_post($postID,ARRAY_A); 1009 1009 1010 if (!isset($entry) || !isset($entry['ID']))1010 if (!isset($entry) || !isset($entry['ID'])) 1011 1011 $this->not_found(); 1012 1012 … … 1059 1059 $this->ENTRY_PATH = $post_type; 1060 1060 1061 if (!isset($page)) {1061 if (!isset($page)) { 1062 1062 $page = 1; 1063 1063 } … … 1088 1088 <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle> 1089 1089 <link rel="first" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url() ?>" /> 1090 <?php if (isset($prev_page)): ?>1090 <?php if (isset($prev_page)): ?> 1091 1091 <link rel="previous" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($prev_page) ?>" /> 1092 1092 <?php endif; ?> 1093 <?php if (isset($next_page)): ?>1093 <?php if (isset($next_page)): ?> 1094 1094 <link rel="next" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($next_page) ?>" /> 1095 1095 <?php endif; ?> … … 1172 1172 <?php } ?> 1173 1173 </author> 1174 <?php if ($GLOBALS['post']->post_type == 'attachment') { ?>1174 <?php if ($GLOBALS['post']->post_type == 'attachment') { ?> 1175 1175 <link rel="edit-media" href="<?php $this->the_media_url() ?>" /> 1176 1176 <content type="<?php echo $GLOBALS['post']->post_mime_type ?>" src="<?php the_guid(); ?>"/> … … 1365 1365 } 1366 1366 header("Content-Type: $this->ATOM_CONTENT_TYPE"); 1367 if (isset($ctloc))1367 if (isset($ctloc)) 1368 1368 header('Content-Location: ' . $ctloc); 1369 1369 header('Location: ' . $edit); … … 1420 1420 header('Content-Disposition: attachment; filename=atom.xml'); 1421 1421 header('Date: '. date('r')); 1422 if ($this->do_output)1422 if ($this->do_output) 1423 1423 echo $xml; 1424 1424 log_app('function', "output:\n$xml"); … … 1459 1459 // if using mod_rewrite/ENV hack 1460 1460 // http://www.besthostratings.com/articles/http-auth-php-cgi.html 1461 if (isset($_SERVER['HTTP_AUTHORIZATION'])) {1461 if (isset($_SERVER['HTTP_AUTHORIZATION'])) { 1462 1462 list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = 1463 1463 explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); … … 1470 1470 1471 1471 // If Basic Auth is working... 1472 if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {1472 if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { 1473 1473 log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']); 1474 1474 … … 1494 1494 function get_accepted_content_type($types = null) { 1495 1495 1496 if (!isset($types)) {1496 if (!isset($types)) { 1497 1497 $types = $this->media_content_types; 1498 1498 } 1499 1499 1500 if (!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) {1500 if (!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) { 1501 1501 $this->length_required(); 1502 1502 } … … 1509 1509 foreach($types as $t) { 1510 1510 list($acceptedType,$acceptedSubtype) = explode('/',$t); 1511 if ($acceptedType == '*' || $acceptedType == $type) {1512 if ($acceptedSubtype == '*' || $acceptedSubtype == $subtype)1511 if ($acceptedType == '*' || $acceptedType == $type) { 1512 if ($acceptedSubtype == '*' || $acceptedSubtype == $subtype) 1513 1513 return $type . "/" . $subtype; 1514 1514 } … … 1525 1525 function process_conditionals() { 1526 1526 1527 if (empty($this->params)) return;1528 if ($_SERVER['REQUEST_METHOD'] == 'DELETE') return;1527 if (empty($this->params)) return; 1528 if ($_SERVER['REQUEST_METHOD'] == 'DELETE') return; 1529 1529 1530 1530 switch($this->params[0]) { … … 1577 1577 1578 1578 $match = false; 1579 if (!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match))1579 if (!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match)) 1580 1580 return false; 1581 1581 1582 if ($match[3] == 'Z')1582 if ($match[3] == 'Z') 1583 1583 $match[3] == '+0000'; 1584 1584 … … 1598 1598 $pubtime = $this->rfc3339_str2time($published); 1599 1599 1600 if (!$pubtime) {1600 if (!$pubtime) { 1601 1601 return array(current_time('mysql'),current_time('mysql',1)); 1602 1602 } else { -
trunk/wp-signup.php
r12735 r12752 391 391 switch ($_POST['stage']) { 392 392 case 'validate-user-signup' : 393 if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )393 if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) 394 394 validate_user_signup(); 395 395 else … … 410 410 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) 411 411 signup_another_blog($newblogname); 412 elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )412 elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) 413 413 signup_user( $newblogname, $user_email ); 414 elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) )414 elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) 415 415 _e( "I'm sorry. We're not accepting new registrations at this time." ); 416 416 else -
trunk/xmlrpc.php
r12735 r12752 2242 2242 if ( !empty( $content_struct['wp_page_template'] ) ) 2243 2243 $page_template = $content_struct['wp_page_template']; 2244 } elseif ( $content_struct['post_type'] == 'post' ) {2244 } elseif ( $content_struct['post_type'] == 'post' ) { 2245 2245 // This is the default, no changes needed 2246 2246 } else { … … 2828 2828 2829 2829 foreach ($posts_list as $entry) { 2830 if ( !current_user_can( 'edit_post', $entry['ID'] ) )2830 if ( !current_user_can( 'edit_post', $entry['ID'] ) ) 2831 2831 continue; 2832 2832
Note: See TracChangeset
for help on using the changeset viewer.