Changeset 550

Show
Ignore:
Timestamp:
06/07/06 14:28:14 (2 years ago)
Author:
donncha
Message:

WP Merge and new features

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/htaccess.dist

    r543 r550  
    7070 
    7171RewriteRule ^wp-signup.php$                                     BASE/wp-inst/wp-signup.php [L] 
    72 RewriteRule ^wp-activate.php$                                   /wp-inst/wp-activate.php [L] 
     72RewriteRule ^wp-activate.php$                                   BASE/wp-inst/wp-activate.php [L] 
    7373RewriteRule ^wp-login.php                                       BASE/wp-inst/wp-login.php [L] 
    7474RewriteRule ^wp-admin/(.*)                                      BASE/wp-inst/wp-admin/$1 [L] 
  • trunk/wp-inst/wp-activate.php

    r543 r550  
    4646                        $key = $_POST['key']; 
    4747                         
    48                 $result = wpmu_activate_blog($key); 
     48                $result = wpmu_activate_signup($key); 
    4949                if ( is_wp_error($result) ) { 
    5050                        if ( 'already_active' == $result->get_error_code() ) 
     
    6969</tr> 
    7070</table> 
    71 <h3 class="view"><?php printf(__('<a href="%1$s">View your site</a> or <a href="%2$s">Login</a>'), $url, 'http://wordpress.com/'); ?></h3> 
     71<h3 class="view"><?php printf(__('<a href="%1$s">View your site</a> or <a href="%2$s">Login</a>'), $url, 'http://' . $_SERVER[ 'SERVER_NAME' ] . '/' ); ?></h3> 
    7272<?php 
    7373                } 
  • trunk/wp-inst/wp-admin/admin-db.php

    r543 r550  
    9393                $update = false; 
    9494 
    95         $cat_name = wp_specialchars($cat_name); 
    96  
     95        $cat_name = apply_filters('pre_category_name', $cat_name); 
     96         
    9797        if ( !$update && category_exists($cat_name) ) 
    9898                return 0; 
     
    102102        else 
    103103                $category_nicename = sanitize_title($category_nicename); 
     104        $category_nicename = apply_filters('pre_category_nicename', $category_nicename); 
    104105 
    105106        if (empty ($category_description)) 
    106107                $category_description = ''; 
    107  
     108        $category_description = apply_filters('pre_category_description', $category_description); 
     109 
     110        $category_parent = (int) $category_parent; 
    108111        if (empty ($category_parent)) 
    109112                $category_parent = 0; 
     
    190193        $posts = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id='$cat_ID'"); 
    191194        if ( is_array($posts) ) foreach ($posts as $post_id) { 
    192                 $cats = wp_get_post_cats('', $post_id); 
     195                $cats = wp_get_post_categories($post_id); 
    193196                if ( 1 == count($cats) ) 
    194197                        $cats = array($default_cat); 
    195198                else 
    196199                        $cats = array_diff($cats, array($cat_ID)); 
    197                 wp_set_post_cats('', $post_id, $cats);  
     200                wp_set_post_categories($post_id, $cats);  
    198201        } 
    199202 
     
    233236 
    234237        if ($post_id) 
    235                 wp_set_post_cats('', $post_id, $cat_ids); 
     238                wp_set_post_categories($post_id, $cat_ids); 
    236239 
    237240        return $cat_ids; 
     
    284287        $user = new WP_User($id); 
    285288        $user->remove_all_caps();        
    286 } 
    287  
    288 function get_link($link_id, $output = OBJECT) { 
    289         global $wpdb; 
    290  
    291         $link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$link_id'"); 
    292         $link->link_category = wp_get_link_cats($link_id); 
    293  
    294         if ( $output == OBJECT ) { 
    295                 return $link; 
    296         } elseif ( $output == ARRAY_A ) { 
    297                 return get_object_vars($link); 
    298         } elseif ( $output == ARRAY_N ) { 
    299                 return array_values(get_object_vars($link)); 
    300         } else { 
    301                 return $link; 
    302         } 
    303289} 
    304290 
  • trunk/wp-inst/wp-admin/admin-footer.php

    r520 r550  
    1010<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script> 
    1111 
    12 <?php 
    13 if ( (substr(php_sapi_name(), 0, 3) == 'cgi') && spawn_pinger() ) { 
    14         echo '<iframe id="pingcheck" src="' . get_settings('siteurl') .'/wp-admin/execute-pings.php?time=' . time() . '" style="border:none;width:1px;height:1px;"></iframe>'; 
    15 } 
    16 ?> 
    17  
    1812</body> 
    1913</html> 
  • trunk/wp-inst/wp-admin/admin-functions.php

    r543 r550  
    648648 
    649649        if (!$categories) 
    650                 $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name"); 
     650                $categories = get_categories('hide_empty=0'); 
    651651 
    652652        if ($categories) { 
     
    665665 
    666666                                        if ( ($category->cat_ID != $default_cat_id) && ($category->cat_ID != $default_link_cat_id) ) 
    667                                                 $edit .= "<td><a href='categories.php?action=delete&amp;cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '".sprintf(__("You are about to delete the category &quot;%s&quot;.\\nAll of its posts will go into the default category of &quot;%s&quot;\\nAll of its bookmarks will go into the default category of &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes($category->cat_name), addslashes(wp_specialchars(get_catname($default_cat_id),'double')), addslashes(wp_specialchars(get_catname($default_link_cat_id),'double')))."' );\" class='delete'>".__('Delete')."</a>"; 
     667                                                $edit .= "<td><a href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category &quot;%s&quot;.\\nAll of its posts will go into the default category of &quot;%s&quot;\\nAll of its bookmarks will go into the default category of &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes($category->cat_name), js_escape(get_catname($default_cat_id)), js_escape(get_catname($default_link_cat_id))) . "' );\" class='delete'>".__('Delete')."</a>"; 
    668668                                        else 
    669669                                                $edit .= "<td style='text-align:center'>".__("Default"); 
     
    694694 
    695695        if (!$pages) 
    696                 $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY menu_order"); 
     696                $pages = get_pages('sort_column=menu_order'); 
    697697 
    698698        if (! $pages) 
     
    718718        <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td> 
    719719    <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>  
    720     <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='page.php?action=delete&amp;post=$id' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes(wp_specialchars(get_the_title(),'double')) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>  
     720    <td><?php if ( current_user_can('edit_page', $id) ) { echo "<a href='" . wp_nonce_url("page.php?action=delete&amp;post=$id", 'delete-page_' . $id) .  "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes(wp_specialchars(get_the_title(),'double')) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>  
    721721  </tr>  
    722722 
     
    727727 
    728728function user_row( $user_object, $style = '' ) { 
     729        global $current_user; 
     730 
    729731        if ( !(is_object($user_object) && is_a($user_object, 'WP_User')) ) 
    730732                $user_object = new WP_User( (int) $user_object ); 
    731733        $email = $user_object->user_email; 
     734        if( $current_user->ID != $user_object->ID || is_site_admin() == false ) 
     735                $email = "N/A"; 
    732736        $url = $user_object->user_url; 
    733737        $short_url = str_replace('http://', '', $url); 
     
    745749                <td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td> 
    746750                <td><a href='$url' title='website: $url'>$short_url</a></td>"; 
    747         $r .= "\n\t\t<td align='right'>$numposts</td>"; 
     751        $r .= "\n\t\t<td align='center'>$numposts</td>"; 
    748752        $r .= "\n\t\t<td>"; 
    749         if (current_user_can('edit_users')
     753        if ( ( is_site_admin() || $current_user->ID == $user_object->ID ) && current_user_can('edit_user', $user_object->ID)
    750754                $r .= "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>"; 
    751755        $r .= "</td>\n\t</tr>"; 
     
    754758 
    755759function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0) { 
    756         global $wpdb, $bgcolor
    757         if (!$categories) { 
    758                 $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name"); 
    759         } 
     760        global $wpdb
     761        if (!$categories) 
     762                $categories = get_categories('hide_empty=0'); 
     763 
    760764        if ($categories) { 
    761765                foreach ($categories as $category) { 
     
    870874                return $error; 
    871875        } else { 
    872                 apply_filters( 'wp_create_thumbnail', $thumbpath ); 
    873876                return $thumbpath; 
    874877        } 
     
    11831186function the_quicktags() { 
    11841187        // Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP 
    1185         if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) 
     1188        if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) { 
    11861189                echo ' 
    11871190                <div id="quicktags"> 
    1188                         <script src="../wp-includes/js/quicktags.js" type="text/javascript"></script> 
    1189                         <script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script> 
     1191                        '; 
     1192                wp_print_scripts( 'quicktags' ); 
     1193                echo '                  <script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script> 
    11901194                </div> 
    11911195'; 
    1192         else echo ' 
     1196        } else echo ' 
    11931197<script type="text/javascript"> 
    11941198function edInsertContent(myField, myValue) { 
     
    15691573                return $wp_file_descriptions[basename($file)]; 
    15701574        } 
    1571         elseif (file_exists(ABSPATH.$file)) { 
    1572                 $template_data = implode('', file(ABSPATH.$file)); 
     1575        elseif ( file_exists( ABSPATH . $file ) && is_file( ABSPATH . $file ) ) { 
     1576                $template_data = implode('', file( ABSPATH . $file )); 
    15731577                if (preg_match("|Template Name:(.*)|i", $template_data, $name)) 
    15741578                        return $name[1]; 
     
    18861890                                $filename = str_replace("$number$ext", ++$number . $ext, $filename); 
    18871891                } 
     1892                $filename = preg_replace('#\.(?![^.]+$)#', '-', $filename); 
    18881893        } 
    18891894 
     
    19211926function wp_import_upload_form($action) { 
    19221927?> 
    1923 <script type="text/javascript"> 
    1924 function cancelUpload() { 
    1925 o = document.getElementById('uploadForm'); 
    1926 o.method = 'GET'; 
    1927 o.action.value = 'view'; 
    1928 o.submit(); 
    1929 
    1930 </script> 
    1931 <form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo $action ?>"> 
    1932 <label for="upload"><?php _e('File:'); ?></label><input type="file" id="upload" name="import" /> 
     1928<form enctype="multipart/form-data" id="import-upload-form" method="POST" action="<?php echo $action ?>"> 
     1929<p> 
     1930<label for="upload"><?php _e('Choose a file from your computer:'); ?></label> <input type="file" id="upload" name="import" size="25" /> 
    19331931<input type="hidden" name="action" value="save" /> 
    1934 <div id="buttons"
    1935 <input type="submit" value="<?php _e('Import'); ?>" /
    1936 <input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" /> 
    1937 </div
     1932</p
     1933<p class="submit"
     1934<input type="submit" value="<?php _e('Upload file and import'); ?> &raquo;" /> 
     1935</p
    19381936</form> 
    19391937<?php 
     
    19481946 
    19491947        $url = $file['url']; 
    1950         $file = $file['file']
     1948        $file = addslashes( $file['file'] )
    19511949        $filename = basename($file); 
    19521950 
  • trunk/wp-inst/wp-admin/admin-header.php

    r532 r550  
    33if (!isset($_GET["page"])) require_once('admin.php'); 
    44if ( $editing ) { 
    5         $dbx_js = true
     5        wp_enqueue_script( array("dbx-admin-key?pagenow=$pagenow",'admin-custom-fields') )
    66        if ( current_user_can('manage_categories') ) 
    7                 $cat_js = true; 
     7                wp_enqueue_script( 'ajaxcat' ); 
     8        if ( user_can_richedit() ) 
     9                wp_enqueue_script( 'wp_tiny_mce' ); 
    810} 
    9 if ( $list_js || $cat_js ) 
    10        $sack_js = true
     11 
     12get_admin_page_title()
    1113?> 
    12 <?php get_admin_page_title(); ?> 
    1314<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    1415<html xmlns="http://www.w3.org/1999/xhtml"> 
     
    2223//]]> 
    2324</script> 
    24 <script type="text/javascript" src="../wp-includes/js/fat.js"></script> 
    25 <?php if ( $xfn_js ) { ?> 
    26 <script type="text/javascript" src="xfn.js"></script> 
    27 <?php } ?> 
    28 <?php if ( $sack_js ) { ?> 
    29 <script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script> 
    30 <?php } ?> 
    31 <?php if ( $list_js ) { ?> 
    32 <script type="text/javascript" src="list-manipulation.js"></script> 
    33 <?php } ?> 
    34 <?php if ( $dbx_js ) { ?> 
    35 <script type="text/javascript" src="../wp-includes/js/dbx.js"></script> 
    36 <script type="text/javascript"> 
    37 //<![CDATA[ 
    38 addLoadEvent( function() { 
    39 <?php switch ( $pagenow ) : case 'post.php' : case 'post-new.php' : ?> 
    40 var manager = new dbxManager('postmeta'); 
    41 <?php break; case 'page.php' : case 'page-new.php' : ?> 
    42 var manager = new dbxManager('pagemeta'); 
    43 <?php break; endswitch; ?> 
    44 }); 
    45 //]]> 
    46 </script> 
    47 <script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script> 
    48 <?php } ?> 
    49 <?php if ( $editing && user_can_richedit() ) { ?> 
    50 <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script> 
    51 <?php } ?> 
    52 <?php if ( $cat_js ) { ?> 
    53 <script type="text/javascript" src="cat-js.php"></script> 
    54 <?php } ?> 
    5525<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?> 
    5626<style type="text/css">* html { overflow-x: hidden; }</style> 
    57 <?php endif; ?> 
    58 <?php do_action('admin_head'); ?> 
     27<?php endif; wp_print_scripts(); do_action('admin_head'); ?> 
    5928</head> 
    6029<body> 
  • trunk/wp-inst/wp-admin/admin.php

    r538 r550  
    1818update_category_cache(); 
    1919 
    20 get_currentuserinfo(); 
     20wp_get_current_user(); 
    2121 
    2222$posts_per_page = get_settings('posts_per_page'); 
     
    4141} 
    4242 
    43 $xfn_js = $sack_js = $list_js = $cat_js = $dbx_js = $editing = false; 
     43wp_enqueue_script( 'fat' ); 
     44 
     45$editing = false; 
    4446 
    4547require(ABSPATH . '/wp-admin/menu.php'); 
  • trunk/wp-inst/wp-admin/cat-js.php

    r524 r550  
    11<?php 
    2 require_once('admin.php'); 
     2require_once('../wp-config.php'); 
    33header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true); 
    44?> 
    5 var ajaxCat = new sack(); 
    6 var newcat; 
    7   
     5addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;}); 
     6addLoadEvent(newCatAddIn); 
    87function newCatAddIn() { 
    98        if ( !document.getElementById('jaxcat') ) return false; 
     
    1716        newcat.size = '16'; 
    1817        newcat.setAttribute('autocomplete', 'off'); 
    19         newcat.onkeypress = ajaxNewCatKeyPress
     18        newcat.onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','categorydiv');", e); }
    2019 
    2120        var newcatSub = document.createElement('input'); 
     
    2322        newcatSub.name = 'Button'; 
    2423        newcatSub.id = 'catadd'; 
    25         newcatSub.value = '<?php echo addslashes(__('Add')); ?>'; 
    26         newcatSub.onclick = ajaxNewCat
     24        newcatSub.value = 'Add'; 
     25        newcatSub.onclick = function() { catList.ajaxAdder('category', 'categorydiv'); }
    2726 
    2827        ajaxcat.appendChild(newcat); 
     
    4241 
    4342        howto = document.createElement('span'); 
    44         howto.innerHTML = '<?php echo addslashes(__('Separate multiple categories with commas.')); ?>'
     43        howto.innerHTML = "<?php _e('Separate multiple categories with commas.'); ?>"
    4544        howto.id = 'howto'; 
    4645        ajaxcat.appendChild(howto); 
    4746} 
    48  
    49 addLoadEvent(newCatAddIn); 
    50  
    51 function getResponseElement() { 
    52         var p = document.getElementById('ajaxcatresponse'); 
    53         if (!p) { 
    54                 p = document.createElement('span'); 
    55                 document.getElementById('jaxcat').appendChild(p); 
    56                 p.id = 'ajaxcatresponse'; 
    57         } 
    58         return p; 
    59 } 
    60  
    61 function newCatLoading() { 
    62         var p = getResponseElement(); 
    63         p.innerHTML = '<?php echo addslashes(__('Sending Data...')); ?>'; 
    64 } 
    65  
    66 function newCatLoaded() { 
    67         var p = getResponseElement(); 
    68         p.innerHTML = '<?php echo addslashes(__('Data Sent...')); ?>'; 
    69 } 
    70  
    71 function newCatInteractive() { 
    72         var p = getResponseElement(); 
    73         p.innerHTML = '<?php echo addslashes(__('Processing Request...')); ?>'; 
    74 } 
    75  
    76 function newCatCompletion() { 
    77         var p = getResponseElement(); 
    78         var id    = 0; 
    79         var ids   = new Array(); 
    80         var names = new Array(); 
    81  
    82         ids   = myPload( ajaxCat.response ); 
    83         names = myPload( newcat.value ); 
    84         for ( i = 0; i < ids.length; i++ ) { 
    85                 id = ids[i].replace(/[\n\r]+/g, ""); 
    86                 if ( id == '-1' ) { 
    87                         p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>"; 
    88                         return; 
    89                 } 
    90                 if ( id == '0' ) { 
    91                         p.innerHTML = "<?php echo addslashes(__('That category name is invalid.  Try something else.')); ?>"; 
    92                         return; 
    93                 } 
    94  
    95                 var exists = document.getElementById('category-' + id); 
    96  
    97                 if (exists) { 
    98                         var moveIt = exists.parentNode; 
    99                         var container = moveIt.parentNode; 
    100                         container.removeChild(moveIt); 
    101                         container.insertBefore(moveIt, container.firstChild); 
    102                         moveIt.id = 'new-category-' + id; 
    103                         exists.checked = 'checked'; 
    104                         var nowClass = moveIt.className; 
    105                         moveIt.className = nowClass + ' fade'; 
    106                         Fat.fade_all(); 
    107                         moveIt.className = nowClass; 
    108                 } else { 
    109                         var catDiv = document.getElementById('categorychecklist'); 
    110                         var newLabel = document.createElement('label'); 
    111                         newLabel.setAttribute('for', 'category-' + id); 
    112                         newLabel.id = 'new-category-' + id; 
    113                         newLabel.className = 'selectit fade'; 
    114  
    115                         var newCheck = document.createElement('input'); 
    116                         newCheck.type = 'checkbox'; 
    117                         newCheck.value = id; 
    118                         newCheck.name = 'post_category[]'; 
    119                         newCheck.id = 'category-' + id; 
    120                         newLabel.appendChild(newCheck); 
    121  
    122                         var newLabelText = document.createTextNode(' ' + names[i]); 
    123                         newLabel.appendChild(newLabelText); 
    124  
    125                         catDiv.insertBefore(newLabel, catDiv.firstChild); 
    126                         newCheck.checked = 'checked'; 
    127  
    128                         Fat.fade_all(); 
    129                         newLabel.className = 'selectit'; 
    130                 } 
    131                 newcat.value = ''; 
    132         } 
    133         p.parentNode.removeChild(p); 
    134 //      var id = parseInt(ajaxCat.response, 10); 
    135 } 
    136  
    137 function ajaxNewCatKeyPress(e) { 
    138         if (!e) { 
    139                 if (window.event) { 
    140                         e = window.event; 
    141                 } else { 
    142                         return; 
    143                 } 
    144         } 
    145         if (e.keyCode == 13) { 
    146                 ajaxNewCat(); 
    147                 e.returnValue = false; 
    148                 e.cancelBubble = true; 
    149                 return false; 
    150         } 
    151 } 
    152  
    153 function ajaxNewCat() { 
    154         var newcat = document.getElementById('newcat'); 
    155         var split_cats = new Array(1); 
    156         var catString = ''; 
    157  
    158         catString = 'ajaxnewcat=' + encodeURIComponent(newcat.value); 
    159         ajaxCat.requestFile = 'edit-form-ajax-cat.php'; 
    160         ajaxCat.method = 'GET'; 
    161         ajaxCat.onLoading = newCatLoading; 
    162         ajaxCat.onLoaded = newCatLoaded; 
    163         ajaxCat.onInteractive = newCatInteractive; 
    164         ajaxCat.onCompletion = newCatCompletion; 
    165         ajaxCat.runAJAX(catString); 
    166 } 
    167  
    168 function myPload( str ) { 
    169         var fixedExplode = new Array(); 
    170         var comma = new String(','); 
    171         var count = 0; 
    172         var currentElement = ''; 
    173  
    174         for( x=0; x < str.length; x++) { 
    175                 andy = str.charAt(x); 
    176                 if ( comma.indexOf(andy) != -1 ) { 
    177                         currentElement = currentElement.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // trim 
    178                         fixedExplode[count] = currentElement; 
    179                         currentElement = ""; 
    180                         count++; 
    181                 } else { 
    182                         currentElement += andy; 
    183                 } 
    184         } 
    185  
    186         if ( currentElement != "" ) 
    187                 fixedExplode[count] = currentElement; 
    188         return fixedExplode; 
    189 } 
  • trunk/wp-inst/wp-admin/categories.php

    r543 r550  
    2525case 'addcat': 
    2626 
    27         check_admin_referer(); 
     27        check_admin_referer('add-category'); 
    2828 
    2929        if ( !current_user_can('manage_categories') ) 
     
    3636 
    3737case 'delete': 
    38  
    39         check_admin_referer(); 
     38        $cat_ID = (int) $_GET['cat_ID']; 
     39        check_admin_referer('delete-category_' .  $cat_ID); 
    4040 
    4141        if ( !current_user_can('manage_categories') ) 
    4242                die (__('Cheatin&#8217; uh?')); 
    4343 
    44         $cat_ID = (int) $_GET['cat_ID']; 
    4544        $cat_name = get_catname($cat_ID); 
    4645 
     
    6362    $cat_ID = (int) $_GET['cat_ID']; 
    6463    $category = get_category_to_edit($cat_ID);&n