Changeset 804

Show
Ignore:
Timestamp:
11/07/06 12:37:04 (2 years ago)
Author:
donncha
Message:

WP Merge

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-functions.php

    r803 r804  
    123123 
    124124        $i = 0; 
    125         $search = "# id=(\"|')p(\d+)\\1#i"; 
     125        $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i"; 
    126126        foreach ( $anchor_matches[0] as $anchor ) { 
    127127                if ( 0 == preg_match($search, $anchor, $id_matches) ) 
    128128                        continue; 
    129129 
    130                 $id = $id_matches[2]; 
     130                $id = $id_matches[3]; 
    131131 
    132132                // While we have the attachment ID, let's adopt any orphans. 
     
    288288// Get an existing post and format it for editing. 
    289289function get_post_to_edit($id) { 
    290         global $richedit; 
    291         $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false; 
    292290 
    293291        $post = get_post($id); 
    294292 
    295         $post->post_content = format_to_edit($post->post_content, $richedit); 
     293        $post->post_content = format_to_edit($post->post_content, user_can_richedit()); 
    296294        $post->post_content = apply_filters('content_edit_pre', $post->post_content); 
    297295 
     
    351349 
    352350function get_comment_to_edit($id) { 
    353         global $richedit; 
    354         $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false; 
    355  
    356351        $comment = get_comment($id); 
    357352 
    358         $comment->comment_content = format_to_edit($comment->comment_content, $richedit); 
     353        $comment->comment_content = format_to_edit($comment->comment_content, user_can_richedit()); 
    359354        $comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content); 
    360355 
     
    994989                if ('_' == $entry['meta_key'] { 0 }) 
    995990                        $style .= ' hidden'; 
     991 
     992                if ( is_serialized($entry['meta_value']) ) { 
     993                        if ( is_serialized_string($entry['meta_value']) ) { 
     994                                // this is a serialized string, so we should display it 
     995                                $entry['meta_value'] = maybe_unserialize($entry['meta_value']); 
     996                        } else { 
     997                                // this is a serialized array/object so we should NOT display it 
     998                                --$count; 
     999                                continue; 
     1000                        } 
     1001                } 
     1002 
    9961003                $key_js = js_escape($entry['meta_key']); 
    9971004                $entry['meta_key'] = wp_specialchars( $entry['meta_key'], true ); 
     
    10251032function meta_form() { 
    10261033        global $wpdb; 
     1034        $limit = (int) apply_filters('postmeta_form_limit', 30); 
    10271035        $keys = $wpdb->get_col(" 
    1028                         SELECT meta_key 
    1029                         FROM $wpdb->postmeta 
    1030                         GROUP BY meta_key 
    1031                         ORDER BY meta_id DESC 
    1032                         LIMIT 10"); 
     1036                SELECT meta_key 
     1037                FROM $wpdb->postmeta 
     1038                GROUP BY meta_key 
     1039                ORDER BY meta_id DESC 
     1040                LIMIT $limit"); 
     1041        natcasesort($keys); 
    10331042?> 
    10341043<h3><?php _e('Add a new custom field:') ?></h3> 
     
    10401049        <tr valign="top"> 
    10411050                <td align="right" width="18%"> 
    1042 <?php if ($keys) : ?> 
     1051<?php if ( $keys ) : ?> 
    10431052<select id="metakeyselect" name="metakeyselect" tabindex="7"> 
    10441053<option value="#NONE#"><?php _e('- Select -'); ?></option> 
    10451054<?php 
    10461055 
    1047         foreach ($keys as $key) { 
     1056        foreach ( $keys as $key ) { 
    10481057                $key = wp_specialchars($key, 1); 
    10491058                echo "\n\t<option value='$key'>$key</option>"; 
     
    10691078        $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect']))); 
    10701079        $metakeyinput = $wpdb->escape(stripslashes(trim($_POST['metakeyinput']))); 
    1071         $metavalue = $wpdb->escape(stripslashes(trim($_POST['metavalue']))); 
     1080        $metavalue = maybe_serialize(stripslashes((trim($_POST['metavalue'])))); 
     1081        $metavalue = $wpdb->escape($metavalue); 
    10721082 
    10731083        if ( ('0' === $metavalue || !empty ($metavalue)) && ((('#NONE#' != $metakeyselect) && !empty ($metakeyselect)) || !empty ($metakeyinput)) ) { 
     
    11001110function update_meta($mid, $mkey, $mvalue) { 
    11011111        global $wpdb; 
     1112        $mvalue = maybe_serialize(stripslashes($mvalue)); 
     1113        $mvalue = $wpdb->escape($mvalue); 
    11021114        $mid = (int) $mid; 
    1103  
    11041115        return $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'"); 
    11051116} 
     
    11091120        $mid = (int) $mid; 
    11101121 
    1111         return $wpdb->get_row("SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 
     1122        $meta = $wpdb->get_row("SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 
     1123        if ( is_serialized_string($meta->meta_value) ) 
     1124                $meta->meta_value = maybe_unserialize($meta->meta_value); 
     1125        return $meta; 
    11121126} 
    11131127 
     
    19371951 
    19381952function wp_import_upload_form($action) { 
     1953        $size = strtolower( ini_get('upload_max_filesize') ); 
     1954        $bytes = 0; 
     1955        if ( strstr( $size, 'k' ) ) 
     1956                $bytes = $size * 1024; 
     1957        if ( strstr( $size, 'm' ) ) 
     1958                $bytes = $size * 1024 * 1024; 
     1959        if ( strstr( $size, 'g' ) ) 
     1960                $bytes = $size * 1024 * 1024 * 1024; 
    19391961?> 
    19401962<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo $action ?>"> 
    19411963<p> 
    1942 <label for="upload"><?php _e('Choose a file from your computer:'); ?></label> <input type="file" id="upload" name="import" size="25" /> 
     1964<label for="upload"><?php _e('Choose a file from your computer:'); ?></label> (<?php printf( __('Maximum size: %s'), $size ); ?>) 
     1965<input type="file" id="upload" name="import" size="25" /> 
    19431966<input type="hidden" name="action" value="save" /> 
     1967<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" /> 
    19441968</p> 
    19451969<p class="submit"> 
     
    19972021        <tr> 
    19982022                <th scope="row"><?php $thumb ? _e('Thumbnail linked to file') : _e('Image linked to file'); ?></th> 
    1999                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> 
     2023                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>"><?php echo $icon ?></a></textarea></td> 
    20002024        </tr> 
    20012025        <tr> 
    20022026                <th scope="row"><?php $thumb ? _e('Thumbnail linked to page') : _e('Image linked to file'); ?></th> 
    2003                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> 
     2027                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td> 
    20042028        </tr> 
    20052029<?php else : ?> 
     
    20102034        <tr> 
    20112035                <th scope="row"><?php _e('Link to page') ?></th> 
    2012                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td> 
     2036                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td> 
    20132037        </tr> 
    20142038<?php endif; ?> 
     
    21402164 
    21412165add_action('update_option_new_admin_email', 'update_option_new_admin_email', 10, 2); 
     2166 
     2167function wp_crop_image($src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false) { 
     2168        if ( ctype_digit($src_file) ) // Handle int as attachment ID 
     2169                $src_file = get_attached_file($src_file); 
     2170 
     2171        $src = wp_load_image($src_file); 
     2172 
     2173        if ( !is_resource($src) ) 
     2174                return $src; 
     2175 
     2176        $dst = imagecreatetruecolor($dst_w, $dst_h); 
     2177 
     2178        if ( $src_abs ) { 
     2179                $src_w -= $src_x; 
     2180                $src_h -= $src_y; 
     2181        } 
     2182 
     2183        imageantialias($dst, true); 
     2184        imagecopyresampled($dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); 
     2185 
     2186        if ( !$dst_file ) 
     2187                $dst_file = str_replace(basename($src_file), 'cropped-'.basename($src_file), $src_file); 
     2188 
     2189        $dst_file = preg_replace('/\\.[^\\.]+$/', '.jpg', $dst_file); 
     2190 
     2191        if ( imagejpeg($dst, $dst_file) ) 
     2192                return $dst_file; 
     2193        else 
     2194                return false; 
     2195} 
     2196 
     2197function wp_load_image($file) { 
     2198        if ( ctype_digit($file) ) 
     2199                $file = get_attached_file($file); 
     2200 
     2201        if ( !file_exists($file) ) 
     2202                return "File '$file' doesn't exist?"; 
     2203 
     2204        $contents = file_get_contents($file); 
     2205 
     2206        $image = imagecreatefromstring($contents); 
     2207 
     2208        if ( !is_resource($image) ) 
     2209                return "File '$file' is not image?"; 
     2210 
     2211        return $image; 
     2212} 
     2213 
    21422214?> 
  • trunk/wp-admin/comment.php

    r797 r804  
    1313case 'editcomment': 
    1414        $title = __('Edit Comment'); 
    15         if ( user_can_richedit() ) 
    16                 wp_enqueue_script( 'wp_tiny_mce' ); 
     15 
    1716        require_once ('admin-header.php'); 
    1817 
    19         $comment = (int) $_GET['comment']; 
     18        $comment = (int) $_GET['c']; 
    2019 
    2120        if ( ! $comment = get_comment($comment) ) 
     
    3130        break; 
    3231 
    33 case 'confirmdeletecomment': 
    34 case 'mailapprovecomment': 
     32case 'cdc': 
     33case 'mac': 
    3534 
    3635        require_once('./admin-header.php'); 
    3736 
    38         $comment = (int) $_GET['comment']; 
    39         $p = (int) $_GET['p']; 
    40         $formaction = 'confirmdeletecomment' == $action ? 'deletecomment' : 'approvecomment'; 
    41         $nonce_action = 'confirmdeletecomment' == $action ? 'delete-comment_' : 'approve-comment_'; 
     37        $comment = (int) $_GET['c']; 
     38        $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; 
     39        $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; 
    4240        $nonce_action .= $comment; 
    4341 
     
    4644 
    4745        if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 
    48                 wp_die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
    49  
    50         echo "<div class='wrap'>\n"; 
    51         if ( 'spam' == $_GET['delete_type'] ) 
    52                 echo "<p>" . __('<strong>Caution:</strong> You are about to mark the following comment as spam:') . "</p>\n"; 
    53         elseif ( 'confirmdeletecomment' == $action ) 
    54                 echo "<p>" . __('<strong>Caution:</strong> You are about to delete the following comment:') . "</p>\n"; 
    55         else 
    56                 echo "<p>" . __('<strong>Caution:</strong> You are about to approve the following comment:') . "</p>\n"; 
    57         echo "<table border='0'>\n"; 
    58         echo "<tr><td>" . __('Author:') . "</td><td>$comment->comment_author</td></tr>\n"; 
    59         echo "<tr><td>" . __('E-mail:') . "</td><td>$comment->comment_author_email</td></tr>\n"; 
    60         echo "<tr><td>". __('URL:') . "</td><td>$comment->comment_author_url</td></tr>\n"; 
    61         echo "<tr><td>". __('Comment:') . "</td><td>$comment->comment_content</td></tr>\n"; 
    62         echo "</table>\n"; 
    63         echo "<p>" . __('Are you sure you want to do that?') . "</p>\n"; 
    64  
    65         echo "<form action='".get_option('siteurl')."/wp-admin/comment.php' method='get'>\n"; 
    66         wp_nonce_field($nonce_action); 
    67         echo "<input type='hidden' name='action' value='$formaction' />\n"; 
    68         if ( 'spam' == $_GET['delete_type'] ) 
    69                 echo "<input type='hidden' name='delete_type' value='spam' />\n"; 
    70         echo "<input type='hidden' name='p' value='$p' />\n"; 
    71         echo "<input type='hidden' name='comment' value='{$comment->comment_ID}' />\n"; 
    72         echo "<input type='hidden' name='noredir' value='1' />\n"; 
    73         echo "<input type='submit' value='" . __('Yes') . "' />"; 
    74         echo "&nbsp;&nbsp;"; 
    75         echo "<input type='button' value='" . __('No') . "' onclick=\"self.location='". get_option('siteurl') ."/wp-admin/edit-comments.php';\" />\n"; 
    76         echo "</form>\n"; 
    77         echo "</div>\n"; 
    78  
     46                wp_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 
     47?> 
     48<div class='wrap'> 
     49 
     50<div class="narrow"> 
     51<?php if ( 'spam' == $_GET['dt'] ) { ?> 
     52<p><?php _e('<strong>Caution:</strong> You are about to mark the following comment as spam:'); ?></p> 
     53<?php } elseif ( 'cdc' == $action ) { ?> 
     54<p><?php _e('<strong>Caution:</strong> You are about to delete the following comment:'); ?></p> 
     55<?php } else { ?> 
     56<p><?php _e('<strong>Caution:</strong> You are about to approve the following comment:'); ?></p> 
     57<?php } ?> 
     58 
     59<p><?php _e('Are you sure you want to do that?'); ?></p> 
     60 
     61<form action='<?php echo get_option('siteurl'); ?>/wp-admin/comment.php' method='get'> 
     62 
     63<table width="100%"> 
     64<tr> 
     65<td><input type='button' value='<?php _e('No'); ?>' onclick="self.location='<?php echo get_option('siteurl'); ?>/wp-admin/edit-comments.php';" /></td> 
     66<td align="right"><input type='submit' value='<?php _e('Yes'); ?>' /></td> 
     67</tr> 
     68</table> 
     69 
     70<?php wp_nonce_field($nonce_action); ?> 
     71<input type='hidden' name='action' value='<?php echo $formaction; ?>' /> 
     72<?php if ( 'spam' == $_GET['dt'] ) { ?> 
     73<input type='hidden' name='dt' value='spam' /> 
     74<?php } ?> 
     75<input type='hidden' name='p' value='<?php echo $comment->comment_post_ID; ?>' /> 
     76<input type='hidden' name='c' value='<?php echo $comment->comment_ID; ?>' /> 
     77<input type='hidden' name='noredir' value='1' /> 
     78</form> 
     79 
     80<table class="editform" cellpadding="5"> 
     81<tr class="alt"> 
     82<th scope="row"><?php _e('Author:'); ?></th> 
     83<td><?php echo $comment->comment_author; ?></td> 
     84</tr> 
     85<?php if ( $comment->comment_author_email ) { ?> 
     86<tr> 
     87<th scope="row"><?php _e('E-mail:'); ?></th> 
     88<td><?php echo $comment->comment_author_email; ?></td> 
     89</tr> 
     90<?php } ?> 
     91<?php if ( $comment->comment_author_url ) { ?> 
     92<tr> 
     93<th scope="row"><?php _e('URL:'); ?></th> 
     94<td><?php echo $comment->comment_author_url; ?></td> 
     95</tr> 
     96<?php } ?> 
     97<tr> 
     98<th scope="row" valign="top"><p><?php _e('Comment:'); ?></p></th> 
     99<td><?php echo apply_filters( 'comment_text', $comment->comment_content ); ?></td> 
     100</tr> 
     101</table> 
     102 
     103</div> 
     104</div> 
     105<?php 
    79106        break; 
    80107 
    81108case 'deletecomment': 
    82         $comment = (int) $_REQUEST['comment']; 
     109        $comment = (int) $_REQUEST['c']; 
    83110        check_admin_referer('delete-comment_' . $comment); 
    84111 
    85         $p = (int) $_REQUEST['p']; 
    86112        if ( isset($_REQUEST['noredir']) ) { 
    87113                $noredir = true; 
     
    90116        } 
    91117 
    92         $postdata = get_post($p) or  
    93                 wp_die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 
    94  
    95118        if ( ! $comment = get_comment($comment) ) 
    96119                         wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php')); 
     
    99122                wp_die( __('You are not allowed to edit comments on this post.') ); 
    100123 
    101         if ( 'spam' == $_REQUEST['delete_type'] ) 
     124        if ( 'spam' == $_REQUEST['dt'] ) 
    102125                wp_set_comment_status($comment->comment_ID, 'spam'); 
    103126        else 
     
    113136 
    114137case 'unapprovecomment': 
    115         $comment = (int) $_GET['comment']; 
     138        $comment = (int) $_GET['c']; 
    116139        check_admin_referer('unapprove-comment_' . $comment); 
    117          
    118         $p = (int) $_GET['p']; 
     140 
    119141        if (isset($_GET['noredir'])) { 
    120142                $noredir = true; 
     
    134156                wp_redirect(wp_get_referer()); 
    135157        } else { 
    136                 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
     158                wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 
    137159        } 
    138160        exit(); 
     
    140162 
    141163case 'approvecomment': 
    142         $comment = (int) $_GET['comment']; 
     164        $comment = (int) $_GET['c']; 
    143165        check_admin_referer('approve-comment_' . $comment); 
    144166 
    145         $p = (int) $_GET['p']; 
    146167        if (isset($_GET['noredir'])) { 
    147168                $noredir = true; 
     
    165186                wp_redirect(wp_get_referer()); 
    166187        } else { 
    167                 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
     188                wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 
    168189        } 
    169190        exit(); 
  • trunk/wp-admin/edit-comments.php

    r788 r804  
    119119<?php 
    120120if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    121         echo " <a href='comment.php?action=editcomment&amp;comment=".$comment->comment_ID."'>" .  __('Edit') . '</a>'; 
    122         echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 
     121        echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" .  __('Edit') . '</a>'; 
     122        echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 
    123123        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 
    124                 echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; 
    125                 echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 
     124                echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; 
     125                echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 
    126126        } 
    127         echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;delete_type=spam&amp;p=" . $comment->comment_post_ID . "&amp;comment=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> "; 
     127        echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=" . $comment->comment_post_ID . "&amp;c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> "; 
    128128} 
    129129$post = get_post($comment->comment_post_ID); 
     
    184184    </td> 
    185185    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    186         echo "<a href='comment.php?action=editcomment&amp;comment=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td> 
     186        echo "<a href='comment.php?action=editcomment&amp;c=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td> 
    187187    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    188                 echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape( $comment->comment_author ))  . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> "; 
     188                echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape( $comment->comment_author ))  . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> "; 
    189189                } ?></td> 
    190190  </tr> 
  • trunk/wp-admin/edit-form-comment.php

    r797 r804  
    3737</fieldset> 
    3838 
    39 <fieldset id="<?php echo user_can_richedit() ? 'commentdivrich' : 'commentdiv'; ?>" style="clear: both;"> 
     39<fieldset style="clear: both;"> 
    4040        <legend><?php _e('Comment') ?></legend> 
    4141        <?php the_editor($comment->comment_content, 'content', 'newcomment_author_url'); ?> 
     
    6969                <th scope="row" valign="top"><?php _e('Delete'); $delete_nonce = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); ?>:</th> 
    7070                <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . __("You are about to delete this comment \\n  \'Cancel\' to stop, \'OK\' to delete.") . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true; } return false;\""; ?> />  
    71                 <input type="hidden" name="comment" value="<?php echo $comment->comment_ID ?>" /> 
     71                <input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" /> 
    7272                <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" /> 
    7373                <input type="hidden" name="noredir" value="1" /> 
  • trunk/wp-admin/edit-page-form.php

    r789 r804  
    11 
    22<div class="wrap"> 
    3 <h2 id="write-post"><?php _e('Write Page'); ?><?php if ( 0 != $post_ID ) : ?> 
    4 <small class="quickjump"><a href="#preview-post"><?php _e('preview &darr;'); ?></a></small><?php endif; ?></h2> 
     3<h2 id="write-post"><?php _e('Write Page'); ?></h2> 
    54<?php 
    65if (0 == $post_ID) { 
  • trunk/wp-admin/edit.php

    r793 r804  
    283283<?php 
    284284if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    285         echo " <a href='comment.php?action=editcomment&amp;comment=".$comment->comment_ID."\'>" .  __('Edit') . '</a>'; 
     285        echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."\'>" .  __('Edit') . '</a>'; 
    286286        echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 
    287287        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 
     
    289289                echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; 
    290290        } 
    291         echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;delete_type=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ]"; 
     291        echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ]"; 
    292292} // end if any comments to show 
    293293?> 
  • trunk/wp-admin/import/wordpress.php

    r797 r804  
    5555        function checkauthor($author) { 
    5656                global $wpdb; 
    57                 //mtnames is an array with the names in the mt import file 
    58                 $pass = 'changeme'; 
    59                 if (!(in_array($author, $this->mtnames))) { //a new mt author name is found 
    60                         ++ $this->j; 
    61                         $this->mtnames[$this->j] = $author; //add that new mt author name to an array  
    62                         $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user 
    63                         if (!$user_id) { //banging my head against the desk now.  
    64                                 if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname 
    65                                         $user_id = wp_create_user($author, $pass); 
    66                                         $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. 
    67                                 } else { 
    68                                         $user_id = wp_create_user($this->newauthornames[$this->j], $pass); 
    69                                 } 
    70                         } else { 
    71                                 return $user_id; // return pre-existing wp username if it exists 
    72                         } 
    73                 } else { 
    74                         $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array 
    75                         $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames 
    76                 } 
     57                 
     58                $map = $_POST['userselect']; 
     59 
     60                $user_id = username_exists($map[$author]); //use that key to get the value of the author's name from $newauthornames 
    7761 
    7862                return $user_id; 
     
    141125<h2><?php _e('Assign Authors'); ?></h2> 
    142126<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p> 
    143 <p><?php _e('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)'); ?></p> 
    144127        <?php 
    145128 
     
    152135                        ++ $j; 
    153136                        echo '<li>Current author: <strong>'.$author.'</strong><br />'.'Map to existing: '; 
    154                         $this->users_form($author); 
     137                        $this->users_form($j); 
    155138                        echo '</li>'; 
    156139                } 
  • trunk/wp-admin/install-rtl.css

    r784 r804  
    11body { font-family: Tahoma, Georgia, "Times New Roman", Times, serif; } 
     2 
     3ul, ol { padding: 5px 20px 5px 5px; } 
     4 
     5.step, th { text-align: left; } 
  • trunk/wp-admin/link-add.php

    r729 r804  
    1818?> 
    1919 
    20 <?php if ($_GET['added']) : ?> 
     20<?php if ($_GET['added'] && '' != $_POST['link_name']) : ?> 
    2121<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div> 
    2222<?php endif; ?> 
     
    2727?> 
    2828 
    29 <div class="wrap"> 
    30 <?php printf(__('<p>You can drag <a href="%s" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you&#8217;re on to your bookmarks! Right now this only works on Mozilla or Netscape, but we&#8217;re working on it.</p>'), "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&amp;linkurl='+escape(location.href)+'&amp;name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?> 
     29<div id="wp-link-bookmarklet"  class="wrap"> 
     30<h3><?php _e('Add Link Bookmarklet'); ?></h3> 
     31<p><?php _e('Right click on the following link and choose "Bookmark This Link..." to create an add link shortcut. Right now this only works on Mozilla or Netscape, but we’re working on it.'); ?></p> 
     32<?php printf(__('<p><a href="%s" title="Link add bookmarklet">Link This</a></p>'), "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&amp;linkurl='+escape(location.href)+'&amp;name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?> 
    3133</div> 
    3234 
  • trunk/wp-admin/menu-header.php

    r793 r804  
    1414        if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) { 
    1515                if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") ) 
    16                         echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 
     16                        echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 
    1717                else 
    18                         echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>"; 
     18                        echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>"; 
    1919        } 
    2020} 
     
    4343if (file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || ! empty($menu_hook)) { 
    4444        if ( 'admin.php' == $pagenow ) 
    45                 echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 
     45                echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 
    4646        else 
    47                 echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>"; 
     47                echo "\n\t<li><a href='{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>"; 
    4848 } else { 
    49         echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>"; 
     49        echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>"; 
    5050 } 
    5151endforeach; 
  • trunk/wp-admin/moderation.php

    r774 r804  
    135135<?php comment_text() ?> 
    136136<p><?php comment_date('M j, g:i A'); ?> &#8212; [ <?php 
    137 echo '<a href="comment.php?action=editcomment&amp;comment='.$comment->comment_ID.'">' . __('Edit') . '</a> | '; 
     137echo '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'">' . __('Edit') . '</a> | '; 
    138138echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete ') . "</a> | "; ?> 
    139139<?php 
  • trunk/wp-admin/options.php

    r789 r804  
    1212 
    1313if( $_GET[ 'adminhash' ] ) { 
    14         $new_admin_details = get_option( 'new_admin_email' ); 
     14        $new_admin_details = get_option( 'adminhash' ); 
    1515        if( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) { 
    1616                update_option( "admin_email", $new_admin_details[ 'newemail' ] ); 
     17                delete_option( "adminhash" ); 
    1718                delete_option( "new_admin_email" ); 
    1819        } 
     
    2526        switch ($option) { 
    2627                case 'admin_email': 
     28                case 'new_admin_email': 
    2729                        $value = stripslashes($value); 
    2830                        $value = sanitize_email($value); 
     
    138140<?php 
    139141$options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); 
    140 foreach ( (array) $options as $option ) 
    141         $options_to_update[] = $option->option_name; 
    142 $options_to_update = implode(',', $options_to_update); 
    143 ?> 
    144142 
    145 <input type="hidden" name="page_options" value="<?php echo $options_to_update; ?>" />  
    146  
    147 <?php 
    148143foreach ( (array) $options as $option) : 
    149         $value = wp_specialchars($option->option_value, 'single'); 
     144        $disabled = ''; 
     145        if ( is_serialized($option->option_value) ) { 
     146                if ( is_serialized_string($option->option_value) ) { 
     147                        // this is a serialized string, so we should display it 
     148                        $value = wp_specialchars(maybe_unserialize($option->option_value), 'single'); 
     149                        $options_to_update[] = $option->option_name; 
     150                        $class = 'all-options'; 
     151                } else { 
     152                        $value = 'SERIALIZED DATA'; 
     153                        $disabled = ' disabled="disabled"'; 
     154                        $class = 'all-options disabled'; 
     155                } 
     156        } else { 
     157                $value = wp_specialchars($option->option_value, 'single'); 
     158                $options_to_update[] = $option->option_name; 
     159                $class = 'all-options'; 
     160        } 
    150161        echo " 
    151162<tr> 
     
    153164<td>"; 
    154165 
    155         if (stristr($value, "\n")) echo "<textarea class='all-options' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>"; 
    156         else echo "<input class='all-options' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "' />"; 
     166        if (stristr($value, "\n")) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>$value</textarea>"; 
     167        else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . $value . "'$disabled />"; 
    157168         
    158169        echo "</td> 
     
    162173?> 
    163174  </table> 
    164 <p class="submit"><input type="submit" name="Update" value="<?php _e('Update Options &raquo;') ?>" /></p> 
     175<?php $options_to_update = implode(',', $options_to_update); ?> 
     176<p class="submit"><input type="hidden" name="page_options" value="<?php echo wp_specialchars($options_to_update, true); ?>" /><input type="submit" name="Update" value="<?php _e('Update Options &raquo;') ?>" /></p> 
    165177  </form> 
    166178</div> 
  • trunk/wp-admin/post-new.php

    r789 r804  
    5656<?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?> 
    5757<div id="wp-bookmarklet" class="wrap"> 
    58 <h3><?php _e('WordPress bookmarklet'); ?></h3> 
     58<h3><?php _e('WordPress Bookmarklet'); ?></h3> 
    5959<p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p> 
    6060<p> 
  • trunk/wp-admin/profile-update.php

    r797 r804  
    1818} 
    1919 
    20 if ( !isset( $_POST['rich_editing'] ) ) 
    21         $_POST['rich_editing'] = 'false'; 
    22 update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); 
     20if ( rich_edit_exists() ) { 
     21        if ( !isset( $_POST['rich_editing'] ) ) 
     22                $_POST['rich_editing'] = 'false'; 
     23        update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); 
     24
    2325 
    2426if ( isset( $_POST['primary_blog'] ) ) { 
  • trunk/wp-admin/profile.php

    r793 r804  
    3737 
    3838<p class="submit"><input type="submit" value="<?php _e('Update Profile &raquo;') ?>" name="submit" /></p> 
     39<div style="clear: both"></div> 
    3940 
    4041<fieldset> 
     
    8990</label></p> 
    9091 
    91 <p><label><?php _e('Jabber / Google Talk:') ?> 
     92<p><label><?php _e('Jabber / Google Talk:') ?><br /> 
    9293<input type="text" name="jabber" value="<?php echo $profileuser->jabber ?>" /></label> 
    9394</p> 
     
    9697<fieldset> 
    9798<legend><?php _e('About Yourself'); ?></legend> 
    98 <p class="desc"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p> 
     99<p class="desc"><?php _e('Share a little biographical information. '); ?></p> 
    99100<p><textarea name="description" rows="5" cols="30"><?php echo $profileuser->description ?></textarea></p> 
    100101</fieldset> 
  • trunk/wp-admin/rtl.css

    r793 r804  
    1 #viewarc, #viewcat, #namediv, #emaildiv, #uridiv, #planetnews li, #login ul li, #your-profile fieldset, .alignleft .available-theme { 
    2         float: right 
    3 
     1#viewarc, #viewcat, #namediv, #emaildiv, #uridiv, #planetnews li, #login ul li, #your-profile fieldset,  
     2        #footer .logo, .alignleft .available-theme { float: right; } 
    43 
    5 #templateside, .alignright { 
    6         float: left; 
    7 
     4#templateside, .alignright { float: left; } 
    85 
    9 #login, #send, .widefat th { 
    10         text-align: right 
    11