Changes in branches/2.8 [11698:11553]
- Location:
- branches/2.8
- Files:
-
- 72 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/readme.html
r11698 r11553 9 9 <h1 id="logo" style="text-align: center"> 10 10 <img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /> 11 <br /> Version 2.8 .111 <br /> Version 2.8 12 12 </h1> 13 13 <p style="text-align: center">Semantic Personal Publishing Platform</p> … … 30 30 <h1>Upgrading</h1> 31 31 <p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p> 32 <h2>Upgrading from any previous WordPress to 2.8 .1:</h2>32 <h2>Upgrading from any previous WordPress to 2.8:</h2> 33 33 <ol> 34 34 <li>Delete your old WP files, saving ones you've modified.</li> -
branches/2.8/wp-admin/admin-ajax.php
r11698 r11553 603 603 die('-1'); 604 604 $search = isset($_POST['s']) ? $_POST['s'] : false; 605 $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all'; 606 $per_page = isset($_POST['per_page']) ? (int) $_POST['per_page'] + 8 : 28; 607 $start = isset($_POST['page']) ? ( intval($_POST['page']) * $per_page ) -1 : $per_page - 1; 608 if ( 1 > $start ) 609 $start = 27; 610 605 $start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24; 606 $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false; 611 607 $mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail'; 612 608 $p = isset($_POST['p']) ? $_POST['p'] : 0; … … 819 815 if ( !current_user_can( 'edit_post', $meta->post_id ) ) 820 816 die('-1'); 821 if ( $meta->meta_value != stripslashes($value) ) { 822 if ( !$u = update_meta( $mid, $key, $value ) ) 823 die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). 824 } 817 if ( !$u = update_meta( $mid, $key, $value ) ) 818 die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). 825 819 826 820 $key = stripslashes($key); -
branches/2.8/wp-admin/admin.php
r11698 r11553 147 147 // Make sure rules are flushed 148 148 global $wp_rewrite; 149 $wp_rewrite->flush_rules( false);149 $wp_rewrite->flush_rules(); 150 150 151 151 exit(); -
branches/2.8/wp-admin/css/colors-classic.css
r11698 r11553 268 268 } 269 269 270 .side-info h5 {270 .side-info h5, .bordertitle { 271 271 border-bottom-color: #dadada; 272 272 } -
branches/2.8/wp-admin/css/colors-fresh.css
r11698 r11553 268 268 } 269 269 270 .side-info h5 {270 .side-info h5, .bordertitle { 271 271 border-bottom-color: #dadada; 272 272 } -
branches/2.8/wp-admin/css/global.css
r11698 r11553 376 376 border-width: 1px; 377 377 border-style: solid; 378 border-collapse: separate; 378 379 border-spacing: 0; 379 380 width: 100%; -
branches/2.8/wp-admin/css/ie.css
r11698 r11553 247 247 #col-container, 248 248 #col-left, 249 #col-right, 250 .fileedit-sub { 249 #col-right { 251 250 display: block; 252 251 zoom: 100%; … … 339 338 } 340 339 341 .widefat {342 empty-cells: show;343 border-collapse: collapse;344 }345 346 340 .tablenav a.button-secondary { 347 341 display: inline-block; -
branches/2.8/wp-admin/css/theme-editor-rtl.css
r11698 r11553 2 2 float: left; 3 3 } 4 #themeselector { 5 padding-right: 0; 6 padding-left: 5px; 7 float: left; 8 } 9 div.tablenav { 10 margin-right: 0; 11 margin-left: 210px; 12 } -
branches/2.8/wp-admin/css/theme-editor.css
r11698 r11553 12 12 float: right; 13 13 width: 190px; 14 word-wrap: break-word;15 14 } 16 15 17 #templateside h3, 18 #postcustomstuff p.submit { 16 #templateside h3, #postcustomstuff p.submit { 19 17 margin: 0; 20 18 } 21 19 22 #templateside h4{23 margin : 1em 0 0;20 h3#bordertitle { 21 margin-bottom: 10px; 24 22 } 25 23 26 #templateside ol, 27 #templateside ul { 24 #templateside h4 { 25 margin-bottom: 0; 26 } 27 28 #templateside ol, #templateside ul { 29 list-style: none; 28 30 margin: .5em; 29 31 padding: 0; 30 32 } 31 33 32 #templateside li { 33 margin: 4px 0; 34 #templateside ol li, #templateside ul li { 35 margin: 1px 0; 36 } 37 38 #themeselector { 39 padding-right: 5px; 40 float: right; 41 position: relative; 42 bottom: 25px; 43 top:20px; 44 } 45 46 #themeselector select { 47 margin: 0; 48 padding: 0; 34 49 } 35 50 … … 40 55 .highlight { 41 56 padding: 1px; 57 } 58 59 div.bordertitle h2 { 60 border: none; 61 padding-bottom: 0; 42 62 } 43 63 … … 54 74 font-weight: bold; 55 75 } 56 57 .fileedit-sub {58 padding: 10px 0 8px;59 line-height: 180%;60 } -
branches/2.8/wp-admin/edit-category-form.php
r11698 r11553 70 70 <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td> 71 71 </tr> 72 <?php do_action('edit_category_form_fields', $category); ?>73 72 </table> 74 73 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Category'); ?>" /></p> -
branches/2.8/wp-admin/edit-comments.php
r11698 r11553 194 194 $start = $offset = ( $page - 1 ) * $comments_per_page; 195 195 196 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 8, $post_id, $comment_type ); // Grab a few extra196 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra 197 197 198 198 $_comment_post_ids = array(); … … 359 359 <input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" /> 360 360 <input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" /> 361 <input type="hidden" name="page" value="<?php echo esc_attr($page); ?>" /> 362 <input type="hidden" name="per_page" value="<?php echo esc_attr($comments_per_page); ?>" /> 361 <input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" /> 363 362 <input type="hidden" name="p" value="<?php echo esc_attr( $post_id ); ?>" /> 364 363 <input type="hidden" name="comment_type" value="<?php echo esc_attr( $comment_type ); ?>" /> -
branches/2.8/wp-admin/edit-link-category-form.php
r11698 r11553 75 75 <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td> 76 76 </tr> 77 <?php do_action('edit_link_category_form_fields', $category); ?>78 77 </table> 79 78 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr($submit_text) ?>" /></p> -
branches/2.8/wp-admin/edit-tag-form.php
r11698 r11553 40 40 <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td> 41 41 </tr> 42 <?php do_action('edit_tag_form_fields', $tag); ?>43 42 </table> 44 43 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Tag'); ?>" /></p> -
branches/2.8/wp-admin/includes/class-wp-filesystem-direct.php
r11698 r11553 21 21 $this->method = 'direct'; 22 22 $this->errors = new WP_Error(); 23 $this->permission = umask(); 23 24 } 24 25 function connect() { … … 64 65 } 65 66 function chmod($file, $mode = false, $recursive = false) { 67 if ( ! $mode ) 68 $mode = $this->permission; 66 69 if ( ! $this->exists($file) ) 67 70 return false; 68 69 if ( ! $mode ) { 70 if ( $this->permission ) 71 $mode = $this->permission; 72 elseif ( $this->is_file($file) ) 73 $mode = FS_CHMOD_FILE; 74 elseif ( $this->is_dir($file) ) 75 $mode = FS_CHMOD_DIR; 76 else 77 return false; 78 } 79 80 if ( ! $recursive ) 81 return @chmod($file, $mode); 71 if ( ! $recursive ) 72 return @chmod($file,$mode); 82 73 if ( ! $this->is_dir($file) ) 83 74 return @chmod($file, $mode); … … 207 198 208 199 function mkdir($path, $chmod = false, $chown = false, $chgrp = false){ 209 if ( ! @mkdir($path) ) 210 return false; 211 $this->chmod($path, $chmod); 200 if ( ! $chmod) 201 $chmod = $this->permission; 202 203 if ( ! @mkdir($path, $chmod) ) 204 return false; 212 205 if ( $chown ) 213 206 $this->chown($path, $chown); -
branches/2.8/wp-admin/includes/class-wp-filesystem-ssh2.php
r11698 r11553 14 14 * @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes 15 15 * 16 * Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now , But many users have found the latest versions work)16 * Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now.) 17 17 * 18 18 * cd /usr/src … … 23 23 * make all install 24 24 * 25 * Note: Do not leave the directory yet!25 * Note: No not leave the directory yet! 26 26 * 27 27 * Enter: pecl install -f ssh2 … … 34 34 * Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp exist. 35 35 * 36 * Note: as of WordPress 2.8, This utilises the PHP5+ function 'stream_get_contents'37 36 * 38 37 * @since 2.7 … … 47 46 var $keys = false; 48 47 /* 49 * This is the timeout value for ssh results .48 * This is the timeout value for ssh results to comeback. 50 49 * Slower servers might need this incressed, but this number otherwise should not change. 51 50 * … … 68 67 return false; 69 68 } 70 if ( ! function_exists('stream_get_contents') ) {71 $this->errors->add('ssh2_php_requirement', __('The ssh2 PHP extension is available, however , we require the PHP5 function <code>stream_get_contents()</code>'));69 if ( ! version_compare(phpversion(), '5', '>=') ) { 70 $this->errors->add('ssh2_php_requirement', __('The ssh2 PHP extension is available, however requires PHP 5+')); 72 71 return false; 73 72 } … … 103 102 104 103 if ( empty ($opt['password']) ) { 105 if ( !$this->keys ) // password can be blank if we are using keys104 if ( !$this->keys ) // password can be blank if we are using keys 106 105 $this->errors->add('empty_password', __('SSH2 password is required')); 107 106 } else { … … 130 129 } else { 131 130 if ( ! @ssh2_auth_pubkey_file($this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) { 132 $this->errors->add('auth', sprintf(__('Public and Private keys incorre ct for %s'), $this->options['username']));131 $this->errors->add('auth', sprintf(__('Public and Private keys incorrent for %s'), $this->options['username'])); 133 132 return false; 134 133 } … … 150 149 stream_set_blocking( $stream, true ); 151 150 stream_set_timeout( $stream, $this->timeout ); 152 $data = stream_get_contents( $stream ); 153 fclose( $stream ); 151 $data = stream_get_contents($stream); 154 152 155 153 if ( $returnbool ) 156 return ( $data === false ) ? false :'' != trim($data);154 return '' != trim($data); 157 155 else 158 156 return $data; … … 169 167 function get_contents($file, $type = '', $resumepos = 0 ) { 170 168 $file = ltrim($file, '/'); 171 return file_get_contents('ssh2.sftp://' . $this->sftp_link . 169 return file_get_contents('ssh2.sftp://' . $this->sftp_link .'/' . $file); 172 170 } 173 171 174 172 function get_contents_array($file) { 175 173 $file = ltrim($file, '/'); 176 return file('ssh2.sftp://' . $this->sftp_link . 174 return file('ssh2.sftp://' . $this->sftp_link .'/' . $file); 177 175 } 178 176 179 177 function put_contents($file, $contents, $type = '' ) { 180 178 $file = ltrim($file, '/'); 181 return file_put_contents('ssh2.sftp://' . $this->sftp_link . 179 return file_put_contents('ssh2.sftp://' . $this->sftp_link .'/' . $file, $contents); 182 180 } 183 181 … … 273 271 274 272 function exists($file) { 275 $file = ltrim($file, '/'); 276 return file_exists('ssh2.sftp://' . $this->sftp_link . '/' . $file); 273 //return $this->run_command(sprintf('ls -lad %s', escapeshellarg($file)), true); 274 $file = ltrim($file, '/'); 275 return file_exists('ssh2.sftp://' . $this->sftp_link .'/' . $file); 277 276 } 278 277 279 278 function is_file($file) { 280 279 $file = ltrim($file, '/'); 281 return is_file('ssh2.sftp://' . $this->sftp_link . 280 return is_file('ssh2.sftp://' . $this->sftp_link .'/' . $file); 282 281 } 283 282 284 283 function is_dir($path) { 285 284 $path = ltrim($path, '/'); 286 return is_dir('ssh2.sftp://' . $this->sftp_link . 285 return is_dir('ssh2.sftp://' . $this->sftp_link .'/' . $path); 287 286 } 288 287 289 288 function is_readable($file) { 290 289 $file = ltrim($file, '/'); 291 return is_readable('ssh2.sftp://' . $this->sftp_link . 290 return is_readable('ssh2.sftp://' . $this->sftp_link .'/' . $file); 292 291 } 293 292 294 293 function is_writable($file) { 295 294 $file = ltrim($file, '/'); 296 return is_writable('ssh2.sftp://' . $this->sftp_link . 295 return is_writable('ssh2.sftp://' . $this->sftp_link .'/' . $file); 297 296 } 298 297 299 298 function atime($file) { 300 299 $file = ltrim($file, '/'); 301 return fileatime('ssh2.sftp://' . $this->sftp_link . 300 return fileatime('ssh2.sftp://' . $this->sftp_link .'/' . $file); 302 301 } 303 302 304 303 function mtime($file) { 305 304 $file = ltrim($file, '/'); 306 return filemtime('ssh2.sftp://' . $this->sftp_link . 305 return filemtime('ssh2.sftp://' . $this->sftp_link .'/' . $file); 307 306 } 308 307 309 308 function size($file) { 310 309 $file = ltrim($file, '/'); 311 return filesize('ssh2.sftp://' . $this->sftp_link . 310 return filesize('ssh2.sftp://' . $this->sftp_link .'/' . $file); 312 311 } 313 312 -
branches/2.8/wp-admin/includes/dashboard.php
r11698 r11553 606 606 607 607 function wp_dashboard_incoming_links() { 608 echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';608 wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' ); 609 609 } 610 610 … … 635 635 echo "<ul>\n"; 636 636 637 if ( !isset($items) ) 638 $items = 10; 639 640 foreach ( $rss->get_items(0, $items) as $item ) { 637 $count = 0; 638 foreach ( $rss->get_items() as $item ) { 641 639 $publisher = ''; 642 640 $site_link = ''; … … 647 645 648 646 $author = $item->get_author(); 649 if ( $author ) { 650 $site_link = esc_url( strip_tags( $author->get_link() ) ); 651 652 if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) ) 653 $publisher = __( 'Somebody' ); 654 } else { 655 $publisher = __( 'Somebody' ); 656 } 647 $site_link = esc_url( strip_tags( $author->get_link() ) ); 648 649 if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) ) 650 $publisher = __( 'Somebody' ); 657 651 if ( $site_link ) 658 652 $publisher = "<a href='$site_link'>$publisher</a>"; … … 691 685 692 686 function wp_dashboard_primary() { 693 echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';687 wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' ); 694 688 } 695 689 … … 713 707 714 708 function wp_dashboard_secondary() { 715 echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';709 wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' ); 716 710 } 717 711 … … 748 742 749 743 function wp_dashboard_plugins() { 750 echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>'; 744 wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array( 745 'http://wordpress.org/extend/plugins/rss/browse/popular/', 746 'http://wordpress.org/extend/plugins/rss/browse/new/', 747 'http://wordpress.org/extend/plugins/rss/browse/updated/' 748 ) ); 751 749 } 752 750 -
branches/2.8/wp-admin/includes/file.php
r11698 r11553 446 446 return new WP_Error('http_no_file', __('Could not create Temporary file')); 447 447 448 $response = wp_remote_get($url, array('timeout' => 60));448 $response = wp_remote_get($url, array('timeout' => 30)); 449 449 450 450 if ( is_wp_error($response) ) { … … 646 646 } 647 647 648 if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && function_exists('stream_get_contents') ) $method = 'ssh2';648 if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && extension_loaded('sockets') ) $method = 'ssh2'; 649 649 if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext'; 650 650 if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread … … 762 762 </tr> 763 763 764 <?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents')) : ?>764 <?php if ( extension_loaded('ssh2') ) : ?> 765 765 <tr id="ssh_keys" valign="top" style="<?php if ( 'ssh' != $connection_type ) echo 'display:none' ?>"> 766 766 <th scope="row"><?php _e('Authentication Keys') ?> … … 782 782 <br /><label><input id="ftps" name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('FTPS (SSL)') ?></label> 783 783 <?php endif; ?> 784 <?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents')) : ?>784 <?php if ( extension_loaded('ssh2') ) : ?> 785 785 <br /><label><input id="ssh" name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('SSH') ?></label> 786 786 <?php endif; ?> -
branches/2.8/wp-admin/includes/manifest.php
r11698 r11553 93 93 if ( @is_file('../wp-includes/js/tinymce/tiny_mce.js') ) : 94 94 $mce = array( 95 array('../wp-includes/js/tinymce/wp-tinymce.php', $mce_ver, true), 95 array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=1&' . $mce_ver, true), 96 array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=0&' . $mce_ver, true), 96 97 97 98 array('../wp-includes/js/tinymce/tiny_mce.js', $mce_ver, true), -
branches/2.8/wp-admin/includes/media.php
r11698 r11553 370 370 } 371 371 add_action( 'media_buttons', 'media_buttons' ); 372 add_action('media_upload_media', 'media_upload_handler'); 372 373 373 374 /** … … 381 382 check_admin_referer('media-form'); 382 383 383 $errors = null;384 $errors = array(); 384 385 385 386 if ( isset($_POST['send']) ) { … … 1312 1313 var settings = { 1313 1314 button_text: '<span class="button"><?php _e('Select Files'); ?></span>', 1314 button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande", Verdana,Arial,"Bitstream Vera Sans",sans-serif; }',1315 button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; }', 1315 1316 button_height: "24", 1316 1317 button_width: "132", 1317 button_text_top_padding: 2,1318 button_text_top_padding: 1, 1318 1319 button_image_url: '<?php echo includes_url('images/upload.png'); ?>', 1319 1320 button_placeholder_id: "flash-browse-button", -
branches/2.8/wp-admin/includes/misc.php
r11698 r11553 73 73 } 74 74 75 if ( !$f = @fopen( $filename, 'w' ) ) 76 return false; 77 75 $f = fopen( $filename, 'w' ); 78 76 $foundit = false; 79 77 if ( $markerdata ) { … … 273 271 return array(); 274 272 275 if ( !function_exists('token_get_all') )276 return array();277 278 273 $tokens = token_get_all( $content ); 279 274 $functions = array(); -
branches/2.8/wp-admin/includes/plugin-install.php
r11698 r11553 47 47 $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']); 48 48 } 49 } elseif ( !is_wp_error($res) ) {50 $res->external = true;51 49 } 52 50 … … 444 442 $type = 'install'; 445 443 //Check to see if this plugin is known to be installed, and has an update awaiting it. 446 $update_plugins = get_ transient('update_plugins');444 $update_plugins = get_option('update_plugins'); 447 445 if ( is_object( $update_plugins ) ) { 448 446 foreach ( (array)$update_plugins->response as $file => $plugin ) { … … 465 463 } else { 466 464 //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh 467 delete_ transient('update_plugins');465 delete_option('update_plugins'); 468 466 $update_file = $api->slug . '/' . $key; //This code branch only deals with a plugin which is in a folder the same name as its slug, Doesnt support plugins which have 'non-standard' names 469 467 $type = 'update_available'; … … 512 510 <?php endif; if ( ! empty($api->downloaded) ) : ?> 513 511 <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li> 514 <?php endif; if ( ! empty($api->slug) && empty($api->external)) : ?>512 <?php endif; if ( ! empty($api->slug) ) : ?> 515 513 <li><a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page »') ?></a></li> 516 514 <?php endif; if ( ! empty($api->homepage) ) : ?> … … 518 516 <?php endif; ?> 519 517 </ul> 520 <?php if ( ! empty($api->rating) ) : ?>521 518 <h2><?php _e('Average Rating') ?></h2> 522 519 <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>"> … … 529 526 </div> 530 527 <small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small> 531 <?php endif; ?>532 528 </div> 533 529 <div id="section-holder" class="wrap"> -
branches/2.8/wp-admin/includes/plugin.php
r11698 r11553 586 586 587 587 function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) { 588 global $menu, $admin_page_hooks , $_registered_pages;588 global $menu, $admin_page_hooks; 589 589 590 590 $file = plugin_basename( $file ); … … 603 603 $menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 604 604 605 $_registered_pages[$hookname] = true;606 607 605 return $hookname; 608 606 } 609 607 610 608 function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 611 global $menu, $admin_page_hooks, $_wp_last_object_menu , $_registered_pages;609 global $menu, $admin_page_hooks, $_wp_last_object_menu; 612 610 613 611 $file = plugin_basename( $file ); … … 626 624 $menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 627 625 628 $_registered_pages[$hookname] = true;629 630 626 return $hookname; 631 627 } 632 628 633 629 function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 634 global $menu, $admin_page_hooks, $_wp_last_utility_menu , $_registered_pages;630 global $menu, $admin_page_hooks, $_wp_last_utility_menu; 635 631 636 632 $file = plugin_basename( $file ); … … 650 646 651 647 $menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 652 653 $_registered_pages[$hookname] = true;654 648 655 649 return $hookname; … … 661 655 global $_wp_real_parent_file; 662 656 global $_wp_submenu_nopriv; 663 global $_registered_pages;664 657 665 658 $file = plugin_basename( $file ); … … 690 683 if (!empty ( $function ) && !empty ( $hookname )) 691 684 add_action( $hookname, $function ); 692 693 $_registered_pages[$hookname] = true;694 // backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php695 if ( 'tools.php' == $parent )696 $_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true;697 685 698 686 return $hookname; … … 932 920 global $_wp_submenu_nopriv; 933 921 global $plugin_page; 934 global $_registered_pages;935 922 936 923 $parent = get_admin_page_parent(); … … 939 926 return false; 940 927 941 if ( isset( $plugin_page ) ) { 942 if ( isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 943 return false; 944 945 $hookname = get_plugin_page_hookname($plugin_page, $parent); 946 if ( !isset($_registered_pages[$hookname]) ) 947 return false; 948 } 928 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 929 return false; 949 930 950 931 if ( empty( $parent) ) { … … 955 936 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) 956 937 return false; 957 if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) )958 return false;959 938 foreach (array_keys( $_wp_submenu_nopriv ) as $key ) { 960 939 if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) ) … … 965 944 return true; 966 945 } 967 968 if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) )969 return false;970 946 971 947 if ( isset( $submenu[$parent] ) ) { -
branches/2.8/wp-admin/includes/template.php
r11698 r11553 1448 1448 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; 1449 1449 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>'; 1450 }1451 if ( current_user_can('delete_post', $post->ID) ) {1452 1450 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1453 1451 } … … 1663 1661 $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; 1664 1662 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1665 }1666 if ( current_user_can('delete_page', $page->ID) ) {1667 1663 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1668 1664 } … … 3476 3472 } 3477 3473 break; 3474 case 'theme-editor': 3475 case 'plugin-editor': 3476 $settings = '<p><a id="codepress-on" href="' . $screen . '.php?codepress=on">' . __('Enable syntax highlighting') . '</a><a id="codepress-off" href="' . $screen . '.php?codepress=off">' . __('Disable syntax highlighting') . "</a></p>\n"; 3477 $show_screen = true; 3478 break; 3478 3479 case 'widgets': 3479 3480 if ( !isset($_wp_contextual_help['widgets']) ) { -
branches/2.8/wp-admin/includes/update-core.php
r11698 r11553 230 230 if ( is_wp_error($result) ) { 231 231 $wp_filesystem->delete($maintenance_file); 232 $wp_filesystem->delete($ from, true);232 $wp_filesystem->delete($working_dir, true); 233 233 return $result; 234 234 } -
branches/2.8/wp-admin/includes/user.php
r11698 r11553 254 254 return array($user->id); 255 255 else 256 return array();256 return false; 257 257 } 258 258 -
branches/2.8/wp-admin/includes/widgets.php
r11698 r11553 98 98 function next_widget_id_number($id_base) { 99 99 global $wp_registered_widgets; 100 $number = 1; 101 102 foreach ( $wp_registered_widgets as $widget_id => $widget ) { 103 if ( preg_match( '/' . $id_base . '-([0-9]+)$/', $widget_id, $matches ) ) 104 $number = max($number, $matches[1]); 105 } 106 $number++; 100 $number = 2; 101 102 while ( isset($wp_registered_widgets["$id_base-$number"]) ) 103 $number++; 107 104 108 105 return $number; -
branches/2.8/wp-admin/js/dashboard.dev.js
r11698 r11553 1 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;2 1 3 2 jQuery(document).ready( function($) { 3 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad; 4 4 // These widgets are sometimes populated via ajax 5 5 ajaxWidgets = [ … … 10 10 ]; 11 11 12 ajaxPopulateWidgets = function(el) { 13 show = function(id, i) { 14 var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading'); 15 if ( e.length ) { 16 p = e.parent(); 17 setTimeout( function(){ 18 p.load('index-extra.php?jax=' + id, '', function() { 19 p.hide().slideDown('normal', function(){ 20 $(this).css('display', ''); 21 if ( 'dashboard_plugins' == id && $.isFunction(tb_init) ) 22 tb_init('#dashboard_plugins a.thickbox'); 23 }); 24 }); 25 }, i * 500 ); 26 } 27 } 28 if ( el ) { 29 el = el.toString(); 30 if ( $.inArray(el, ajaxWidgets) != -1 ) 31 show(el, 0); 32 } else { 33 $.each( ajaxWidgets, function(i) { 34 show(this, i); 35 }); 36 } 12 ajaxPopulateWidgets = function() { 13 $.each( ajaxWidgets, function() { 14 var e = jQuery('#' + this + ':visible div.inside').find('.widget-loading'); 15 if ( e.size() ) { e.parent().load('index-extra.php?jax=' + this); } 16 } ); 37 17 }; 38 18 ajaxPopulateWidgets(); 39 19 40 postboxes.add_postbox_toggles('dashboard', { pbshow: ajaxPopulateWidgets } );20 postboxes.add_postbox_toggles('dashboard', { onShow: ajaxPopulateWidgets } ); 41 21 42 22 /* QuickPress */ -
branches/2.8/wp-admin/js/dashboard.js
r11698 r11553 1 var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load("index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles("dashboard",{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press h3").append('<img src="images/wpspin_light.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press h3 img").remove();a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()});1 jQuery(document).ready(function(c){var a,b,d;a=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];b=function(){c.each(a,function(){var f=jQuery("#"+this+":visible div.inside").find(".widget-loading");if(f.size()){f.parent().load("index-extra.php?jax="+this)}})};b();postboxes.add_postbox_toggles("dashboard",{onShow:b});d=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press h3").append('<img src="images/wpspin_light.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press h3 img").remove();c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");d()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};d()}); -
branches/2.8/wp-admin/js/edit-comments.dev.js
r11698 r11553 24 24 n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); 25 25 if ( n < 0 ) { n = 0; } 26 a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');26 $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); 27 27 n = n.toString(); 28 28 if ( n.length > 3 ) … … 78 78 } 79 79 if ( n < 0 ) { n = 0; } 80 a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');80 $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); 81 81 n = n.toString(); 82 82 if ( n.length > 3 ) -
branches/2.8/wp-admin/js/edit-comments.js
r11698 r11553 1 var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('#comments-form .tablenav :input[name="_total"]');i=a('#comments-form .tablenav :input[name="_per_page"]');h=a('#comments-form .tablenav :input[name="_page"]');c=function(k,j){var l=a("#"+j.element);if(l.is(".unapproved")){l.find("div.comment_status").html("0")}else{l.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}o=o+(a("#"+j.element).is("."+j.dimClass)?1:-1);if(o<0){o=0} m.parents("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};e=function(j){j.data._total=g.val();j.data._per_page=i.val();j.data._page=h.val();j.data._url=document.location.href;if("undefined"!=showNotice&&j.data.action&&j.data.action=="delete-comment"&&!j.data.spam){return showNotice.warn()?j:false}return j};d=function(j,k,l){if(k<f){return}g.val(j.toString());if(l){f=k}a("span.total-type-count").each(function(){var m=a(this),o;o=g.val().toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};b=function(l,j){a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a("#"+j.element).is(".unapproved")){o=o-1}else{if(a(j.target).parents("span.unapprove").size()){o=o+1}}if(o<0){o=0}m.parents("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});a("span.spam-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents("span.spam").size()){o=o+1}else{if(a("#"+j.element).is(".spam")){o=o-1}}if(o<0){o=0}o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});if(("object"==typeof l)&&f<j.parsed.responses[0].supplemental.time){d(j.parsed.responses[0].supplemental.total,j.parsed.responses[0].supplemental.time,true);if(a.trim(j.parsed.responses[0].supplemental.pageLinks)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks))}else{if("undefined"!=typeof j.parsed.responses[0].supplemental.pageLinks){a(".tablenav-pages").find(".page-numbers").remove()}}}else{var k=parseInt(g.val(),10);if(k--<0){k=0}d(k,l,false)}if(theExtraList.size()==0||theExtraList.children().size()==0){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:e,dimAfter:c,delAfter:b,addColor:"none"})};commentReply={init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn("fast").css("backgroundColor","");a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("#edithead input").val("");a("#replysubmit .error").html("").hide();a("#replysubmit .waiting").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o="#comment-"+i;a("#replyrow td").attr("colspan",a(".widefat thead th:visible").length);d=a("#replyrow"),rowData=a("#inline-"+i);b=e.act=(c=="edit")?"edit-comment":"replyto-comment";a("#action",d).val(b);a("#comment_post_ID",d).val(g);a("#comment_ID",d).val(i);if(c=="edit"){a("#author",d).val(a("div.author",rowData).text());a("#author-email",d).val(a("div.author-email",rowData).text());a("#author-url",d).val(a("div.author-url",rowData).text());a("#status",d).val(a("div.comment_status",rowData).text());a("#replycontent",d).val(a("textarea.comment",rowData).val());a("#edithead, #savebtn",d).show();a("#replyhead, #replybtn",d).hide();f=a(e.o).height();if(f>220){if(a.browser.msie){a("#replycontainer, #replycontent",d).height(f-105)}else{a("#replycontainer",d).height(f-105)}}a(e.o).after(d.hide()).fadeOut("fast",function(){a("#replyrow").fadeIn("fast")})}else{a("#edithead, #savebtn",d).hide();a("#replyhead, #replybtn",d).show();a(e.o).after(d);a("#replyrow").hide().fadeIn("fast")}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var l,j,m,h,k;l=a("#replyrow").offset().top;j=l+a("#replyrow").height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20<j){window.scroll(0,j-h+35)}else{if(l-20<m){window.scroll(0,l-35)}}a("#replycontent").focus().keyup(function(n){if(n.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:wpListL10n.url,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}if("edit-comment"==this.act){a(this.o).remove()}e=e.responses[0];g=e.data;a(g).hide();a("#replyrow").after(g);this.o=f="#comment-"+e.id;this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("#comments-form thead #cb input:checkbox").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(h,g){a("option[value="+f+"]").attr("selected","selected");a("form#comments-form")[0].submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q",["e",b],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+x",c],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);1 var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('#comments-form .tablenav :input[name="_total"]');i=a('#comments-form .tablenav :input[name="_per_page"]');h=a('#comments-form .tablenav :input[name="_page"]');c=function(k,j){var l=a("#"+j.element);if(l.is(".unapproved")){l.find("div.comment_status").html("0")}else{l.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}o=o+(a("#"+j.element).is("."+j.dimClass)?1:-1);if(o<0){o=0}a("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};e=function(j){j.data._total=g.val();j.data._per_page=i.val();j.data._page=h.val();j.data._url=document.location.href;if("undefined"!=showNotice&&j.data.action&&j.data.action=="delete-comment"&&!j.data.spam){return showNotice.warn()?j:false}return j};d=function(j,k,l){if(k<f){return}g.val(j.toString());if(l){f=k}a("span.total-type-count").each(function(){var m=a(this),o;o=g.val().toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};b=function(l,j){a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a("#"+j.element).is(".unapproved")){o=o-1}else{if(a(j.target).parents("span.unapprove").size()){o=o+1}}if(o<0){o=0}a("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});a("span.spam-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents("span.spam").size()){o=o+1}else{if(a("#"+j.element).is(".spam")){o=o-1}}if(o<0){o=0}o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});if(("object"==typeof l)&&f<j.parsed.responses[0].supplemental.time){d(j.parsed.responses[0].supplemental.total,j.parsed.responses[0].supplemental.time,true);if(a.trim(j.parsed.responses[0].supplemental.pageLinks)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks))}else{if("undefined"!=typeof j.parsed.responses[0].supplemental.pageLinks){a(".tablenav-pages").find(".page-numbers").remove()}}}else{var k=parseInt(g.val(),10);if(k--<0){k=0}d(k,l,false)}if(theExtraList.size()==0||theExtraList.children().size()==0){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:e,dimAfter:c,delAfter:b,addColor:"none"})};commentReply={init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn("fast").css("backgroundColor","");a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("#edithead input").val("");a("#replysubmit .error").html("").hide();a("#replysubmit .waiting").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o="#comment-"+i;a("#replyrow td").attr("colspan",a(".widefat thead th:visible").length);d=a("#replyrow"),rowData=a("#inline-"+i);b=e.act=(c=="edit")?"edit-comment":"replyto-comment";a("#action",d).val(b);a("#comment_post_ID",d).val(g);a("#comment_ID",d).val(i);if(c=="edit"){a("#author",d).val(a("div.author",rowData).text());a("#author-email",d).val(a("div.author-email",rowData).text());a("#author-url",d).val(a("div.author-url",rowData).text());a("#status",d).val(a("div.comment_status",rowData).text());a("#replycontent",d).val(a("textarea.comment",rowData).val());a("#edithead, #savebtn",d).show();a("#replyhead, #replybtn",d).hide();f=a(e.o).height();if(f>220){if(a.browser.msie){a("#replycontainer, #replycontent",d).height(f-105)}else{a("#replycontainer",d).height(f-105)}}a(e.o).after(d.hide()).fadeOut("fast",function(){a("#replyrow").fadeIn("fast")})}else{a("#edithead, #savebtn",d).hide();a("#replyhead, #replybtn",d).show();a(e.o).after(d);a("#replyrow").hide().fadeIn("fast")}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var l,j,m,h,k;l=a("#replyrow").offset().top;j=l+a("#replyrow").height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20<j){window.scroll(0,j-h+35)}else{if(l-20<m){window.scroll(0,l-35)}}a("#replycontent").focus().keyup(function(n){if(n.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:wpListL10n.url,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}if("edit-comment"==this.act){a(this.o).remove()}e=e.responses[0];g=e.data;a(g).hide();a("#replyrow").after(g);this.o=f="#comment-"+e.id;this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("#comments-form thead #cb input:checkbox").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(h,g){a("option[value="+f+"]").attr("selected","selected");a("form#comments-form")[0].submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q",["e",b],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+x",c],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery); -
branches/2.8/wp-admin/js/post.dev.js
r11698 r11553 213 213 var noSyncChecks = false, syncChecks, catAddAfter, stamp = $('#timestamp').html(), visibility = $('#post-visibility-display').html(), sticky = ''; 214 214 215 // for Press This 216 if ( typeof autosave != 'function' ) 217 autosave = function(){}; 218 215 219 // postboxes 216 220 postboxes.add_postbox_toggles('post'); … … 222 226 tag_init(); 223 227 224 $('#title').blur( function() { 225 if ( ($("#post_ID").val() > 0) || ($("#title").val().length == 0) ) 226 return; 227 228 if ( typeof(autosave) != 'undefined' ) 229 autosave(); 230 }); 228 $('#title').blur( function() { if ( ($("#post_ID").val() > 0) || ($("#title").val().length == 0) ) return; autosave(); } ); 231 229 232 230 // auto-suggest stuff … … 480 478 $('#the-list').wpList( { addAfter: function( xml, s ) { 481 479 $('table#list-table').show(); 482 if ( typeof( autosave_update_post_ID ) != 'undefined') {480 if ( $.isFunction( autosave_update_post_ID ) ) { 483 481 autosave_update_post_ID(s.parsed.responses[0].supplemental.postid); 484 482 } -
branches/2.8/wp-admin/js/post.js
r11698 r11553 1 function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}function new_tag_remove_tag(){var e=jQuery(this).attr("id"),a=e.split("-check-num-")[1],c=jQuery(this).parents(".tagsdiv"),b=c.find(".the-tags").val().split(","),d=[];delete b[a];jQuery.each(b,function(f,g){g=jQuery.trim(g);if(g){d.push(g)}});c.find(".the-tags").val(d.join(",").replace(/\s*,+\s*/,",").replace(/,+/,",").replace(/,+\s+,+/,",").replace(/,+\s*$/,"").replace(/^\s*,+/,""));tag_update_quickclicks(c);return false}function tag_update_quickclicks(b){if(jQuery(b).find(".the-tags").length==0){return}var a=jQuery(b).find(".the-tags").val().split(",");jQuery(b).find(".tagchecklist").empty();shown=false;jQuery.each(a,function(e,f){var c,d;f=jQuery.trim(f);if(!f.match(/^\s+$/)&&""!=f){d=jQuery(b).attr("id")+"-check-num-"+e;c='<span><a id="'+d+'" class="ntdelbutton">X</a> '+f+"</span> ";jQuery(b).find(".tagchecklist").append(c);jQuery("#"+d).click(new_tag_remove_tag)}});if(shown){jQuery(b).find(".tagchecklist").prepend("<strong>"+postL10n.tagsUsed+"</strong><br />")}}function tag_flush_to_text(g,b){b=b||false;var e,f,c,d;e=jQuery("#"+g);f=b?jQuery(b).text():e.find("input.newtag").val();if(e.find("input.newtag").hasClass("form-input-tip")&&!b){return false}c=e.find(".the-tags").val();d=c?c+","+f:f;d=d.replace(/\s+,+\s*/g,",").replace(/,+/g,",").replace(/,+\s+,+/g,",").replace(/,+\s*$/g,"").replace(/^\s*,+/g,"");d=array_unique_noempty(d.split(",")).join(",");e.find(".the-tags").val(d);tag_update_quickclicks(e);if(!b){e.find("input.newtag").val("").focus()}return false}function tag_save_on_publish(){jQuery(".tagsdiv").each(function(a){if(!jQuery(this).find("input.newtag").hasClass("form-input-tip")){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))}})}function tag_press_key(a){if(13==a.which){tag_flush_to_text(jQuery(a.target).parents(".tagsdiv").attr("id"));return false}}function tag_init(){jQuery(".ajaxtag").show();jQuery(".tagsdiv").each(function(a){tag_update_quickclicks(this)});jQuery(".ajaxtag input.tagadd").click(function(){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))});jQuery(".ajaxtag input.newtag").focus(function(){if(!this.cleared){this.cleared=true;jQuery(this).val("").removeClass("form-input-tip")}});jQuery(".ajaxtag input.newtag").blur(function(){if(this.value==""){this.cleared=false;jQuery(this).val(postL10n.addTag).addClass("form-input-tip")}});jQuery("#publish").click(tag_save_on_publish);jQuery("#save-post").click(tag_save_on_publish);jQuery(".ajaxtag input.newtag").keypress(tag_press_key)}var commentsBox,tagCloud;(function(a){commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="5">'+wpAjax.broken+"</td></tr>")});return false}};tagCloud={init:function(){a(".tagcloud-link").click(function(){tagCloud.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){var f=a(this).parents("p").attr("id");tag_flush_to_text(f.substr(f.indexOf("-")+1),this);return false});a("#"+c).after(e)})}};a(document).ready(function(){tagCloud.init()})})(jQuery);jQuery(document).ready(function(g){var d=false,i,e,a=g("#timestamp").html(),b=g("#post-visibility-display").html(),h=""; postboxes.add_postbox_toggles("post");make_slugedit_clickable();tag_init();g("#title").blur(function(){if((g("#post_ID").val()>0)||(g("#title").val().length==0)){return}if(typeof(autosave)!="undefined"){autosave()}});g(".newtag").each(function(){var j=g(this).parents("div.tagsdiv").attr("id");g(this).suggest("admin-ajax.php?action=ajax-tag-search&tax="+j,{delay:500,minchars:2,multiple:true,multipleSep:", "})});g("#category-tabs a").click(function(){var j=g(this).attr("href");g(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g(".tabs-panel").hide();g(j).show();if("#categories-all"==j){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){g('#category-tabs a[href="#categories-pop"]').click()}g("#newcat").one("focus",function(){g(this).val("").removeClass("form-input-tip")});g("#category-add-sumbit").click(function(){g("#newcat").focus()});i=function(){if(d){return}d=true;var j=jQuery(this),l=j.is(":checked"),k=j.val().toString();g("#in-category-"+k+", #in-popular-category-"+k).attr("checked",l);d=false};popularCats=g("#categorychecklist-pop :checkbox").map(function(){return parseInt(jQuery(this).val(),10)}).get().join(",");catAddBefore=function(j){if(!g("#newcat").val()){return false}j.data+="&popular_ids="+popularCats+"&"+jQuery("#categorychecklist :checked").serialize();return j};e=function(m,k){var j=jQuery("#newcat_parent"),l=j.find('option[value="-1"]');g(k.what+" response_data",m).each(function(){var n=g(g(this).text());n.find("label").each(function(){var q=g(this),s=q.find("input").val(),t=q.find("input")[0].id,p,r;g("#"+t).change(i).change();if(j.find('option[value="'+s+'"]').size()){return}p=g.trim(q.text());r=g('<option value="'+parseInt(s,10)+'"></option>').text(p);j.prepend(r)});l.attr("selected","selected")})};g("#categorychecklist").wpList({alt:"",response:"category-ajax-response",addBefore:catAddBefore,addAfter:e});g("#category-add-toggle").click(function(){g("#category-adder").toggleClass("wp-hidden-children");g('#category-tabs a[href="#categories-all"]').click();return false});g(".categorychecklist .popular-category :checkbox").change(i).filter(":checked").change(),h="";function f(){if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false);g("#sticky-span").hide()}else{g("#sticky-span").show()}if(g("#post-visibility-select input:radio:checked").val()!="password"){g("#password-span").hide()}else{g("#password-span").show()}}function c(){var j,l,k,m;j=new Date(g("#aa").val(),g("#mm").val()-1,g("#jj").val(),g("#hh").val(),g("#mn").val());l=new Date(g("#hidden_aa").val(),g("#hidden_mm").val()-1,g("#hidden_jj").val(),g("#hidden_hh").val(),g("#hidden_mn").val());k=new Date(g("#cur_aa").val(),g("#cur_mm").val()-1,g("#cur_jj").val(),g("#cur_hh").val(),g("#cur_mn").val());if(j>k&&g("#original_post_status").val()!="future"){m=postL10n.publishOnFuture;g("#publish").val(postL10n.schedule)}else{if(j<=k&&g("#original_post_status").val()!="publish"){m=postL10n.publishOn;g("#publish").val(postL10n.publish)}else{m=postL10n.publishOnPast;g("#publish").val(postL10n.update)}}if(l.toUTCString()==j.toUTCString()){g("#timestamp").html(a)}else{g("#timestamp").html(m+" <b>"+g("#mm option[value="+g("#mm").val()+"]").text()+" "+g("#jj").val()+", "+g("#aa").val()+" @ "+g("#hh").val()+":"+g("#mn").val()+"</b> ")}if(g("#post-visibility-select input:radio:checked").val()=="private"){g("#publish").val(postL10n.update);if(g("#post_status option[value=publish]").length==0){g("#post_status").append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}g("#post_status option[value=publish]").html(postL10n.privatelyPublished);g("#post_status option[value=publish]").attr("selected",true);g(".edit-post-status").hide()}else{if(g("#original_post_status").val()=="future"||g("#original_post_status").val()=="draft"){if(g("#post_status option[value=publish]").length!=0){g("#post_status option[value=publish]").remove();g("#post_status").val(g("#hidden_post_status").val())}}else{g("#post_status option[value=publish]").html(postL10n.published)}g(".edit-post-status").show()}g("#post-status-display").html(g("#post_status :selected").text());if(g("#post_status :selected").val()=="private"||g("#post_status :selected").val()=="publish"){g("#save-post").hide()}else{g("#save-post").show();if(g("#post_status :selected").val()=="pending"){g("#save-post").show().val(postL10n.savePending)}else{g("#save-post").show().val(postL10n.saveDraft)}}}g(".edit-visibility").click(function(){if(g("#post-visibility-select").is(":hidden")){f();g("#post-visibility-select").slideDown("normal");g(".edit-visibility").hide()}return false});g(".cancel-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g("#visibility-radio-"+g("#hidden-post-visibility").val()).attr("checked",true);g("#post_password").val(g("#hidden_post_password").val());g("#sticky").attr("checked",g("#hidden-post-sticky").attr("checked"));g("#post-visibility-display").html(b);g(".edit-visibility").show();c();return false});g(".save-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g(".edit-visibility").show();c();if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false)}if(true==g("#sticky").attr("checked")){h="Sticky"}else{h=""}g("#post-visibility-display").html(postL10n[g("#post-visibility-select input:radio:checked").val()+h]);return false});g("#post-visibility-select input:radio").change(function(){f()});g(".edit-timestamp").click(function(){if(g("#timestampdiv").is(":hidden")){g("#timestampdiv").slideDown("normal");g(".edit-timestamp").hide()}return false});g(".cancel-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g("#mm").val(g("#hidden_mm").val());g("#jj").val(g("#hidden_jj").val());g("#aa").val(g("#hidden_aa").val());g("#hh").val(g("#hidden_hh").val());g("#mn").val(g("#hidden_mn").val());g(".edit-timestamp").show();c();return false});g(".save-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g(".edit-timestamp").show();c();return false});g(".edit-post-status").click(function(){if(g("#post-status-select").is(":hidden")){g("#post-status-select").slideDown("normal");g(this).hide()}return false});g(".save-post-status").click(function(){g("#post-status-select").slideUp("normal");g(".edit-post-status").show();c();return false});g(".cancel-post-status").click(function(){g("#post-status-select").slideUp("normal");g("#post_status").val(g("#hidden_post_status").val());g(".edit-post-status").show();c();return false});g("#the-list").wpList({addAfter:function(j,k){g("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+="&post_id="+g("#post_ID").val();return j}})});1 function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}function new_tag_remove_tag(){var e=jQuery(this).attr("id"),a=e.split("-check-num-")[1],c=jQuery(this).parents(".tagsdiv"),b=c.find(".the-tags").val().split(","),d=[];delete b[a];jQuery.each(b,function(f,g){g=jQuery.trim(g);if(g){d.push(g)}});c.find(".the-tags").val(d.join(",").replace(/\s*,+\s*/,",").replace(/,+/,",").replace(/,+\s+,+/,",").replace(/,+\s*$/,"").replace(/^\s*,+/,""));tag_update_quickclicks(c);return false}function tag_update_quickclicks(b){if(jQuery(b).find(".the-tags").length==0){return}var a=jQuery(b).find(".the-tags").val().split(",");jQuery(b).find(".tagchecklist").empty();shown=false;jQuery.each(a,function(e,f){var c,d;f=jQuery.trim(f);if(!f.match(/^\s+$/)&&""!=f){d=jQuery(b).attr("id")+"-check-num-"+e;c='<span><a id="'+d+'" class="ntdelbutton">X</a> '+f+"</span> ";jQuery(b).find(".tagchecklist").append(c);jQuery("#"+d).click(new_tag_remove_tag)}});if(shown){jQuery(b).find(".tagchecklist").prepend("<strong>"+postL10n.tagsUsed+"</strong><br />")}}function tag_flush_to_text(g,b){b=b||false;var e,f,c,d;e=jQuery("#"+g);f=b?jQuery(b).text():e.find("input.newtag").val();if(e.find("input.newtag").hasClass("form-input-tip")&&!b){return false}c=e.find(".the-tags").val();d=c?c+","+f:f;d=d.replace(/\s+,+\s*/g,",").replace(/,+/g,",").replace(/,+\s+,+/g,",").replace(/,+\s*$/g,"").replace(/^\s*,+/g,"");d=array_unique_noempty(d.split(",")).join(",");e.find(".the-tags").val(d);tag_update_quickclicks(e);if(!b){e.find("input.newtag").val("").focus()}return false}function tag_save_on_publish(){jQuery(".tagsdiv").each(function(a){if(!jQuery(this).find("input.newtag").hasClass("form-input-tip")){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))}})}function tag_press_key(a){if(13==a.which){tag_flush_to_text(jQuery(a.target).parents(".tagsdiv").attr("id"));return false}}function tag_init(){jQuery(".ajaxtag").show();jQuery(".tagsdiv").each(function(a){tag_update_quickclicks(this)});jQuery(".ajaxtag input.tagadd").click(function(){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))});jQuery(".ajaxtag input.newtag").focus(function(){if(!this.cleared){this.cleared=true;jQuery(this).val("").removeClass("form-input-tip")}});jQuery(".ajaxtag input.newtag").blur(function(){if(this.value==""){this.cleared=false;jQuery(this).val(postL10n.addTag).addClass("form-input-tip")}});jQuery("#publish").click(tag_save_on_publish);jQuery("#save-post").click(tag_save_on_publish);jQuery(".ajaxtag input.newtag").keypress(tag_press_key)}var commentsBox,tagCloud;(function(a){commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="5">'+wpAjax.broken+"</td></tr>")});return false}};tagCloud={init:function(){a(".tagcloud-link").click(function(){tagCloud.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){var f=a(this).parents("p").attr("id");tag_flush_to_text(f.substr(f.indexOf("-")+1),this);return false});a("#"+c).after(e)})}};a(document).ready(function(){tagCloud.init()})})(jQuery);jQuery(document).ready(function(g){var d=false,i,e,a=g("#timestamp").html(),b=g("#post-visibility-display").html(),h="";if(typeof autosave!="function"){autosave=function(){}}postboxes.add_postbox_toggles("post");make_slugedit_clickable();tag_init();g("#title").blur(function(){if((g("#post_ID").val()>0)||(g("#title").val().length==0)){return}autosave()});g(".newtag").each(function(){var j=g(this).parents("div.tagsdiv").attr("id");g(this).suggest("admin-ajax.php?action=ajax-tag-search&tax="+j,{delay:500,minchars:2,multiple:true,multipleSep:", "})});g("#category-tabs a").click(function(){var j=g(this).attr("href");g(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g(".tabs-panel").hide();g(j).show();if("#categories-all"==j){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){g('#category-tabs a[href="#categories-pop"]').click()}g("#newcat").one("focus",function(){g(this).val("").removeClass("form-input-tip")});g("#category-add-sumbit").click(function(){g("#newcat").focus()});i=function(){if(d){return}d=true;var j=jQuery(this),l=j.is(":checked"),k=j.val().toString();g("#in-category-"+k+", #in-popular-category-"+k).attr("checked",l);d=false};popularCats=g("#categorychecklist-pop :checkbox").map(function(){return parseInt(jQuery(this).val(),10)}).get().join(",");catAddBefore=function(j){if(!g("#newcat").val()){return false}j.data+="&popular_ids="+popularCats+"&"+jQuery("#categorychecklist :checked").serialize();return j};e=function(m,k){var j=jQuery("#newcat_parent"),l=j.find('option[value="-1"]');g(k.what+" response_data",m).each(function(){var n=g(g(this).text());n.find("label").each(function(){var q=g(this),s=q.find("input").val(),t=q.find("input")[0].id,p,r;g("#"+t).change(i).change();if(j.find('option[value="'+s+'"]').size()){return}p=g.trim(q.text());r=g('<option value="'+parseInt(s,10)+'"></option>').text(p);j.prepend(r)});l.attr("selected","selected")})};g("#categorychecklist").wpList({alt:"",response:"category-ajax-response",addBefore:catAddBefore,addAfter:e});g("#category-add-toggle").click(function(){g("#category-adder").toggleClass("wp-hidden-children");g('#category-tabs a[href="#categories-all"]').click();return false});g(".categorychecklist .popular-category :checkbox").change(i).filter(":checked").change(),h="";function f(){if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false);g("#sticky-span").hide()}else{g("#sticky-span").show()}if(g("#post-visibility-select input:radio:checked").val()!="password"){g("#password-span").hide()}else{g("#password-span").show()}}function c(){var j,l,k,m;j=new Date(g("#aa").val(),g("#mm").val()-1,g("#jj").val(),g("#hh").val(),g("#mn").val());l=new Date(g("#hidden_aa").val(),g("#hidden_mm").val()-1,g("#hidden_jj").val(),g("#hidden_hh").val(),g("#hidden_mn").val());k=new Date(g("#cur_aa").val(),g("#cur_mm").val()-1,g("#cur_jj").val(),g("#cur_hh").val(),g("#cur_mn").val());if(j>k&&g("#original_post_status").val()!="future"){m=postL10n.publishOnFuture;g("#publish").val(postL10n.schedule)}else{if(j<=k&&g("#original_post_status").val()!="publish"){m=postL10n.publishOn;g("#publish").val(postL10n.publish)}else{m=postL10n.publishOnPast;g("#publish").val(postL10n.update)}}if(l.toUTCString()==j.toUTCString()){g("#timestamp").html(a)}else{g("#timestamp").html(m+" <b>"+g("#mm option[value="+g("#mm").val()+"]").text()+" "+g("#jj").val()+", "+g("#aa").val()+" @ "+g("#hh").val()+":"+g("#mn").val()+"</b> ")}if(g("#post-visibility-select input:radio:checked").val()=="private"){g("#publish").val(postL10n.update);if(g("#post_status option[value=publish]").length==0){g("#post_status").append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}g("#post_status option[value=publish]").html(postL10n.privatelyPublished);g("#post_status option[value=publish]").attr("selected",true);g(".edit-post-status").hide()}else{if(g("#original_post_status").val()=="future"||g("#original_post_status").val()=="draft"){if(g("#post_status option[value=publish]").length!=0){g("#post_status option[value=publish]").remove();g("#post_status").val(g("#hidden_post_status").val())}}else{g("#post_status option[value=publish]").html(postL10n.published)}g(".edit-post-status").show()}g("#post-status-display").html(g("#post_status :selected").text());if(g("#post_status :selected").val()=="private"||g("#post_status :selected").val()=="publish"){g("#save-post").hide()}else{g("#save-post").show();if(g("#post_status :selected").val()=="pending"){g("#save-post").show().val(postL10n.savePending)}else{g("#save-post").show().val(postL10n.saveDraft)}}}g(".edit-visibility").click(function(){if(g("#post-visibility-select").is(":hidden")){f();g("#post-visibility-select").slideDown("normal");g(".edit-visibility").hide()}return false});g(".cancel-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g("#visibility-radio-"+g("#hidden-post-visibility").val()).attr("checked",true);g("#post_password").val(g("#hidden_post_password").val());g("#sticky").attr("checked",g("#hidden-post-sticky").attr("checked"));g("#post-visibility-display").html(b);g(".edit-visibility").show();c();return false});g(".save-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g(".edit-visibility").show();c();if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false)}if(true==g("#sticky").attr("checked")){h="Sticky"}else{h=""}g("#post-visibility-display").html(postL10n[g("#post-visibility-select input:radio:checked").val()+h]);return false});g("#post-visibility-select input:radio").change(function(){f()});g(".edit-timestamp").click(function(){if(g("#timestampdiv").is(":hidden")){g("#timestampdiv").slideDown("normal");g(".edit-timestamp").hide()}return false});g(".cancel-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g("#mm").val(g("#hidden_mm").val());g("#jj").val(g("#hidden_jj").val());g("#aa").val(g("#hidden_aa").val());g("#hh").val(g("#hidden_hh").val());g("#mn").val(g("#hidden_mn").val());g(".edit-timestamp").show();c();return false});g(".save-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g(".edit-timestamp").show();c();return false});g(".edit-post-status").click(function(){if(g("#post-status-select").is(":hidden")){g("#post-status-select").slideDown("normal");g(this).hide()}return false});g(".save-post-status").click(function(){g("#post-status-select").slideUp("normal");g(".edit-post-status").show();c();return false});g(".cancel-post-status").click(function(){g("#post-status-select").slideUp("normal");g("#post_status").val(g("#hidden_post_status").val());g(".edit-post-status").show();c();return false});g("#the-list").wpList({addAfter:function(j,k){g("table#list-table").show();if(g.isFunction(autosave_update_post_ID)){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+="&post_id="+g("#post_ID").val();return j}})}); -
branches/2.8/wp-admin/js/postbox.dev.js
r11698 r11553 5 5 this.init(page,args); 6 6 $('.postbox h3, .postbox .handlediv').click( function() { 7 var p = $(this).parent('.postbox'), id = p.attr('id'); 7 var p = $(this).parent('.postbox'); 8 /* 9 if ( p.hasClass('noclick') ) { 10 p.removeClass('noclick'); 11 return false; 12 } 13 */ 8 14 p.toggleClass('closed'); 9 15 postboxes.save_state(page); 10 if ( id ) {11 if ( !p.hasClass('closed') && $.isFunction(postboxes.pbshow) )12 postboxes.pbshow(id);13 else if ( p.hasClass('closed') && $.isFunction(postboxes.pbhide) )14 postboxes.pbhide(id);15 }16 16 } ); 17 17 $('.postbox h3 a').click( function(e) { -
branches/2.8/wp-admin/js/postbox.js
r11698 r11553 1 var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox") ,f=e.attr("id");e.toggleClass("closed");postboxes.save_state(c);if(f){if(!e.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(f)}else{if(e.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(f)}}}});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(postboxL10n.requestFile,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(postboxL10n.requestFile,b)},pbshow:false,pbhide:false}}(jQuery));1 var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox");e.toggleClass("closed");postboxes.save_state(c)});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(postboxL10n.requestFile,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(postboxL10n.requestFile,b)},pbshow:false,pbhide:false}}(jQuery)); -
branches/2.8/wp-admin/link-parse-opml.php
r11698 r11553 7 7 */ 8 8 9 if ( ! defined('ABSPATH') ) 10 die();9 /** Load WordPress Bootstrap */ 10 require_once('../wp-load.php'); 11 11 12 12 global $opml, $map; -
branches/2.8/wp-admin/media-upload.php
r11698 r11553 30 30 31 31 if ( isset($_GET['inline']) ) { 32 $errors = array(); 32 33 if ( isset($_GET['upload-page-form']) ) { 34 $errors = media_upload_form_handler(); 35 36 $location = 'upload.php'; 37 if ( $errors ) 38 $location .= '?message=3'; 39 40 wp_redirect( admin_url($location) ); 41 } 33 42 34 43 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { … … 40 49 $id = false; 41 50 } 42 }43 44 if ( isset($_GET['upload-page-form']) ) {45 $errors = array_merge($errors, (array) media_upload_form_handler());46 47 $location = 'upload.php';48 if ( $errors )49 $location .= '?message=3';50 51 wp_redirect( admin_url($location) );52 51 } 53 52 -
branches/2.8/wp-admin/menu-header.php
r11698 r11553 75 75 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 76 76 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 77 $menu_file = $submenu[$item[2]][0][2]; 78 if ( false !== $pos = strpos($menu_file, '?') ) 79 $menu_file = substr($menu_file, 0, $pos); 80 if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") ) || !empty($menu_hook)) { 77 if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") ) || !empty($menu_hook)) { 81 78 $admin_is_parent = true; 82 79 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu[$item[2]][0][2]}'>$img</a></div>$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>{$item[0]}</a>"; … … 86 83 } else if ( current_user_can($item[1]) ) { 87 84 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 88 $menu_file = $item[2]; 89 if ( false !== $pos = strpos($menu_file, '?') ) 90 $menu_file = substr($menu_file, 0, $pos); 91 if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") || !empty($menu_hook) ) { 85 if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) { 92 86 $admin_is_parent = true; 93 87 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}'>$img</a></div>$toggle<a href='admin.php?page={$item[2]}'$class$tabindex>{$item[0]}</a>"; … … 109 103 $first = false; 110 104 } 111 112 $menu_file = $item[2];113 if ( false !== $pos = strpos($menu_file, '?') )114 $menu_file = substr($menu_file, 0, $pos);115 116 105 if ( isset($submenu_file) ) { 117 106 if ( $submenu_file == $sub_item[2] ) … … 119 108 // If plugin_page is set the parent must either match the current page or not physically exist. 120 109 // This allows plugin pages with the same hook to exist under different parents. 121 } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2] && (!file_exists($ menu_file) || ($item[2] == $self))) || (!isset($plugin_page) && $self == $sub_item[2]) ) {110 } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2] && (!file_exists($item[2]) || ($item[2] == $self))) || (!isset($plugin_page) && $self == $sub_item[2]) ) { 122 111 $class[] = 'current'; 123 112 } … … 126 115 127 116 $menu_hook = get_plugin_page_hook($sub_item[2], $item[2]); 128 $sub_file = $sub_item[2];129 if ( false !== $pos = strpos($sub_file, '?') )130 $sub_file = substr($sub_file, 0, $pos);131 117 132 if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/ $sub_file") ) || ! empty($menu_hook) ) {118 if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") ) || ! empty($menu_hook) ) { 133 119 // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir 134 135 $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file); 120 $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]); 136 121 if ( $parent_exists ) 137 122 echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>"; -
branches/2.8/wp-admin/options-general.php
r11698 r11553 158 158 <br /> 159 159 <span> 160 <?php if ( $tzstring) : ?>160 <?php if (get_option('timezone_string')) : ?> 161 161 <?php 162 162 $now = localtime(time(),true); … … 166 166 <br /> 167 167 <?php 168 if (function_exists('timezone_transitions_get') ) {168 if (function_exists('timezone_transitions_get') && $tzstring) { 169 169 $dateTimeZoneSelected = new DateTimeZone($tzstring); 170 170 foreach (timezone_transitions_get($dateTimeZoneSelected) as $tr) { 171 171 if ($tr['ts'] > time()) { 172 $found = true;172 $found = true; 173 173 break; 174 174 } … … 180 180 __('Daylight savings time begins on: <code>%s</code>.') : 181 181 __('Standard time begins on: <code>%s</code>.'); 182 printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $tr['ts'] ) ); 182 $tz = new DateTimeZone($tzstring); 183 $d = new DateTime( "@{$tr['ts']}" ); 184 $d->setTimezone($tz); 185 printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $d->format('U') ) ); 183 186 } else { 184 187 _e('This timezone does not observe daylight savings time.'); -
branches/2.8/wp-admin/plugin-editor.php
r11698 r11553 84 84 } 85 85 86 if ( use_codepress() ) 87 wp_enqueue_script( 'codepress' ); 88 86 89 // List of allowable extensions 87 90 $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include'); … … 109 112 $functions = wp_doc_link_parse( $content ); 110 113 111 if ( !empty($functions) ) { 112 $docs_select = '<select name="docs-list" id="docs-list">'; 113 $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>'; 114 foreach ( $functions as $function) { 115 $docs_select .= '<option value="' . esc_attr( $function ) . '">' . htmlspecialchars( $function ) . '()</option>'; 116 } 117 $docs_select .= '</select>'; 114 $docs_select = '<select name="docs-list" id="docs-list">'; 115 $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>'; 116 foreach ( $functions as $function) { 117 $docs_select .= '<option value="' . esc_attr( $function ) . '">' . htmlspecialchars( $function ) . '()</option>'; 118 118 } 119 $docs_select .= '</select>'; 119 120 } 120 121 … … 136 137 <?php screen_icon(); ?> 137 138 <h2><?php echo esc_html( $title ); ?></h2> 138 139 <div class="fileedit-sub"> 139 <div class="bordertitle"> 140 <form id="themeselector" action="plugin-editor.php" method="post"> 141 <strong><label for="plugin"><?php _e('Select plugin to edit:'); ?> </label></strong> 142 <select name="plugin" id="plugin"> 143 <?php 144 foreach ( $plugins as $plugin_key => $a_plugin ) { 145 $plugin_name = $a_plugin['Name']; 146 if ( $plugin_key == $plugin ) 147 $selected = " selected='selected'"; 148 else 149 $selected = ''; 150 $plugin_name = esc_attr($plugin_name); 151 $plugin_key = esc_attr($plugin_key); 152 echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>"; 153 } 154 ?> 155 </select> 156 <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" /> 157 </form> 158 </div> 159 <div class="tablenav"> 140 160 <div class="alignleft"> 141 161 <big><?php … … 153 173 ?></big> 154 174 </div> 155 <div class="alignright">156 <form action="plugin-editor.php" method="post">157 <strong><label for="plugin"><?php _e('Select plugin to edit:'); ?> </label></strong>158 <select name="plugin" id="plugin">159 <?php160 foreach ( $plugins as $plugin_key => $a_plugin ) {161 $plugin_name = $a_plugin['Name'];162 if ( $plugin_key == $plugin )163 $selected = " selected='selected'";164 else165 $selected = '';166 $plugin_name = esc_attr($plugin_name);167 $plugin_key = esc_attr($plugin_key);168 echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>";169 }170 ?>171 </select>172 <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />173 </form>174 </div>175 175 <br class="clear" /> 176 176 </div> 177 178 <div id="templateside">179 <h3 ><?php _e('Plugin Files'); ?></h3>177 <br class="clear" /> 178 <div id="templateside"> 179 <h3 id="bordertitle"><?php _e('Plugin Files'); ?></h3> 180 180 181 181 <ul> … … 196 196 <?php endforeach; ?> 197 197 </ul> 198 </div>199 <form name="template" id="template" action="plugin-editor.php" method="post">198 </div> 199 <form name="template" id="template" action="plugin-editor.php" method="post"> 200 200 <?php wp_nonce_field('edit-plugin_' . $file) ?> 201 201 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea> … … 204 204 <input type="hidden" name="plugin" value="<?php echo esc_attr($plugin) ?>" /> 205 205 </div> 206 <?php if ( !empty( $docs_select) ) : ?>206 <?php if ( isset( $functions ) ) : ?> 207 207 <div id="documentation"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div> 208 208 <?php endif; ?> … … 222 222 <p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p> 223 223 <?php endif; ?> 224 </form>225 < br class="clear" />224 </form> 225 <div class="clear"> </div> 226 226 </div> 227 227 <?php 228 228 break; 229 229 } 230 include("admin-footer.php") ;230 include("admin-footer.php") ?> -
branches/2.8/wp-admin/rtl.css
r11698 r11553 138 138 .folded #adminmenu img.wp-menu-image { 139 139 padding: 7px 6px 0 0; 140 }141 #adminmenu a.separator {142 cursor: e-resize;143 }144 .folded #adminmenu a.separator {145 cursor: w-resize;146 140 } 147 141 #adminmenu .wp-submenu .wp-submenu-head { -
branches/2.8/wp-admin/theme-editor.php
r11698 r11553 23 23 } else { 24 24 $theme = stripslashes($theme); 25 } 25 } 26 26 27 27 28 if ( ! isset($themes[$theme]) ) … … 65 66 66 67 $location = wp_kses_no_null($location); 67 $strip = array('%0d', '%0a' , '%0D', '%0A');68 $location = _deep_replace($strip, $location);68 $strip = array('%0d', '%0a'); 69 $location = str_replace($strip, '', $location); 69 70 header("Location: $location"); 70 71 exit(); … … 76 77 if ( !current_user_can('edit_themes') ) 77 78 wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>'); 79 80 if ( use_codepress() ) 81 wp_enqueue_script( 'codepress' ); 78 82 79 83 require_once('admin-header.php'); … … 114 118 <?php screen_icon(); ?> 115 119 <h2><?php echo esc_html( $title ); ?></h2> 116 117 <div class="fileedit-sub"> 118 <div class="alignleft"> 119 <big><?php echo sprintf($desc_header, $file_show); ?></big> 120 </div> 121 <div class="alignright"> 122 <form action="theme-editor.php" method="post"> 120 <div class="bordertitle"> 121 <form id="themeselector" action="theme-editor.php" method="post"> 123 122 <strong><label for="theme"><?php _e('Select theme to edit:'); ?> </label></strong> 124 123 <select name="theme" id="theme"> … … 136 135 </form> 137 136 </div> 137 <div class="tablenav"> 138 <div class="alignleft"> 139 <big><?php echo sprintf($desc_header, $file_show); ?></big> 140 </div> 138 141 <br class="clear" /> 139 142 </div> 140 141 <div id="templateside">142 <h3 ><?php _e("Theme Files"); ?></h3>143 <br class="clear" /> 144 <div id="templateside"> 145 <h3 id="bordertitle"><?php _e("Theme Files"); ?></h3> 143 146 144 147 <?php … … 191 194 <?php endif; ?> 192 195 </div> 193 194 <?php if (!$error) { ?> 195 <form name="template" id="template" action="theme-editor.php" method="post"> 196 <?php 197 if (!$error) { 198 ?> 199 <form name="template" id="template" action="theme-editor.php" method="post"> 196 200 <?php wp_nonce_field('edit-theme_' . $file . $theme) ?> 197 201 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea> … … 219 223 <?php endif; ?> 220 224 </div> 221 </form>222 <?php225 </form> 226 <?php 223 227 } else { 224 228 echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>'; 225 229 } 226 ?>227 < br class="clear" />230 ?> 231 <div class="clear"> </div> 228 232 </div> 229 233 <?php … … 231 235 } 232 236 233 include("admin-footer.php") ;237 include("admin-footer.php") ?> -
branches/2.8/wp-admin/update-core.php
r11698 r11553 15 15 function list_core_update( $update ) { 16 16 global $wp_local_package; 17 $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() )?17 $version_string = 'en_US' == $update->locale ? 18 18 $update->current : sprintf("%s–<strong>%s</strong>", $update->current, $update->locale); 19 19 $current = false; … … 54 54 if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) ) 55 55 echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>'; 56 else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {57 echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English.</strong> There is a chance this upgrade will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';58 }59 56 echo '</form>'; 60 57 -
branches/2.8/wp-admin/upgrade.php
r11698 r11553 69 69 case 1: 70 70 wp_upgrade(); 71 72 $backto = empty($_GET['backto']) ? '' : $_GET['backto'] ; 73 $backto = stripslashes( urldecode( $backto ) ); 71 72 if ( empty( $_GET['backto'] ) ) 73 $backto = __get_option( 'home' ) . '/'; 74 else { 75 $backto = stripslashes( urldecode( $_GET['backto'] ) ); 74 76 $backto = esc_url_raw( $backto ); 75 $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');77 } 76 78 ?> 77 79 <h2><?php _e( 'Upgrade Complete' ); ?></h2> -
branches/2.8/wp-admin/wp-admin.css
r11698 r11553 436 436 #wpcontent option { 437 437 padding: 2px; 438 }439 440 #timezone_string option {441 margin-left: 1em;442 438 } 443 439 … … 2097 2093 } 2098 2094 2095 .bordertitle { 2096 padding-bottom: 5px; 2097 border-bottom-width: 1px; 2098 border-bottom-style: solid; 2099 } 2100 2099 2101 /* Edit posts */ 2100 2102 … … 3185 3187 } 3186 3188 3187 .widefat td p {3188 margin: 2px 0 0.8em;3189 }3190 3191 3189 table .vers, 3192 3190 table .column-visible, -
branches/2.8/wp-content/plugins/hello.php
r11698 r11553 3 3 * @package Hello_Dolly 4 4 * @author Matt Mullenweg 5 * @version 1.5 .15 * @version 1.5 6 6 */ 7 7 /* … … 10 10 Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page. 11 11 Author: Matt Mullenweg 12 Version: 1.5 .112 Version: 1.5 13 13 Author URI: http://ma.tt/ 14 14 */ … … 63 63 // We need some CSS to position the paragraph 64 64 function dolly_css() { 65 // This makes sure that the posinioning is also good for right-to-left languages66 $x = ( 'rtl' == get_bloginfo( 'text_direction' ) ) ? 'left' : 'right';67 68 65 echo " 69 66 <style type='text/css'> … … 73 70 margin: 0; 74 71 padding: 0; 75 $x: 215px;72 right: 215px; 76 73 font-size: 11px; 77 74 } -
branches/2.8/wp-includes/class-simplepie.php
r11698 r11553 752 752 function __destruct() 753 753 { 754 if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) 755 { 756 if (!empty($this->data['items'])) 757 { 758 foreach ($this->data['items'] as $item) 759 { 760 $item->__destruct(); 761 } 762 unset($item, $this->data['items']); 763 } 764 if (!empty($this->data['ordered_items'])) 765 { 766 foreach ($this->data['ordered_items'] as $item) 767 { 768 $item->__destruct(); 769 } 770 unset($item, $this->data['ordered_items']); 771 } 754 if (!empty($this->data['items'])) 755 { 756 foreach ($this->data['items'] as $item) 757 { 758 $item->__destruct(); 759 } 760 unset($this->data['items']); 761 } 762 if (!empty($this->data['ordered_items'])) 763 { 764 foreach ($this->data['ordered_items'] as $item) 765 { 766 $item->__destruct(); 767 } 768 unset($this->data['ordered_items']); 772 769 } 773 770 } … … 1687 1684 $headers = $file->headers; 1688 1685 $data = $file->body; 1689 $sniffer = &new $this->content_type_sniffer_class($file);1686 $sniffer = new $this->content_type_sniffer_class($file); 1690 1687 $sniffed = $sniffer->get_type(); 1691 1688 } … … 1965 1962 if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0) 1966 1963 { 1967 $sniffer = &new $this->content_type_sniffer_class($file);1964 $sniffer = new $this->content_type_sniffer_class($file); 1968 1965 if (substr($sniffer->get_type(), 0, 6) === 'image/') 1969 1966 { … … 3086 3083 function __destruct() 3087 3084 { 3088 if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) 3089 { 3090 unset($this->feed); 3091 } 3085 unset($this->feed); 3092 3086 } 3093 3087 … … 5689 5683 } 5690 5684 5685 /** 5686 * Remove items that link back to this before destroying this object 5687 */ 5688 function __destruct() 5689 { 5690 unset($this->item); 5691 } 5692 5691 5693 function get_source_tags($namespace, $tag) 5692 5694 { … … 7745 7747 case 'gzip': 7746 7748 case 'x-gzip': 7747 $decoder = &new SimplePie_gzdecode($this->body);7749 $decoder = new SimplePie_gzdecode($this->body); 7748 7750 if (!$decoder->parse()) 7749 7751 { … … 8953 8955 function parse_url($url) 8954 8956 { 8955 preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match); 8956 for ($i = count($match); $i <= 9; $i++) 8957 { 8958 $match[$i] = ''; 8959 } 8960 return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]); 8957 static $cache = array(); 8958 if (isset($cache[$url])) 8959 { 8960 return $cache[$url]; 8961 } 8962 elseif (preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match)) 8963 { 8964 for ($i = count($match); $i <= 9; $i++) 8965 { 8966 $match[$i] = ''; 8967 } 8968 return $cache[$url] = array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]); 8969 } 8970 else 8971 { 8972 return $cache[$url] = array('scheme' => '', 'authority' => '', 'path' => '', 'query' => '', 'fragment' => ''); 8973 } 8961 8974 } 8962 8975 … … 10543 10556 function entities_decode($data) 10544 10557 { 10545 $decoder = &new SimplePie_Decode_HTML_Entities($data);10558 $decoder = new SimplePie_Decode_HTML_Entities($data); 10546 10559 return $decoder->parse(); 10547 10560 } … … 10797 10810 function codepoint_to_utf8($codepoint) 10798 10811 { 10812 static $cache = array(); 10799 10813 $codepoint = (int) $codepoint; 10800 if ($codepoint < 0) 10801 { 10802 return false; 10814 if (isset($cache[$codepoint])) 10815 { 10816 return $cache[$codepoint]; 10817 } 10818 elseif ($codepoint < 0) 10819 { 10820 return $cache[$codepoint] = false; 10803 10821 } 10804 10822 else if ($codepoint <= 0x7f) 10805 10823 { 10806 return chr($codepoint);10824 return $cache[$codepoint] = chr($codepoint); 10807 10825 } 10808 10826 else if ($codepoint <= 0x7ff) 10809 10827 { 10810 return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));10828 return $cache[$codepoint] = chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); 10811 10829 } 10812 10830 else if ($codepoint <= 0xffff) 10813 10831 { 10814 return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));10832 return $cache[$codepoint] = chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); 10815 10833 } 10816 10834 else if ($codepoint <= 0x10ffff) 10817 10835 { 10818 return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));10836 return $cache[$codepoint] = chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); 10819 10837 } 10820 10838 else 10821 10839 { 10822 10840 // U+FFFD REPLACEMENT CHARACTER 10823 return "\xEF\xBF\xBD";10841 return $cache[$codepoint] = "\xEF\xBF\xBD"; 10824 10842 } 10825 10843 } … … 10939 10957 if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E")) 10940 10958 { 10941 $parser = &new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'));10959 $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8')); 10942 10960 if ($parser->parse()) 10943 10961 { … … 10952 10970 if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00")) 10953 10971 { 10954 $parser = &new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'));10972 $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8')); 10955 10973 if ($parser->parse()) 10956 10974 { … … 10965 10983 if ($pos = strpos($data, "\x00\x3F\x00\x3E")) 10966 10984 { 10967 $parser = &new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'));10985 $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8')); 10968 10986 if ($parser->parse()) 10969 10987 { … … 10978 10996 if ($pos = strpos($data, "\x3F\x00\x3E\x00")) 10979 10997 { 10980 $parser = &new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'));10998 $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8')); 10981 10999 if ($parser->parse()) 10982 11000 { … … 10991 11009 if ($pos = strpos($data, "\x3F\x3E")) 10992 11010 { 10993 $parser = &new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));11011 $parser = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5)); 10994 11012 if ($parser->parse()) 10995 11013 { … … 11717 11735 if (!isset($cache[get_class($this)])) 11718 11736 { 11719 $all_methods = get_class_methods($this); 11737 if (extension_loaded('Reflection')) 11738 { 11739 $class = new ReflectionClass(get_class($this)); 11740 $methods = $class->getMethods(); 11741 $all_methods = array(); 11742 foreach ($methods as $method) 11743 { 11744 $all_methods[] = $method->getName(); 11745 } 11746 } 11747 else 11748 { 11749 $all_methods = get_class_methods($this); 11750 } 11720 11751 11721 11752 foreach ($all_methods as $method) … … 11744 11775 if (!$object) 11745 11776 { 11746 $object = &new SimplePie_Parse_Date;11777 $object = new SimplePie_Parse_Date; 11747 11778 } 11748 11779 return $object; … … 12779 12810 if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) 12780 12811 { 12781 $sniffer = &new $this->content_type_sniffer_class($this->file);12812 $sniffer = new $this->content_type_sniffer_class($this->file); 12782 12813 if ($sniffer->get_type() !== 'text/html') 12783 12814 { … … 12825 12856 if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) 12826 12857 { 12827 $sniffer = &new $this->content_type_sniffer_class($file);12858 $sniffer = new $this->content_type_sniffer_class($file); 12828 12859 $sniffed = $sniffer->get_type(); 12829 12860 if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml'))) … … 13053 13084 if (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), "\x09\x0A\x0D\x20") && ($pos = strpos($data, '?>')) !== false) 13054 13085 { 13055 $declaration = &new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));13086 $declaration = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5)); 13056 13087 if ($declaration->parse()) 13057 13088 { -
branches/2.8/wp-includes/default-widgets.php
r11698 r11553 527 527 $cache = array(); 528 528 529 if ( isset($cache[$args['widget_id']]) ) { 530 echo $cache[$args['widget_id']]; 531 return; 532 } 529 if ( isset($cache[$args['widget_id']]) ) 530 return $cache[$args['widget_id']]; 533 531 534 532 ob_start(); -
branches/2.8/wp-includes/formatting.php
r11698 r11553 81 81 82 82 function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') { 83 $o = preg_quote($opening , '/');84 $c = preg_quote($closing , '/');83 $o = preg_quote($opening); 84 $c = preg_quote($closing); 85 85 foreach($disabled_elements as $element) { 86 86 if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element); … … 2043 2043 if ('' == $url) return $url; 2044 2044 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url); 2045 $strip = array('%0d', '%0a' , '%0D', '%0A');2046 $url = _deep_replace($strip, $url);2045 $strip = array('%0d', '%0a'); 2046 $url = str_replace($strip, '', $url); 2047 2047 $url = str_replace(';//', '://', $url); 2048 2048 /* If the URL doesn't appear to contain a scheme, we … … 2066 2066 2067 2067 return apply_filters('clean_url', $url, $original_url, $context); 2068 }2069 2070 /**2071 * Perform a deep string replace operation to ensure the values in $search are no longer present2072 *2073 * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values2074 * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that2075 * str_replace would return2076 *2077 * @since 2.8.12078 * @access private2079 *2080 * @param string|array $search2081 * @param string $subject2082 * @return string The processed string2083 */2084 function _deep_replace($search, $subject){2085 $found = true;2086 while($found) {2087 $found = false;2088 foreach( (array) $search as $val ) {2089 while(strpos($subject, $val) !== false) {2090 $found = true;2091 $subject = str_replace($val, '', $subject);2092 }2093 }2094 }2095 2096 return $subject;2097 2068 } 2098 2069 -
branches/2.8/wp-includes/functions.php
r11698 r11553 2683 2683 $wp_smiliessearch .= '|'; 2684 2684 } 2685 $wp_smiliessearch .= preg_quote($rest , '/');2685 $wp_smiliessearch .= preg_quote($rest); 2686 2686 } 2687 2687 … … 3150 3150 */ 3151 3151 function wp_timezone_override_offset() { 3152 if ( !wp_timezone_supported() ) { 3153 return false; 3154 } 3155 if ( !$timezone_string = get_option( 'timezone_string' ) ) { 3156 return false; 3157 } 3158 3159 @date_default_timezone_set( $timezone_string ); 3160 $timezone_object = timezone_open( $timezone_string ); 3161 $datetime_object = date_create(); 3162 if ( false === $timezone_object || false === $datetime_object ) { 3163 return false; 3164 } 3165 return round( timezone_offset_get( $timezone_object, $datetime_object ) / 3600, 2 ); 3152 if (!wp_timezone_supported()) return false; 3153 3154 $tz = get_option('timezone_string'); 3155 if (empty($tz)) return false; 3156 3157 @date_default_timezone_set($tz); 3158 3159 $dateTimeZoneSelected = timezone_open($tz); 3160 $dateTimeServer = date_create(); 3161 if ($dateTimeZoneSelected === false || $dateTimeServer === false) return false; 3162 3163 $timeOffset = timezone_offset_get($dateTimeZoneSelected, $dateTimeServer); 3164 $timeOffset = $timeOffset / 3600; 3165 3166 return $timeOffset; 3166 3167 } 3167 3168 3168 3169 /** 3169 3170 * Check for PHP timezone support 3171 * 3170 3172 */ 3171 3173 function wp_timezone_supported() { 3172 $support = false; 3173 if ( 3174 function_exists( 'date_default_timezone_set' ) && 3175 function_exists( 'timezone_identifiers_list' ) && 3176 function_exists( 'timezone_open' ) && 3177 function_exists( 'timezone_offset_get' ) 3178 ) { 3179 $support = true; 3180 } 3181 return apply_filters( 'timezone_support', $support ); 3182 } 3183 3184 function _wp_timezone_choice_usort_callback( $a, $b ) { 3185 // Don't use translated versions of Etc 3186 if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) { 3187 // Make the order of these more like the old dropdown 3188 if ( 'GMT+' === substr( $a['city'], 0, 4 ) && 'GMT+' === substr( $b['city'], 0, 4 ) ) { 3189 return -1 * ( strnatcasecmp( $a['city'], $b['city'] ) ); 3190 } 3191 if ( 'UTC' === $a['city'] ) { 3192 if ( 'GMT+' === substr( $b['city'], 0, 4 ) ) { 3193 return 1; 3194 } 3195 return -1; 3196 } 3197 if ( 'UTC' === $b['city'] ) { 3198 if ( 'GMT+' === substr( $a['city'], 0, 4 ) ) { 3199 return -1; 3200 } 3201 return 1; 3202 } 3203 return strnatcasecmp( $a['city'], $b['city'] ); 3204 } 3205 if ( $a['t_continent'] == $b['t_continent'] ) { 3206 if ( $a['t_city'] == $b['t_city'] ) { 3207 return strnatcasecmp( $a['t_subcity'], $b['t_subcity'] ); 3208 } 3209 return strnatcasecmp( $a['t_city'], $b['t_city'] ); 3210 } else { 3211 // Force Etc to the bottom of the list 3212 if ( 'Etc' === $a['continent'] ) { 3213 return 1; 3214 } 3215 if ( 'Etc' === $b['continent'] ) { 3216 return -1; 3217 } 3218 return strnatcasecmp( $a['t_continent'], $b['t_continent'] ); 3219 } 3174 if (function_exists('date_default_timezone_set') 3175 && function_exists('timezone_identifiers_list') 3176 && function_exists('timezone_open') 3177 && function_exists('timezone_offset_get') 3178 ) 3179 return apply_filters('timezone_support',true); 3180 3181 return apply_filters('timezone_support',false); 3220 3182 } 3221 3183 … … 3223 3185 * Gives a nicely formatted list of timezone strings // temporary! Not in final 3224 3186 * 3225 * @param $selected_zone string Selected Zone3226 * 3227 */ 3228 function wp_timezone_choice( $selected_zone) {3187 * @param string $selectedzone - which zone should be the selected one 3188 * 3189 */ 3190 function wp_timezone_choice($selectedzone) { 3229 3191 static $mo_loaded = false; 3230 3192 3231 $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc');3193 $continents = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc'); 3232 3194 3233 3195 // Load translations for continents and cities 3234 if ( ! $mo_loaded ) {3196 if ( ! $mo_loaded ) { 3235 3197 $locale = get_locale(); 3236 $mofile = WP_LANG_DIR . '/continents-cities-' . $locale . '.mo';3237 load_textdomain( 'continents-cities', $mofile);3198 $mofile = WP_LANG_DIR . "/continents-cities-$locale.mo"; 3199 load_textdomain('continents-cities', $mofile); 3238 3200 $mo_loaded = true; 3239 3201 } 3240 3202 3241 $zonen = array(); 3242 foreach ( timezone_identifiers_list() as $zone ) { 3243 $zone = explode( '/', $zone ); 3244 if ( !in_array( $zone[0], $continents ) ) { 3203 $all = timezone_identifiers_list(); 3204 3205 $i = 0; 3206 foreach ( $all as $zone ) { 3207 $zone = explode('/',$zone); 3208 if ( ! in_array($zone[0], $continents) ) 3245 3209 continue; 3246 } 3247 if ( 'Etc' === $zone[0] && in_array( $zone[1], array( 'UCT', 'GMT', 'GMT0', 'GMT+0', 'GMT-0', 'Greenwich', 'Universal', 'Zulu' ) ) ) { 3210 if ( $zone[0] == 'Etc' && in_array($zone[1], array('UCT', 'GMT', 'GMT0', 'GMT+0', 'GMT-0', 'Greenwich', 'Universal', 'Zulu')) ) 3248 3211 continue; 3249 } 3250 3251 // This determines what gets set and translated - we don't translate Etc/* strings here, they are done later 3252 $exists = array( 3253 0 => ( isset( $zone[0] ) && $zone[0] ) ? true : false, 3254 1 => ( isset( $zone[1] ) && $zone[1] ) ? true : false, 3255 2 => ( isset( $zone[2] ) && $zone[2] ) ? true : false 3256 ); 3257 $exists[3] = ( $exists[0] && 'Etc' !== $zone[0] ) ? true : false; 3258 $exists[4] = ( $exists[1] && $exists[3] ) ? true : false; 3259 $exists[5] = ( $exists[2] && $exists[3] ) ? true : false; 3260 3261 $zonen[] = array( 3262 'continent' => ( $exists[0] ? $zone[0] : '' ), 3263 'city' => ( $exists[1] ? $zone[1] : '' ), 3264 'subcity' => ( $exists[2] ? $zone[2] : '' ), 3265 't_continent' => ( $exists[3] ? translate( str_replace( '_', ' ', $zone[0] ), 'continents-cities' ) : '' ), 3266 't_city' => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ), 3267 't_subcity' => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ) 3268 ); 3269 } 3270 usort( $zonen, '_wp_timezone_choice_usort_callback' ); 3271 3272 $structure = array(); 3273 3274 if ( empty( $selected_zone ) ) { 3275 $structure[] = '<option selected="selected" value="">' . __( 'Select a city' ) . '</option>'; 3276 } 3277 3278 foreach ( $zonen as $key => $zone ) { 3279 // Build value in an array to join later 3280 $value = array( $zone['continent'] ); 3281 3282 if ( empty( $zone['city'] ) ) { 3283 // It's at the continent level (generally won't happen) 3284 $display = $zone['t_continent']; 3285 } else { 3286 // It's inside a continent group 3287 3288 // Continent optgroup 3289 if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) { 3290 $label = ( 'Etc' === $zone['continent'] ) ? __( 'Manual offsets' ) : $zone['t_continent']; 3291 $structure[] = '<optgroup label="'. esc_attr( $label ) .'">'; 3292 } 3293 3294 // Add the city to the value 3295 $value[] = $zone['city']; 3296 if ( 'Etc' === $zone['continent'] ) { 3297 if ( 'UTC' === $zone['city'] ) { 3298 $display = ''; 3299 } else { 3300 $display = str_replace( 'GMT', '', $zone['city'] ); 3301 $display = strtr( $display, '+-', '-+' ) . ':00'; 3302 } 3303 $display = sprintf( __( 'UTC %s' ), $display ); 3304 } else { 3305 $display = $zone['t_city']; 3306 if ( !empty( $zone['subcity'] ) ) { 3307 // Add the subcity to the value 3308 $value[] = $zone['subcity']; 3309 $display .= ' - ' . $zone['t_subcity']; 3310 } 3212 $zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : ''; 3213 $zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : ''; 3214 $zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : ''; 3215 $i++; 3216 } 3217 3218 usort($zonen, create_function( 3219 '$a, $b', ' 3220 $t = create_function(\'$s\', \'return translate(str_replace("_", " ", $s), "continents-cities");\'); 3221 $a_continent = $t($a["continent"]); 3222 $b_continent = $t($b["continent"]); 3223 $a_city = $t($a["city"]); 3224 $b_city = $t($b["city"]); 3225 $a_subcity = $t($a["subcity"]); 3226 $b_subcity = $t($b["subcity"]); 3227 if ( $a_continent == $b_continent && $a_city == $b_city ) 3228 return strnatcasecmp($a_subcity, $b_subcity); 3229 elseif ( $a_continent == $b_continent ) 3230 return strnatcasecmp($a_city, $b_city); 3231 else 3232 return strnatcasecmp($a_continent, $b_continent); 3233 ')); 3234 3235 $structure = ''; 3236 $pad = ' '; 3237 3238 if ( empty($selectedzone) ) 3239 $structure .= '<option selected="selected" value="">' . __('Select a city') . "</option>\n"; 3240 foreach ( $zonen as $zone ) { 3241 extract($zone); 3242 if ( empty($selectcontinent) && !empty($city) ) { 3243 $selectcontinent = $continent; 3244 $structure .= '<optgroup label="'. esc_attr( translate( $continent, "continents-cities" ) ) .'">' . "\n"; // continent 3245 } elseif ( !empty($selectcontinent) && $selectcontinent != $continent ) { 3246 $structure .= "</optgroup>\n"; 3247 $selectcontinent = ''; 3248 if ( !empty($city) ) { 3249 $selectcontinent = $continent; 3250 $structure .= '<optgroup label="'. esc_attr( translate( $continent, "continents-cities" ) ) .'">' . "\n"; // continent 3311 3251 } 3312 3252 } 3313 3253 3314 // Build the value 3315 $value = join( '/', $value ); 3316 $selected = ''; 3317 if ( $value === $selected_zone ) { 3318 $selected = 'selected="selected" '; 3254 if ( !empty($city) ) { 3255 $display = str_replace('_',' ',$city); 3256 $display = translate($display, "continents-cities"); 3257 if ( !empty($subcity) ) { 3258 $display_subcity = str_replace('_', ' ', $subcity); 3259 $display_subcity = translate($display_subcity, "continents-cities"); 3260 $city = $city . '/'. $subcity; 3261 $display = $display . '/' . $display_subcity; 3262 } 3263 if ( $continent == 'Etc' ) 3264 $display = strtr($display, '+-', '-+'); 3265 $structure .= "\t<option ".((($continent.'/'.$city)==$selectedzone)?'selected="selected"':'')." value=\"".($continent.'/'.$city)."\">$pad".$display."</option>\n"; //Timezone 3266 } else { 3267 $structure .= "<option ".(($continent==$selectedzone)?'selected="selected"':'')." value=\"".$continent."\">" . translate($continent, "continents-cities") . "</option>\n"; //Timezone 3319 3268 } 3320 $structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>"; 3321 3322 // Close continent optgroup 3323 if ( !empty( $zone['city'] ) && ( !isset($zonen[$key + 1]) || (isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) ) ) { 3324 $structure[] = '</optgroup>'; 3325 } 3326 } 3327 3328 return join( "\n", $structure ); 3269 } 3270 3271 if ( !empty($selectcontinent) ) 3272 $structure .= "</optgroup>\n"; 3273 return $structure; 3329 3274 } 3330 3275 -
branches/2.8/wp-includes/functions.wp-styles.php
r11698 r11553 93 93 function wp_style_is( $handle, $list = 'queue' ) { 94 94 global $wp_styles; 95 if ( !is_a($wp_styles, 'WP_S tyles') )95 if ( !is_a($wp_styles, 'WP_Scripts') ) 96 96 $wp_styles = new WP_Styles(); 97 97 -
branches/2.8/wp-includes/http.php
r11698 r11553 74 74 * that object to be used later. 75 75 * 76 * The order for the GET/HEAD requests are Streams, HTTP Extension, Fopen,77 * and finally Fsockopen. fsockopen() is used last, because it has the most78 * overhead in its implementation. There isn't any real way around it, since79 * redirects have to be supported, much the same way the other transports80 * also handle redirects.76 * The order for the GET/HEAD requests are HTTP Extension, FSockopen Streams, 77 * Fopen, and finally cURL. Whilst Fsockopen has the highest overhead, Its 78 * used 2nd due to high compatibility with most hosts, The HTTP Extension is 79 * tested first due to hosts which have it enabled, are likely to work 80 * correctly with it. 81 81 * 82 82 * There are currently issues with "localhost" not resolving correctly with … … 99 99 $working_transport['exthttp'] = new WP_Http_ExtHttp(); 100 100 $blocking_transport[] = &$working_transport['exthttp']; 101 } else if ( true === WP_Http_ Curl::test($args) ) {102 $working_transport[' curl'] = new WP_Http_Curl();103 $blocking_transport[] = &$working_transport[' curl'];101 } else if ( true === WP_Http_Fsockopen::test($args) ) { 102 $working_transport['fsockopen'] = new WP_Http_Fsockopen(); 103 $blocking_transport[] = &$working_transport['fsockopen']; 104 104 } else if ( true === WP_Http_Streams::test($args) ) { 105 105 $working_transport['streams'] = new WP_Http_Streams(); … … 108 108 $working_transport['fopen'] = new WP_Http_Fopen(); 109 109 $blocking_transport[] = &$working_transport['fopen']; 110 } else if ( true === WP_Http_ Fsockopen::test($args) ) {111 $working_transport[' fsockopen'] = new WP_Http_Fsockopen();112 $blocking_transport[] = &$working_transport[' fsockopen'];110 } else if ( true === WP_Http_Curl::test($args) ) { 111 $working_transport['curl'] = new WP_Http_Curl(); 112 $blocking_transport[] = &$working_transport['curl']; 113 113 } 114 114 … … 150 150 $working_transport['exthttp'] = new WP_Http_ExtHttp(); 151 151 $blocking_transport[] = &$working_transport['exthttp']; 152 } else if ( true === WP_Http_Fsockopen::test($args) ) { 153 $working_transport['fsockopen'] = new WP_Http_Fsockopen(); 154 $blocking_transport[] = &$working_transport['fsockopen']; 155 } else if ( true === WP_Http_Streams::test($args) ) { 156 $working_transport['streams'] = new WP_Http_Streams(); 157 $blocking_transport[] = &$working_transport['streams']; 152 158 } else if ( true === WP_Http_Curl::test($args) ) { 153 159 $working_transport['curl'] = new WP_Http_Curl(); 154 160 $blocking_transport[] = &$working_transport['curl']; 155 } else if ( true === WP_Http_Streams::test($args) ) {156 $working_transport['streams'] = new WP_Http_Streams();157 $blocking_transport[] = &$working_transport['streams'];158 } else if ( true === WP_Http_Fsockopen::test($args) ) {159 $working_transport['fsockopen'] = new WP_Http_Fsockopen();160 $blocking_transport[] = &$working_transport['fsockopen'];161 161 } 162 162 … … 240 240 241 241 if ( $this->block_request( $url ) ) 242 return new WP_Error('http_request_failed', __('User has blocked requests through HTTP.'));242 return new WP_Error('http_request_failed', 'User has blocked requests through HTTP.'); 243 243 244 244 // Determine if this is a https call and pass that on to the transport functions -
branches/2.8/wp-includes/js/tinymce/wp-tinymce.php
r11698 r11553 9 9 10 10 if ( ! $path || ! @is_file($path) ) 11 return false;11 return ''; 12 12 13 13 return @file_get_contents($path); … … 21 21 header("Cache-Control: public, max-age=$expires_offset"); 22 22 23 if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') )) {23 if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) { 24 24 header('Content-Encoding: gzip'); 25 echo $file;25 echo get_file($basepath . '/wp-tinymce.js.gz'); 26 26 } else { 27 27 echo get_file($basepath . '/wp-tinymce.js'); -
branches/2.8/wp-includes/kses.php
r11698 r11553 120 120 'h1' => array( 121 121 'align' => array (), 122 'class' => array (), 123 'id' => array (), 124 'style' => array ()), 125 'h2' => array ( 126 'align' => array (), 127 'class' => array (), 128 'id' => array (), 129 'style' => array ()), 130 'h3' => array ( 131 'align' => array (), 132 'class' => array (), 133 'id' => array (), 134 'style' => array ()), 135 'h4' => array ( 136 'align' => array (), 137 'class' => array (), 138 'id' => array (), 139 'style' => array ()), 140 'h5' => array ( 141 'align' => array (), 142 'class' => array (), 143 'id' => array (), 144 'style' => array ()), 145 'h6' => array ( 146 'align' => array (), 147 'class' => array (), 148 'id' => array (), 149 'style' => array ()), 150 'hr' => array ( 122 'class' => array ()), 123 'h2' => array( 124 'align' => array (), 125 'class' => array ()), 126 'h3' => array( 127 'align' => array (), 128 'class' => array ()), 129 'h4' => array( 130 'align' => array (), 131 'class' => array ()), 132 'h5' => array( 133 'align' => array (), 134 'class' => array ()), 135 'h6' => array( 136 'align' => array (), 137 'class' => array ()), 138 'hr' => array( 151 139 'align' => array (), 152 140 'class' => array (), … … 534 522 } 535 523 536 if ( $arreach['name'] == 'style' ) {537 $orig_value = $arreach['value'];538 539 $value = safecss_filter_attr($orig_value);540 541 if ( empty($value) )542 continue;543 544 $arreach['value'] = $value;545 546 $arreach['whole'] = str_replace($orig_value, $value, $arreach['whole']);547 }548 549 524 if ($ok) 550 525 $attr2 .= ' '.$arreach['whole']; # it passed them … … 1148 1123 add_action('init', 'kses_init'); 1149 1124 add_action('set_current_user', 'kses_init'); 1150 1151 function safecss_filter_attr( $css, $deprecated = '' ) { 1152 $css = wp_kses_no_null($css); 1153 $css = str_replace(array("\n","\r","\t"), '', $css); 1154 1155 if ( preg_match( '%[\\(&]|/\*%', $css ) ) // remove any inline css containing \ ( & or comments 1156 return ''; 1157 1158 $css_array = split( ';', trim( $css ) ); 1159 $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float', 1160 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color', 1161 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', 1162 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', 1163 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 1164 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side', 1165 'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style', 1166 'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom', 1167 'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom', 1168 'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align', 1169 'width' ) ); 1170 1171 if ( empty($allowed_attr) ) 1172 return $css; 1173 1174 $css = ''; 1175 foreach ( $css_array as $css_item ) { 1176 if ( $css_item == '' ) 1177 continue; 1178 $css_item = trim( $css_item ); 1179 $found = false; 1180 if ( strpos( $css_item, ':' ) === false ) { 1181 $found = true; 1182 } else { 1183 $parts = split( ':', $css_item ); 1184 if ( in_array( trim( $parts[0] ), $allowed_attr ) ) 1185 $found = true; 1186 } 1187 if ( $found ) { 1188 if( $css != '' ) 1189 $css .= ';'; 1190 $css .= $css_item; 1191 } 1192 } 1193 1194 return $css; 1195 } 1125 ?> -
branches/2.8/wp-includes/l10n.php
r11698 r11553 302 302 303 303 /** 304 * Loads a MO file into the domain $domain.305 * 306 * If the domain already exists, the translations will be merged. If both307 * sets have the same string, the translation from the original value will be taken.304 * Loads MO file into the list of domains. 305 * 306 * If the domain already exists, the inclusion will fail. If the MO file is not 307 * readable, the inclusion will fail. 308 308 * 309 309 * On success, the .mo file will be placed in the $l10n global by $domain 310 * and will be a MOobject.310 * and will be an gettext_reader object. 311 311 * 312 312 * @since 1.5.0 313 * @uses $l10n Gets list of domain translated string objects 313 * @uses $l10n Gets list of domain translated string (gettext_reader) objects 314 * @uses CacheFileReader Reads the MO file 315 * @uses gettext_reader Allows for retrieving translated strings 314 316 * 315 317 * @param string $domain Unique identifier for retrieving translated strings 316 318 * @param string $mofile Path to the .mo file 317 * @return bool true on success, false on failure319 * @return null On failure returns null and also on success returns nothing. 318 320 */ 319 321 function load_textdomain($domain, $mofile) { 320 322 global $l10n; 321 323 322 if ( !is_readable( $mofile ) ) return false;324 if ( !is_readable($mofile)) return; 323 325 324 326 $mo = new MO(); 325 if ( !$mo->import_from_file( $mofile ) ) return false;326 327 if ( isset( $l10n[$domain] ))327 $mo->import_from_file( $mofile ); 328 329 if (isset($l10n[$domain])) 328 330 $mo->merge_with( $l10n[$domain] ); 329 331 330 332 $l10n[$domain] = &$mo; 331 return true;332 333 } 333 334 … … 345 346 $mofile = WP_LANG_DIR . "/$locale.mo"; 346 347 347 returnload_textdomain('default', $mofile);348 load_textdomain('default', $mofile); 348 349 } 349 350 … … 372 373 373 374 $mofile = $path . '/'. $domain . '-' . $locale . '.mo'; 374 returnload_textdomain($domain, $mofile);375 load_textdomain($domain, $mofile); 375 376 } 376 377 … … 393 394 394 395 $mofile = "$path/$locale.mo"; 395 returnload_textdomain($domain, $mofile);396 load_textdomain($domain, $mofile); 396 397 } 397 398 … … 423 424 */ 424 425 function translate_user_role( $name ) { 425 return translate_with_gettext_context( before_last_bar($name), 'User role');426 return before_last_bar( translate_with_gettext_context( $name, 'User role' ) ); 426 427 } 427 428 ?> -
branches/2.8/wp-includes/link-template.php
r11698 r11553 1694 1694 $orig_scheme = $scheme; 1695 1695 if ( !in_array($scheme, array('http', 'https')) ) { 1696 if ( ( 'login_post' == $scheme || 'rpc' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) )1696 if ( ('login_post' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) ) 1697 1697 $scheme = 'https'; 1698 1698 elseif ( ('login' == $scheme) && ( force_ssl_admin() ) ) -
branches/2.8/wp-includes/pluggable.php
r11698 r11553 881 881 882 882 // remove %0d and %0a from location 883 $strip = array('%0d', '%0a', '%0D', '%0A'); 884 $location = _deep_replace($strip, $location); 883 $strip = array('%0d', '%0a'); 884 $found = true; 885 while($found) { 886 $found = false; 887 foreach( (array) $strip as $val ) { 888 while(strpos($location, $val) !== false) { 889 $found = true; 890 $location = str_replace($val, '', $location); 891 } 892 } 893 } 885 894 return $location; 886 895 } … … 900 909 * 901 910 * @since 2.3 902 * @uses wp_validate_redirect() To validate the redirect is to an allowed host. 911 * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing 912 * WordPress host string and $location host string. 903 913 * 904 914 * @return void Does not return anything … … 909 919 $location = wp_sanitize_redirect($location); 910 920 911 $location = wp_validate_redirect($location, admin_url());912 913 wp_redirect($location, $status);914 }915 endif;916 917 if ( !function_exists('wp_validate_redirect') ) :918 /**919 * Validates a URL for use in a redirect.920 *921 * Checks whether the $location is using an allowed host, if it has an absolute922 * path. A plugin can therefore set or remove allowed host(s) to or from the923 * list.924 *925 * If the host is not allowed, then the redirect is to $default supplied926 *927 * @since 2.8.1928 * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing929 * WordPress host string and $location host string.930 *931 * @param string $location The redirect to validate932 * @param string $default The value to return is $location is not allowed933 * @return string redirect-sanitized URL934 **/935 function wp_validate_redirect($location, $default = '') {936 921 // browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//' 937 922 if ( substr($location, 0, 2) == '//' ) … … 947 932 948 933 if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) ) 949 $location = $default;950 951 return $location;934 $location = admin_url(); 935 936 wp_redirect($location, $status); 952 937 } 953 938 endif; -
branches/2.8/wp-includes/plugin.php
r11698 r11553 54 54 * @since 0.71 55 55 * @global array $wp_filter Stores all of the filters added in the form of 56 * wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args) ']']56 * wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)]'] 57 57 * @global array $merged_filters Tracks the tags that need to be merged for later. If the hook is added, it doesn't need to run through that process. 58 58 * … … 496 496 $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash 497 497 $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir 498 $file = trim($file, '/');499 498 return $file; 500 499 } -
branches/2.8/wp-includes/pomo/entry.php
r11698 r11553 3 3 * Contains Translation_Entry class 4 4 * 5 * @version $Id: entry.php 1 15 2009-05-11 18:56:15Z nbachiyski $5 * @version $Id: entry.php 13 2008-04-21 12:03:37Z nbachiyski $ 6 6 * @package pomo 7 7 * @subpackage entry … … 49 49 $object_varnames = array_keys(get_object_vars($this)); 50 50 foreach ($args as $varname => $value) { 51 $this->$varname = $value; 51 if (in_array($varname, $object_varnames)) { 52 $this->$varname = $value; 53 } 52 54 } 53 55 if (isset($args['plural'])) $this->is_plural = true; -
branches/2.8/wp-includes/pomo/mo.php
r11698 r11553 3 3 * Class for working with MO files 4 4 * 5 * @version $Id: mo.php 106 2009-04-23 19:48:22Z nbachiyski $5 * @version $Id: mo.php 33 2009-02-16 09:33:39Z nbachiyski $ 6 6 * @package pomo 7 7 * @subpackage mo … … 11 11 require_once dirname(__FILE__) . '/streams.php'; 12 12 13 class MO extends Gettext_Translations {13 class MO extends Translations { 14 14 15 15 var $_nplurals = 2; 16 17 function set_header($header, $value) { 18 parent::set_header($header, $value); 19 if ('Plural-Forms' == $header) 20 $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($value); 21 } 16 22 17 23 /** … … 27 33 return $this->import_from_reader($reader); 28 34 } 29 30 function export_to_file($filename) {31 $fh = fopen($filename, 'wb');32 if ( !$fh ) return false;33 $entries = array_filter($this->entries, create_function('$e', 'return !empty($e->translations);'));34 ksort($entries);35 $magic = 0x950412de;36 $revision = 0;37 $total = count($entries) + 1; // all the headers are one entry38 $originals_lenghts_addr = 28;39 $translations_lenghts_addr = $originals_lenghts_addr + 8 * $total;40 $size_of_hash = 0;41 $hash_addr = $translations_lenghts_addr + 8 * $total;42 $current_addr = $hash_addr;43 fwrite($fh, pack('V*', $magic, $revision, $total, $originals_lenghts_addr,44 $translations_lenghts_addr, $size_of_hash, $hash_addr));45 fseek($fh, $originals_lenghts_addr);46 47 // headers' msgid is an empty string48 fwrite($fh, pack('VV', 0, $current_addr));49 $current_addr++;50 $originals_table = chr(0);51 52 foreach($entries as $entry) {53 $originals_table .= $this->export_original($entry) . chr(0);54 $length = strlen($this->export_original($entry));55 fwrite($fh, pack('VV', $length, $current_addr));56 $current_addr += $length + 1; // account for the NULL byte after57 }58 59 $exported_headers = $this->export_headers();60 fwrite($fh, pack('VV', strlen($exported_headers), $current_addr));61 $current_addr += strlen($exported_headers) + 1;62 $translations_table = $exported_headers . chr(0);63 64 foreach($entries as $entry) {65 $translations_table .= $this->export_translations($entry) . chr(0);66 $length = strlen($this->export_translations($entry));67 fwrite($fh, pack('VV', $length, $current_addr));68 $current_addr += $length + 1;69 }70 71 fwrite($fh, $originals_table);72 fwrite($fh, $translations_table);73 fclose($fh);74 }75 76 function export_original($entry) {77 //TODO: warnings for control characters78 $exported = $entry->singular;79 if ($entry->is_plural) $exported .= chr(0).$entry->plural;80 if (!is_null($entry->context)) $exported = $entry->context . chr(4) . $exported;81 return $exported;82 }83 84 function export_translations($entry) {85 //TODO: warnings for control characters86 return implode(chr(0), $entry->translations);87 }88 89 function export_headers() {90 $exported = '';91 foreach($this->headers as $header => $value) {92 $exported.= "$header: $value\n";93 }94 return $exported;95 }96 35 97 36 function get_byteorder($magic) { … … 104 43 // 0xde120495 105 44 $magic_big = ((int) - 569244523) && 0xFFFFFFFF; 106 45 107 46 if ($magic_little == $magic || $magic_little_64 == $magic) { 108 47 return 'little'; … … 125 64 $total = $reader->readint32(); 126 65 // get addresses of array of lenghts and offsets for original string and translations 127 $originals_l enghts_addr = $reader->readint32();128 $translations_l enghts_addr = $reader->readint32();66 $originals_lo_addr = $reader->readint32(); 67 $translations_lo_addr = $reader->readint32(); 129 68 130 $reader->seekto($originals_l enghts_addr);131 $originals_l enghts = $reader->readint32array($total * 2); // each of132 $reader->seekto($translations_l enghts_addr);133 $translations_l enghts= $reader->readint32array($total * 2);69 $reader->seekto($originals_lo_addr); 70 $originals_lo = $reader->readint32array($total * 2); // each of 71 $reader->seekto($translations_lo_addr); 72 $translations_lo = $reader->readint32array($total * 2); 134 73 135 74 $length = create_function('$i', 'return $i * 2 + 1;'); … … 137 76 138 77 for ($i = 0; $i < $total; ++$i) { 139 $reader->seekto($originals_l enghts[$offset($i)]);140 $original = $reader->read($originals_l enghts[$length($i)]);141 $reader->seekto($translations_l enghts[$offset($i)]);142 $translation = $reader->read($translations_l enghts[$length($i)]);78 $reader->seekto($originals_lo[$offset($i)]); 79 $original = $reader->read($originals_lo[$length($i)]); 80 $reader->seekto($translations_lo[$offset($i)]); 81 $translation = $reader->read($translations_lo[$length($i)]); 143 82 if ('' == $original) { 144 83 $this->set_headers($this->make_headers($translation)); … … 148 87 } 149 88 return true; 89 } 90 91 function make_headers($translation) { 92 $headers = array(); 93 $lines = explode("\n", $translation); 94 foreach($lines as $line) { 95 $parts = explode(':', $line, 2); 96 if (!isset($parts[1])) continue; 97 $headers[trim($parts[0])] = trim($parts[1]); 98 } 99 return $headers; 150 100 } 151 101 -
branches/2.8/wp-includes/pomo/po.php
r11698 r11553 3 3 * Class for working with PO files 4 4 * 5 * @version $Id: po.php 123 2009-05-13 19:35:43Z nbachiyski $5 * @version $Id: po.php 33 2009-02-16 09:33:39Z nbachiyski $ 6 6 * @package pomo 7 7 * @subpackage po … … 17 17 * Routines for working with PO files 18 18 */ 19 class PO extends Gettext_Translations {20 19 class PO extends Translations { 20 21 21 22 22 /** … … 76 76 } 77 77 78 78 79 /** 79 80 * Formats a string in PO-style … … 87 88 $slash = '\\'; 88 89 $newline = "\n"; 90 $tab = "\t"; 89 91 90 92 $replaces = array( 91 93 "$slash" => "$slash$slash", 94 "$tab" => '\t', 92 95 "$quote" => "$slash$quote", 93 "\t" => '\t',94 96 ); 95 96 97 $string = str_replace(array_keys($replaces), array_values($replaces), $string); 97 98 98 $po = $quote.implode("${slash}n$quote$newline$quote", explode($newline, $string)).$quote; 99 $po = array(); 100 foreach (explode($newline, $string) as $line) { 101 $po[] = wordwrap($line, PO_MAX_LINE_LEN - 2, " $quote$newline$quote"); 102 } 103 $po = $quote.implode("${slash}n$quote$newline$quote", $po).$quote; 99 104 // add empty string on first line for readbility 100 if (false !== strpos($string, $newline) && 101 (substr_count($string, $newline) > 1 || !($newline === substr($string, -strlen($newline))))) { 105 if (false !== strpos($po, $newline)) { 102 106 $po = "$quote$quote$newline$po"; 103 107 } … … 106 110 return $po; 107 111 } 108 109 /**110 * Gives back the original string from a PO-formatted string111 *112 * @static113 * @param string $string PO-formatted string114 * @return string enascaped string115 */116 function unpoify($string) {117 $escapes = array('t' => "\t", 'n' => "\n", '\\' => '\\');118 $lines = array_map('trim', explode("\n", $string));119 $lines = array_map(array('PO', 'trim_quotes'), $lines);120 $unpoified = '';121 $previous_is_backslash = false;122 foreach($lines as $line) {123 preg_match_all('/./u', $line, $chars);124 $chars = $chars[0];125 foreach($chars as $char) {126 if (!$previous_is_backslash) {127 if ('\\' == $char)128 $previous_is_backslash = true;129 else130 $unpoified .= $char;131 } else {132 $previous_is_backslash = false;133 $unpoified .= isset($escapes[$char])? $escapes[$char] : $char;134 }135 }136 }137 return $unpoified;138 }139 112 140 113 /** 141 * Inserts $with in the beginning of every new line of $string and 114 * Inserts $with in the beginning of every new line of $string and 142 115 * returns the modified string 143 116 * … … 185 158 if (!empty($entry->extracted_comments)) $po[] = PO::comment_block($entry->extracted_comments, '.'); 186 159 if (!empty($entry->references)) $po[] = PO::comment_block(implode(' ', $entry->references), ':'); 187 if (!empty($entry->flags)) $po[] = PO::comment_block(implode(" ,", $entry->flags), ',');160 if (!empty($entry->flags)) $po[] = PO::comment_block(implode("\n", $entry->flags), ','); 188 161 if (!is_null($entry->context)) $po[] = 'msgctxt '.PO::poify($entry->context); 189 162 $po[] = 'msgid '.PO::poify($entry->singular); … … 201 174 } 202 175 203 function import_from_file($filename) {204 $f = fopen($filename, 'r');205 if (!$f) return false;206 $lineno = 0;207 while (true) {208 $res = $this->read_entry($f, $lineno);209 if (!$res) break;210 if ($res['entry']->singular == '') {211 $this->set_headers($this->make_headers($res['entry']->translations[0]));212 } else {213 $this->add_entry($res['entry']);214 }215 }216 PO::read_line($f, 'clear');217 return $res !== false;218 }219 220 function read_entry($f, $lineno = 0) {221 $entry = new Translation_Entry();222 // where were we in the last step223 // can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural224 $context = '';225 $msgstr_index = 0;226 $is_final = create_function('$context', 'return $context == "msgstr" || $context == "msgstr_plural";');227 while (true) {228 $lineno++;229 $line = PO::read_line($f);230 if (!$line) {231 if (feof($f)) {232 if ($is_final($context))233 break;234 elseif (!$context) // we haven't read a line and eof came235 return null;236 else237 return false;238 } else {239 return false;240 }241 }242 if ($line == "\n") continue;243 $line = trim($line);244 if (preg_match('/^#/', $line, $m)) {245 // the comment is the start of a new entry246 if ($is_final($context)) {247 PO::read_line($f, 'put-back');248 $lineno--;249 break;250 }251 // comments have to be at the beginning252 if ($context && $context != 'comment') {253 return false;254 }255 // add comment256 $this->add_comment_to_entry($entry, $line);;257 } elseif (preg_match('/^msgctxt\s+(".*")/', $line, $m)) {258 if ($is_final($context)) {259 PO::read_line($f, 'put-back');260 $lineno--;261 break;262 }263 if ($context && $context != 'comment') {264 return false;265 }266 $context = 'msgctxt';267 $entry->context .= PO::unpoify($m[1]);268 } elseif (preg_match('/^msgid\s+(".*")/', $line, $m)) {269 if ($is_final($context)) {270 PO::read_line($f, 'put-back');271 $lineno--;272 break;273 }274 if ($context && $context != 'msgctxt' && $context != 'comment') {275 return false;276 }277 $context = 'msgid';278 $entry->singular .= PO::unpoify($m[1]);279 } elseif (preg_match('/^msgid_plural\s+(".*")/', $line, $m)) {280 if ($context != 'msgid') {281 return false;282 }283 $context = 'msgid_plural';284 $entry->is_plural = true;285 $entry->plural .= PO::unpoify($m[1]);286 } elseif (preg_match('/^msgstr\s+(".*")/', $line, $m)) {287 if ($context != 'msgid') {288 return false;289 }290 $context = 'msgstr';291 $entry->translations = array(PO::unpoify($m[1]));292 } elseif (preg_match('/^msgstr\[(\d+)\]\s+(".*")/', $line, $m)) {293 if ($context != 'msgid_plural' && $context != 'msgstr_plural') {294 return false;295 }296 $context = 'msgstr_plural';297 $msgstr_index = $m[1];298 $entry->translations[$m[1]] = PO::unpoify($m[2]);299 } elseif (preg_match('/^".*"$/', $line)) {300 $unpoified = PO::unpoify($line);301 switch ($context) {302 case 'msgid':303 $entry->singular .= $unpoified; break;304 case 'msgctxt':305 $entry->context .= $unpoified; break;306 case 'msgid_plural':307 $entry->plural .= $unpoified; break;308 case 'msgstr':309 $entry->translations[0] .= $unpoified; break;310 case 'msgstr_plural':311 $entry->translations[$msgstr_index] .= $unpoified; break;312 default:313 return false;314 }315 } else {316 return false;317 }318 }319 if (array() == array_filter($entry->translations)) $entry->translations = array();320 return array('entry' => $entry, 'lineno' => $lineno);321 }322 323 function read_line($f, $action = 'read') {324 static $last_line = '';325 static $use_last_line = false;326 if ('clear' == $action) {327 $last_line = '';328 return true;329 }330 if ('put-back' == $action) {331 $use_last_line = true;332 return true;333 }334 $line = $use_last_line? $last_line : fgets($f);335 $last_line = $line;336 $use_last_line = false;337 return $line;338 }339 340 function add_comment_to_entry(&$entry, $po_comment_line) {341 $first_two = substr($po_comment_line, 0, 2);342 $comment = trim(substr($po_comment_line, 2));343 if ('#:' == $first_two) {344 $entry->references = array_merge($entry->references, preg_split('/\s+/', $comment));345 } elseif ('#.' == $first_two) {346 $entry->extracted_comments = trim($entry->extracted_comments . "\n" . $comment);347 } elseif ('#,' == $first_two) {348 $entry->flags = array_merge($entry->flags, preg_split('/,\s*/', $comment));349 } else {350 $entry->translator_comments = trim($entry->translator_comments . "\n" . $comment);351 }352 }353 354 function trim_quotes($s) {355 if ( substr($s, 0, 1) == '"') $s = substr($s, 1);356 if ( substr($s, -1, 1) == '"') $s = substr($s, 0, -1);357 return $s;358 }359 176 } 360 177 ?> -
branches/2.8/wp-includes/pomo/streams.php
r11698 r11553 4 4 * Based on the classes from Danilo Segan <danilo@kvota.net> 5 5 * 6 * @version $Id: streams.php 138 2009-06-23 13:22:09Z nbachiyski $6 * @version $Id: streams.php 33 2009-02-16 09:33:39Z nbachiyski $ 7 7 * @package pomo 8 8 * @subpackage streams … … 18 18 var $_str; 19 19 20 function POMO_StringReader($str = '') { 21 $this->_str = $str; 22 $this->_pos = 0; 23 $this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr'); 24 } 20 function POMO_StringReader($str = '') { 21 $this->_str = $str; 22 $this->_pos = 0; 23 } 25 24 26 function _substr($string, $start, $length) { 27 if ($this->is_overloaded) { 28 return mb_substr($string,$start,$length,'ascii'); 29 } else { 30 return substr($string,$start,$length); 31 } 32 } 33 34 function _strlen($string) { 35 if ($this->is_overloaded) { 36 return mb_strlen($string,'ascii'); 37 } else { 38 return strlen($string); 39 } 40 } 25 function read($bytes) { 26 $data = substr($this->_str, $this->_pos, $bytes); 27 $this->_pos += $bytes; 28 if (strlen($this->_str)<$this->_pos) 29 $this->_pos = strlen($this->_str); 41 30 42 function read($bytes) { 43 $data = $this->_substr($this->_str, $this->_pos, $bytes); 44 $this->_pos += $bytes; 45 if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str); 46 return $data; 47 } 31 return $data; 32 } 48 33 49 function seekto($pos) { 50 $this->_pos = $pos; 51 if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str); 52 return $this->_pos; 53 } 34 function seekto($pos) { 35 $this->_pos = $pos; 36 if (strlen($this->_str)<$this->_pos) 37 $this->_pos = strlen($this->_str); 38 return $this->_pos; 39 } 54 40 55 56 57 41 function pos() { 42 return $this->_pos; 43 } 58 44 59 60 return $this->_strlen($this->_str);61 45 function length() { 46 return strlen($this->_str); 47 } 62 48 63 49 } … … 68 54 class POMO_CachedFileReader extends POMO_StringReader { 69 55 function POMO_CachedFileReader($filename) { 70 parent::POMO_StringReader();71 56 $this->_str = file_get_contents($filename); 72 57 if (false === $this->_str) 73 58 return false; 74 $this-> _pos = 0;59 $this->pos = 0; 75 60 } 76 61 } … … 112 97 function readint32() { 113 98 $bytes = $this->read(4); 114 if (4 != $this->_strlen($bytes))99 if (4 != strlen($bytes)) 115 100 return false; 116 101 $endian_letter = ('big' == $this->endian)? 'N' : 'V'; … … 128 113 function readint32array($count) { 129 114 $bytes = $this->read(4 * $count); 130 if (4*$count != $this->_strlen($bytes))115 if (4*$count != strlen($bytes)) 131 116 return false; 132 117 $endian_letter = ('big' == $this->endian)? 'N' : 'V'; -
branches/2.8/wp-includes/pomo/translations.php
r11698 r11553 3 3 * Class for a set of entries for translation and their associated headers 4 4 * 5 * @version $Id: translations.php 114 2009-05-11 17:30:38Z nbachiyski $5 * @version $Id: translations.php 35 2009-02-16 12:54:57Z nbachiyski $ 6 6 * @package pomo 7 7 * @subpackage translations … … 20 20 * @return bool true on success, false if the entry doesn't have a key 21 21 */ 22 function add_entry($entry) { 23 if (is_array($entry)) { 24 $entry = new Translation_Entry($entry); 25 } 22 function add_entry(&$entry) { 26 23 $key = $entry->key(); 27 24 if (false === $key) return false; 28 $this->entries[$key] = $entry;25 $this->entries[$key] = &$entry; 29 26 return true; 30 27 } … … 91 88 if ($translated && 0 <= $index && $index < $total_plural_forms && 92 89 is_array($translated->translations) && 93 isset($translated->translations[$index]))90 count($translated->translations) == $total_plural_forms) 94 91 return $translated->translations[$index]; 95 92 else … … 97 94 } 98 95 99 /**100 * Merge $other in the current object.101 *102 * @param Object &$other Another Translation object, whose translations will be merged in this one103 * @return void104 **/105 function merge_with(&$other) {106 $this->entries = array_merge($this->entries, $other->entries);107 }108 }109 110 class Gettext_Translations extends Translations {111 96 /** 112 97 * The gettext implmentation of select_plural_form. … … 146 131 * Adds parantheses to the inner parts of ternary operators in 147 132 * plural expressions, because PHP evaluates ternary oerators from left to right 148 * 133 * 149 134 * @param string $expression the expression without parentheses 150 135 * @return string the expression with parentheses added … … 174 159 return rtrim($res, ';'); 175 160 } 176 177 function make_headers($translation) { 178 $headers = array(); 179 // sometimes \ns are used instead of real new lines 180 $translation = str_replace('\n', "\n", $translation); 181 $lines = explode("\n", $translation); 182 foreach($lines as $line) { 183 $parts = explode(':', $line, 2); 184 if (!isset($parts[1])) continue; 185 $headers[trim($parts[0])] = trim($parts[1]); 186 } 187 return $headers; 161 162 /** 163 * Merge $other in the current object. 164 * 165 * @param Object &$other Another Translation object, whose translations will be merged in this one 166 * @return void 167 **/ 168 function merge_with(&$other) { 169 $this->entries = array_merge($this->entries, $other->entries); 188 170 } 189 190 function set_header($header, $value) {191 parent::set_header($header, $value);192 if ('Plural-Forms' == $header)193 $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($value);194 }195 196 197 171 } 198 172 -
branches/2.8/wp-includes/post-template.php
r11698 r11553 431 431 $classes[] = 'page-parent'; 432 432 433 if ( $wp_query->post->post_parent ) {433 if ( $wp_query->post->post_parent ) 434 434 $classes[] = 'page-child'; 435 435 $classes[] = 'parent-pageid-' . $wp_query->post->post_parent; 436 } 437 if ( is_page_template() ) {436 437 if ( is_page_template() ) 438 438 $classes[] = 'page-template'; 439 439 $classes[] = 'page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) ); 440 }441 440 } elseif ( is_search() ) { 442 441 if ( !empty($wp_query->posts) ) … … 807 806 */ 808 807 function wp_page_menu( $args = array() ) { 809 $defaults = array('sort_column' => ' menu_order,post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');808 $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => ''); 810 809 $args = wp_parse_args( $args, $defaults ); 811 810 $args = apply_filters( 'wp_page_menu_args', $args ); -
branches/2.8/wp-includes/post.php
r11698 r11553 1193 1193 clean_page_cache($child->ID); 1194 1194 1195 $wp_rewrite->flush_rules( false);1195 $wp_rewrite->flush_rules(); 1196 1196 } else { 1197 1197 clean_post_cache($postid); … … 3355 3355 if ( !defined('WP_IMPORTING') ) { 3356 3356 global $wp_rewrite; 3357 $wp_rewrite->flush_rules( false);3357 $wp_rewrite->flush_rules(); 3358 3358 } 3359 3359 } else { -
branches/2.8/wp-includes/query.php
r11698 r11553 1235 1235 $qv['w'] = absint($qv['w']); 1236 1236 $qv['m'] = absint($qv['m']); 1237 $qv['paged'] = absint($qv['paged']);1238 1237 $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers 1239 1238 $qv['pagename'] = trim( $qv['pagename'] ); -
branches/2.8/wp-includes/rewrite.php
r11698 r11553 1823 1823 * @since 2.0.1 1824 1824 * @access public 1825 * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard). 1826 */ 1827 function flush_rules($hard = true) { 1825 */ 1826 function flush_rules() { 1828 1827 delete_transient('rewrite_rules'); 1829 1828 $this->wp_rewrite_rules(); 1830 if ( $hard &&function_exists('save_mod_rewrite_rules') )1829 if ( function_exists('save_mod_rewrite_rules') ) 1831 1830 save_mod_rewrite_rules(); 1832 if ( $hard &&function_exists('iis7_save_url_rewrite_rules') )1831 if ( function_exists('iis7_save_url_rewrite_rules') ) 1833 1832 iis7_save_url_rewrite_rules(); 1834 1833 } -
branches/2.8/wp-includes/script-loader.php
r11698 r11553 241 241 $scripts->add_data( 'user-profile', 'group', 1 ); 242 242 243 $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090 627' );243 $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090209' ); 244 244 $scripts->add_data( 'admin-comments', 'group', 1 ); 245 245 $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( … … 250 250 $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", false, '3517m' ); 251 251 252 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090 618' );252 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090327' ); 253 253 $scripts->add_data( 'postbox', 'group', 1 ); 254 254 $scripts->localize( 'postbox', 'postboxL10n', array( … … 265 265 ) ); 266 266 267 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'slug'), '20090 624' );267 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'slug'), '20090526' ); 268 268 $scripts->add_data( 'post', 'group', 1 ); 269 269 $scripts->localize( 'post', 'postL10n', array( … … 378 378 $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); 379 379 380 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090 618' );380 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090201' ); 381 381 $scripts->add_data( 'dashboard', 'group', 1 ); 382 382 … … 422 422 423 423 // all colors stylesheets need to have the same query strings (cache manifest compat) 424 $colors_version = '200906 25';425 426 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '200906 25' );424 $colors_version = '20090610'; 425 426 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090610' ); 427 427 $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); 428 428 429 $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090 630' );429 $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090514' ); 430 430 $styles->add_data( 'ie', 'conditional', 'lte IE 7' ); 431 431 … … 439 439 $styles->add_data( 'colors-classic', 'rtl', true ); 440 440 441 $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090 630' );441 $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090514' ); 442 442 $styles->add( 'media', '/wp-admin/css/media.css', array(), '20090516' ); 443 443 $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20090603' ); 444 444 $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20090514' ); 445 445 $styles->add( 'install', '/wp-admin/css/install.css', array(), '20090514' ); 446 $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css', array(), '20090 625' );446 $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css', array(), '20090514' ); 447 447 $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20090514' ); 448 448 $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' ); -
branches/2.8/wp-includes/update.php
r11698 r11553 116 116 $new_option = new stdClass; 117 117 $new_option->last_checked = time(); 118 $timeout = 'load-plugins.php' == current_filter() ? 360 0: 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours118 $timeout = 'load-plugins.php' == current_filter() ? 360 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours 119 119 $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked ); 120 120 … … 199 199 $new_option = new stdClass; 200 200 $new_option->last_checked = time( ); 201 $timeout = 'load-themes.php' == current_filter() ? 360 0: 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours201 $timeout = 'load-themes.php' == current_filter() ? 360 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours 202 202 $time_not_changed = isset( $current_theme->last_checked ) && $timeout > ( time( ) - $current_theme->last_checked ); 203 203 -
branches/2.8/wp-includes/version.php
r11698 r11553 9 9 * @global string $wp_version 10 10 */ 11 $wp_version = '2.8.1- RC1';11 $wp_version = '2.8.1-rare'; 12 12 13 13 /** … … 30 30 * @global string $manifest_version 31 31 */ 32 $manifest_version = '2009061 6';32 $manifest_version = '20090610'; -
branches/2.8/wp-includes/widgets.php
r11698 r11553 886 886 global $wp_registered_widgets; 887 887 888 $sidebars_widgets = wp_get_sidebars_widgets( );888 $sidebars_widgets = wp_get_sidebars_widgets(false); 889 889 890 890 if ( is_array($sidebars_widgets) ) { … … 936 936 function is_active_sidebar( $index ) { 937 937 $index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index); 938 $sidebars_widgets = wp_get_sidebars_widgets();938 $sidebars_widgets = get_option( 'sidebars_widgets', array() ); 939 939 if ( isset($sidebars_widgets[$index]) && !empty($sidebars_widgets[$index]) ) 940 940 return true; … … 954 954 * @access private 955 955 * 956 * @param bool $update Optional, de precated.957 * @return array Upgraded list of widgets to version 3 array format when called from the admin.958 */ 959 function wp_get_sidebars_widgets($ deprecated= true) {956 * @param bool $update Optional, default is true. Whether to save upgrade of widget array list. 957 * @return array Upgraded list of widgets to version 2 array format. 958 */ 959 function wp_get_sidebars_widgets($update = true) { 960 960 global $wp_registered_widgets, $wp_registered_sidebars, $_wp_sidebars_widgets; 961 961 962 962 // If loading from front page, consult $_wp_sidebars_widgets rather than options 963 963 // to see if wp_convert_widget_settings() has made manipulations in memory. 964 if ( !is_admin() ) { 964 if ( is_admin() ) { 965 $sidebars_widgets = get_option('sidebars_widgets', array()); 966 } else { 965 967 if ( empty($_wp_sidebars_widgets) ) 966 $_wp_sidebars_widgets = get_option('sidebars_widgets', array()); 967 968 $sidebars_widgets = $_wp_sidebars_widgets; 969 } else { 970 $sidebars_widgets = get_option('sidebars_widgets', array()); 971 $_sidebars_widgets = array(); 972 973 if ( isset($sidebars_widgets['wp_inactive_widgets']) ) 974 $sidebars_widgets['array_version'] = 3; 975 elseif ( !isset($sidebars_widgets['array_version']) ) 976 $sidebars_widgets['array_version'] = 1; 977 978 switch ( $sidebars_widgets['array_version'] ) { 979 case 1 : 980 foreach ( (array) $sidebars_widgets as $index => $sidebar ) 981 if ( is_array($sidebar) ) 982 foreach ( (array) $sidebar as $i => $name ) { 983 $id = strtolower($name); 984 if ( isset($wp_registered_widgets[$id]) ) { 985 $_sidebars_widgets[$index][$i] = $id; 986 continue; 968 $sidebars_widgets = get_option('sidebars_widgets', array()); 969 else 970 $sidebars_widgets = &$_wp_sidebars_widgets; 971 } 972 $_sidebars_widgets = array(); 973 974 if ( !isset($sidebars_widgets['array_version']) ) 975 $sidebars_widgets['array_version'] = 1; 976 977 switch ( $sidebars_widgets['array_version'] ) { 978 case 1 : 979 foreach ( (array) $sidebars_widgets as $index => $sidebar ) 980 if ( is_array($sidebar) ) 981 foreach ( (array) $sidebar as $i => $name ) { 982 $id = strtolower($name); 983 if ( isset($wp_registered_widgets[$id]) ) { 984 $_sidebars_widgets[$index][$i] = $id; 985 continue; 986 } 987 $id = sanitize_title($name); 988 if ( isset($wp_registered_widgets[$id]) ) { 989 $_sidebars_widgets[$index][$i] = $id; 990 continue; 991 } 992 993 $found = false; 994 995 foreach ( $wp_registered_widgets as $widget_id => $widget ) { 996 if ( strtolower($widget['name']) == strtolower($name) ) { 997 $_sidebars_widgets[$index][$i] = $widget['id']; 998 $found = true; 999 break; 1000 } elseif ( sanitize_title($widget['name']) == sanitize_title($name) ) { 1001 $_sidebars_widgets[$index][$i] = $widget['id']; 1002 $found = true; 1003 break; 987 1004 } 988 $id = sanitize_title($name); 989 if ( isset($wp_registered_widgets[$id]) ) { 990 $_sidebars_widgets[$index][$i] = $id; 991 continue; 1005 } 1006 1007 if ( $found ) 1008 continue; 1009 1010 unset($_sidebars_widgets[$index][$i]); 1011 } 1012 $_sidebars_widgets['array_version'] = 2; 1013 $sidebars_widgets = $_sidebars_widgets; 1014 unset($_sidebars_widgets); 1015 1016 case 2 : 1017 $sidebars = array_keys( $wp_registered_sidebars ); 1018 if ( !empty( $sidebars ) ) { 1019 // Move the known-good ones first 1020 foreach ( (array) $sidebars as $id ) { 1021 if ( array_key_exists( $id, $sidebars_widgets ) ) { 1022 $_sidebars_widgets[$id] = $sidebars_widgets[$id]; 1023 unset($sidebars_widgets[$id], $sidebars[$id]); 992 1024 } 993 994 $found = false;995 996 foreach ( $wp_registered_widgets as $widget_id => $widget ) {997 if ( strtolower($widget['name']) == strtolower($name) ) {998 $_sidebars_widgets[$index][$i] = $widget['id'];999 $found = true;1000 break;1001 } elseif ( sanitize_title($widget['name']) == sanitize_title($name) ) {1002 $_sidebars_widgets[$index][$i] = $widget['id'];1003 $found = true;1004 break;1005 }1006 }1007 1008 if ( $found )1009 continue;1010 1011 unset($_sidebars_widgets[$index][$i]);1012 1025 } 1013 $_sidebars_widgets['array_version'] = 2; 1026 1027 // Assign to each unmatched registered sidebar the first available orphan 1028 unset( $sidebars_widgets[ 'array_version' ] ); 1029 while ( ( $sidebar = array_shift( $sidebars ) ) && $widgets = array_shift( $sidebars_widgets ) ) 1030 $_sidebars_widgets[ $sidebar ] = $widgets; 1031 1032 $_sidebars_widgets['array_version'] = 3; 1014 1033 $sidebars_widgets = $_sidebars_widgets; 1015 1034 unset($_sidebars_widgets); 1016 1017 case 2 : 1018 $sidebars = array_keys( $wp_registered_sidebars ); 1019 if ( !empty( $sidebars ) ) { 1020 // Move the known-good ones first 1021 foreach ( (array) $sidebars as $id ) { 1022 if ( array_key_exists( $id, $sidebars_widgets ) ) { 1023 $_sidebars_widgets[$id] = $sidebars_widgets[$id]; 1024 unset($sidebars_widgets[$id], $sidebars[$id]); 1025 } 1026 } 1027 1028 // move the rest to wp_inactive_widgets 1029 if ( !isset($_sidebars_widgets['wp_inactive_widgets']) ) 1030 $_sidebars_widgets['wp_inactive_widgets'] = array(); 1031 1032 if ( !empty($sidebars_widgets) ) { 1033 foreach ( $sidebars_widgets as $lost => $val ) { 1034 if ( is_array($val) ) 1035 $_sidebars_widgets['wp_inactive_widgets'] = array_merge( (array) $_sidebars_widgets['wp_inactive_widgets'], $val ); 1036 } 1037 } 1038 1039 $sidebars_widgets = $_sidebars_widgets; 1040 unset($_sidebars_widgets); 1041 } 1042 } 1035 } 1036 1037 if ( $update && is_admin() ) 1038 update_option('sidebars_widgets', $sidebars_widgets); 1043 1039 } 1044 1040 … … 1091 1087 */ 1092 1088 function wp_convert_widget_settings($base_name, $option_name, $settings) { 1089 global $_wp_sidebars_widgets; 1093 1090 // This test may need expanding. 1094 $single = $changed =false;1091 $single = false; 1095 1092 if ( empty($settings) ) { 1096 1093 $single = true; … … 1114 1111 } else { 1115 1112 if ( empty($GLOBALS['_wp_sidebars_widgets']) ) 1116 $GLOBALS['_wp_sidebars_widgets'] = get_option('sidebars_widgets' , array());1113 $GLOBALS['_wp_sidebars_widgets'] = get_option('sidebars_widgets'); 1117 1114 $sidebars_widgets = &$GLOBALS['_wp_sidebars_widgets']; 1118 1115 } … … 1123 1120 if ( $base_name == $name ) { 1124 1121 $sidebars_widgets[$index][$i] = "$name-2"; 1125 $changed = true;1126 1122 break 2; 1127 1123 } … … 1130 1126 } 1131 1127 1132 if ( is_admin() && $changed)1128 if ( is_admin() ) 1133 1129 update_option('sidebars_widgets', $sidebars_widgets); 1134 1130 } -
branches/2.8/wp-settings.php
r11698 r11553 61 61 $blog_id = 1; 62 62 63 // Fix for IIS when running with PHP ISAPI64 if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) )) {63 // Fix for IIS, which doesn't set REQUEST_URI 64 if ( empty( $_SERVER['REQUEST_URI'] ) ) { 65 65 66 66 // IIS Mod-Rewrite … … 317 317 require_once(ABSPATH . WPINC . '/kses.php'); 318 318 require_once(ABSPATH . WPINC . '/pluggable.php'); 319 require_once(ABSPATH . WPINC . '/formatting.php');320 319 wp_redirect($link); 321 320 die(); // have to die here ~ Mark … … 530 529 require (ABSPATH . WPINC . '/vars.php'); 531 530 532 // make taxonomies available to plugins and themes533 // @plugin authors: warning: this gets registered again on the init hook534 create_initial_taxonomies();535 536 531 // Check for hacks file if the option is enabled 537 532 if ( get_option('hack_file') ) { -
branches/2.8/xmlrpc.php
r11698 r11553 40 40 <homePageLink><?php bloginfo_rss('url') ?></homePageLink> 41 41 <apis> 42 <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php' , 'rpc') ?>" />43 <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php' , 'rpc') ?>" />44 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php' , 'rpc') ?>" />45 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php' , 'rpc') ?>" />46 <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service' , 'rpc') ) ?>" />42 <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> 43 <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> 44 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> 45 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" /> 46 <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service') ) ?>" /> 47 47 </apis> 48 48 </service> … … 2574 2574 $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false); 2575 2575 $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false); 2576 2577 // For drafts use the GMT version of the post date2578 if ( $postdata['post_status'] == 'draft' ) {2579 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ) );2580 $post_date_gmt = preg_replace( '|\-|', '', $post_date_gmt );2581 $post_date_gmt = preg_replace( '| |', 'T', $post_date_gmt );2582 }2583 2576 2584 2577 $categories = array(); … … 3301 3294 $p = explode( "\n\n", $linea ); 3302 3295 3303 $preg_target = preg_quote($pagelinkedto , '|');3296 $preg_target = preg_quote($pagelinkedto); 3304 3297 3305 3298 foreach ( $p as $para ) { … … 3323 3316 $excerpt = strip_tags($excerpt, '<wpcontext>'); // strip all tags but our context marker 3324 3317 $excerpt = trim($excerpt); 3325 $preg_marker = preg_quote($marker , '|');3318 $preg_marker = preg_quote($marker); 3326 3319 $excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt); 3327 3320 $excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
Note: See TracChangeset
for help on using the changeset viewer.