Changeset 8600
- Timestamp:
- 08/09/2008 05:36:14 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 89 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r8490 r8600 14 14 $s = $_GET['q']; // is this slashed already? 15 15 16 if ( strstr( $s, ',' ) ) { 17 $s = explode( ',', $s ); 18 $s = $s[count( $s ) - 1]; 16 if ( strstr( $s, ',' ) ) { 17 $s = explode( ',', $s ); 18 $s = $s[count( $s ) - 1]; 19 19 } 20 20 $s = trim( $s ); … … 279 279 $x->send(); 280 280 } 281 281 282 282 $cat = wp_insert_category( $_POST, true ); 283 283 -
trunk/wp-admin/admin-header.php
r8419 r8600 75 75 76 76 <?php 77 if ( ! $is_opera ) { 77 if ( ! $is_opera ) { 78 78 ?> 79 79 <div id="gears-info-box" class="info-box" style="display:none;"> … … 90 90 <div id="gears-msg2" style="display:none;"> 91 91 <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3> 92 <p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p> 93 <p><?php 94 92 <p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p> 93 <p><?php 94 95 95 if ( $is_safari ) 96 96 _e('To enable it, make sure this web site is not on the denied list in Gears Settings under the Safari menu, then click the button below.'); 97 97 else 98 _e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser Tools menu, then click the button below.'); 99 98 _e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser Tools menu, then click the button below.'); 99 100 100 ?></p> 101 101 <p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p> … … 107 107 <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3> 108 108 <p><?php 109 109 110 110 if ( $is_safari ) 111 111 _e('Gears is installed and enabled on this computer. You can disable it from the Safari menu.'); 112 112 else 113 _e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); 114 113 _e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); 114 115 115 ?></p> 116 116 <p><?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?></p> -
trunk/wp-admin/async-upload.php
r8190 r8600 23 23 wp_die(__('You do not have permission to upload files.')); 24 24 25 // just fetch the detail form for that attachment 25 // just fetch the detail form for that attachment 26 26 if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { 27 27 echo get_media_item($id); -
trunk/wp-admin/css/colors-classic.css
r8540 r8600 555 555 /* TinyMCE */ 556 556 .wp_themeSkin *, 557 .wp_themeSkin a:hover, 558 .wp_themeSkin a:link, 559 .wp_themeSkin a:visited, 557 .wp_themeSkin a:hover, 558 .wp_themeSkin a:link, 559 .wp_themeSkin a:visited, 560 560 .wp_themeSkin a:active { 561 561 color: #000; … … 578 578 579 579 /* Button */ 580 .wp_themeSkin .mceButton { 580 .wp_themeSkin .mceButton { 581 581 background-color: #e9e8e8; 582 582 border-color: #83B4D5; … … 584 584 585 585 .wp_themeSkin a.mceButtonEnabled:hover, 586 .wp_themeSkin a.mceButtonActive, 586 .wp_themeSkin a.mceButtonActive, 587 587 .wp_themeSkin a.mceButtonSelected { 588 588 background-color: #d6d8da; … … 601 601 } 602 602 603 .wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 603 .wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 604 604 .wp_themeSkin .mceListBoxHover .mceOpen, 605 605 .wp_themeSkin .mceListBoxSelected .mceOpen, … … 609 609 } 610 610 611 .wp_themeSkin table.mceListBoxEnabled:hover .mceText, 611 .wp_themeSkin table.mceListBoxEnabled:hover .mceText, 612 612 .wp_themeSkin .mceListBoxHover .mceText { 613 613 border-color: #7789ba !important; … … 615 615 616 616 .wp_themeSkin select.mceListBox { 617 border-color: #b3c7e1; 617 border-color: #b3c7e1; 618 618 background-color: #fff; 619 619 } 620 620 621 621 /* SplitButton */ 622 .wp_themeSkin .mceSplitButton a.mceAction, 622 .wp_themeSkin .mceSplitButton a.mceAction, 623 623 .wp_themeSkin .mceSplitButton a.mceOpen { 624 624 background-color: #e9e8e8; … … 632 632 background-color: #d6d8da; 633 633 border-color: #7789ba !important; 634 } 634 } 635 635 636 636 .wp_themeSkin .mceSplitButtonActive { … … 671 671 672 672 .wp_themeSkin .mceMenu .mceText { 673 color: #000; 673 color: #000; 674 674 } 675 675 … … 682 682 } 683 683 .wp_themeSkin .mceMenuItemTitle a { 684 background-color: #ccc; 684 background-color: #ccc; 685 685 border-bottom-color: #aaa; 686 686 } -
trunk/wp-admin/css/colors-fresh.css
r8540 r8600 38 38 #user_info a:hover, li.widget-list-control-item h4.widget-title a:hover, .submit a, #dashmenu a:hover, #footer a, #upload-menu li a.upload-tab-link, li.widget-list-control-item h4.widget-title a, 39 39 #dragHelper li.widget-list-control-item h4.widget-title a, 40 #draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover, 40 #draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover, 41 41 #plugin-information .action-button a, #plugin-information .action-button a:hover, #plugin-information .action-button a:visited { 42 42 color: #fff; … … 527 527 /* TinyMCE */ 528 528 .wp_themeSkin *, 529 .wp_themeSkin a:hover, 530 .wp_themeSkin a:link, 531 .wp_themeSkin a:visited, 529 .wp_themeSkin a:hover, 530 .wp_themeSkin a:link, 531 .wp_themeSkin a:visited, 532 532 .wp_themeSkin a:active { 533 533 color: #000; … … 550 550 551 551 /* Button */ 552 .wp_themeSkin .mceButton { 552 .wp_themeSkin .mceButton { 553 553 background-color: #e9e8e8; 554 554 border-color: #abc0fb; … … 556 556 557 557 .wp_themeSkin a.mceButtonEnabled:hover, 558 .wp_themeSkin a.mceButtonActive, 558 .wp_themeSkin a.mceButtonActive, 559 559 .wp_themeSkin a.mceButtonSelected { 560 560 background-color: #d6d8da; … … 573 573 } 574 574 575 .wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 575 .wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 576 576 .wp_themeSkin .mceListBoxHover .mceOpen, 577 577 .wp_themeSkin .mceListBoxSelected .mceOpen, … … 581 581 } 582 582 583 .wp_themeSkin table.mceListBoxEnabled:hover .mceText, 583 .wp_themeSkin table.mceListBoxEnabled:hover .mceText, 584 584 .wp_themeSkin .mceListBoxHover .mceText { 585 585 border-color: #7789ba !important; … … 587 587 588 588 .wp_themeSkin select.mceListBox { 589 border-color: #b3c7e1; 589 border-color: #b3c7e1; 590 590 background-color: #fff; 591 591 } 592 592 593 593 /* SplitButton */ 594 .wp_themeSkin .mceSplitButton a.mceAction, 594 .wp_themeSkin .mceSplitButton a.mceAction, 595 595 .wp_themeSkin .mceSplitButton a.mceOpen { 596 596 background-color: #e9e8e8; … … 604 604 background-color: #d6d8da; 605 605 border-color: #7789ba !important; 606 } 606 } 607 607 608 608 .wp_themeSkin .mceSplitButtonActive { … … 643 643 644 644 .wp_themeSkin .mceMenu .mceText { 645 color: #000; 645 color: #000; 646 646 } 647 647 … … 654 654 } 655 655 .wp_themeSkin .mceMenuItemTitle a { 656 background-color: #ccc; 656 background-color: #ccc; 657 657 border-bottom-color: #aaa; 658 658 } -
trunk/wp-admin/css/dashboard-rtl.css
r8327 r8600 26 26 font-family: sans-serif !important; 27 27 } 28 28 29 29 #dashboard-widgets .widget_rss ul li a { 30 30 float:right; -
trunk/wp-admin/css/dashboard.css
r7453 r8600 67 67 } 68 68 69 div.dashboard-widget-holder { 69 div.dashboard-widget-holder { 70 70 margin-top: 20px; 71 71 width: 50%; … … 158 158 border-radius: 3px; 159 159 cursor: pointer; 160 text-decoration: none; 160 text-decoration: none; 161 161 } 162 162 -
trunk/wp-admin/css/global-rtl.css
r8327 r8600 9 9 .textleft { text-align: right; } 10 10 .textright { text-align: left; } 11 11 12 12 .wrap h2 { font-family: sans-serif; } 13 13 -
trunk/wp-admin/css/ie-rtl.css
r8590 r8600 4 4 } 5 5 6 #wpcontent #sidemenu li a { 7 float: left; 6 #wpcontent #sidemenu li a { 7 float: left; 8 8 } 9 9 … … 60 60 61 61 /* Search box gets stuck to the right, hidden outside view */ 62 * html #post-search, * html #widget-search { 62 * html #post-search, * html #widget-search { 63 63 height: 1% !important; 64 64 right: 600px !important; … … 76 76 77 77 /* Bad floating in the sub-sub-sub menu makes links un-clickable */ 78 * html .subsubsub li { 78 * html .subsubsub li { 79 79 display: block; float: right; margin: 0 2px; 80 80 } … … 86 86 87 87 /* Theme selector on theme edit page gets stuck to the left, hidden outside view */ 88 * html #themeselector { 88 * html #themeselector { 89 89 position: static; 90 90 } … … 92 92 /* Template edit area floats beneath template list, gets RTLed */ 93 93 * html #template { 94 float: right; 94 float: right; 95 95 overflow: hidden; 96 width: 755px !important; 96 width: 755px !important; 97 97 } 98 98 * html #template #newcontent { -
trunk/wp-admin/css/login.css
r7187 r8600 31 31 border-radius: 3px; 32 32 cursor: default; 33 text-decoration: none; 33 text-decoration: none; 34 34 margin-top: -6px; 35 35 } -
trunk/wp-admin/css/media-rtl.css
r7398 r8600 7 7 float: right; 8 8 padding: 0 25px 0 0; 9 margin: 5px 3px 5px 5px; 9 margin: 5px 3px 5px 5px; 10 10 } 11 11 .align .field input { -
trunk/wp-admin/css/press-this-rtl.css
r8328 r8600 3 3 } 4 4 5 #viewsite { 6 right:auto; left: 8px; 5 #viewsite { 6 right:auto; left: 8px; 7 7 } 8 8 9 ul#menu { 10 padding-right: 8px; 9 ul#menu { 10 padding-right: 8px; 11 11 } 12 12 13 .ui-tabs-nav li { 14 float: right; 13 .ui-tabs-nav li { 14 float: right; 15 15 } 16 16 17 div#posting { 18 padding-right:16px; padding-left: 0; 17 div#posting { 18 padding-right:16px; padding-left: 0; 19 19 } 20 20 21 div#categories { 22 right: auto; left: 16px; 21 div#categories { 22 right: auto; left: 16px; 23 23 } 24 24 25 div#categories h2 { 26 margin:0.5em 1em 0.5em 0; 25 div#categories h2 { 26 margin:0.5em 1em 0.5em 0; 27 27 } 28 28 29 #jaxtag { 30 padding-right :1em; padding-left: 0; 29 #jaxtag { 30 padding-right :1em; padding-left: 0; 31 31 } 32 32 33 input#newtag { 34 margin-left: 4px; width: 100px; 33 input#newtag { 34 margin-left: 4px; width: 100px; 35 35 } 36 36 37 #photo_directions span { 38 right: auto; left: 3px 37 #photo_directions span { 38 right: auto; left: 3px 39 39 } 40 40 41 #TB_ajaxContent #options { 42 right: auto; left: 25px; 41 #TB_ajaxContent #options { 42 right: auto; left: 25px; 43 43 } 44 44 … … 51 51 } 52 52 53 .video_split #extra_fields { 54 float: right; 53 .video_split #extra_fields { 54 float: right; 55 55 } 56 56 57 .video_split .editor_area { 58 float: left; 57 .video_split .editor_area { 58 float: left; 59 59 } -
trunk/wp-admin/css/press-this.css
r8551 r8600 87 87 88 88 .ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active, 89 .ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited { 89 .ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited { 90 90 cursor: pointer; 91 91 } … … 262 262 border: 2px solid #ccc; 263 263 margin: 0 4px 4px 0; 264 } 264 } 265 265 #img_container a:hover, #img_container a:active { 266 266 border: 2px solid #000; … … 300 300 padding: 3px; 301 301 margin-right: 5px; 302 width: 16em; 302 width: 16em; 303 303 } 304 304 -
trunk/wp-admin/css/widgets.css
r7977 r8600 113 113 } 114 114 115 li.widget-list-control-item h4, 116 #dragHelper li.widget-list-control-item h4, 115 li.widget-list-control-item h4, 116 #dragHelper li.widget-list-control-item h4, 117 117 li.widget-sortable h4 { 118 118 margin: 0; -
trunk/wp-admin/custom-header.php
r7998 r8600 28 28 if ( 1 == $step ) 29 29 wp_enqueue_script('colorpicker'); 30 elseif ( 2 == $step ) 30 elseif ( 2 == $step ) 31 31 wp_enqueue_script('cropper'); 32 32 } -
trunk/wp-admin/edit-form-advanced.php
r8589 r8600 106 106 <p> 107 107 <select name='post_status' id='post_status' tabindex='4'> 108 <?php 109 // only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability) 108 <?php 109 // only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability) 110 110 if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : 111 111 ?> -
trunk/wp-admin/edit-link-categories.php
r8388 r8600 12 12 $cat_name = get_term_field('name', $cat_ID, 'link_category'); 13 13 $default_cat_id = get_option('default_link_category'); 14 14 15 15 // Don't delete the default cats. 16 16 if ( $cat_ID == $default_cat_id ) -
trunk/wp-admin/edit-link-form.php
r8589 r8600 117 117 <div id="categories-all" class="ui-tabs-panel"> 118 118 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 119 <?php 119 <?php 120 120 if ( isset($link->link_id) ) 121 121 wp_link_category_checklist($link->link_id); -
trunk/wp-admin/edit-page-form.php
r8589 r8600 91 91 <?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages') 92 92 // 'publish' option will be selected for published AND private posts (checkbox overrides dropdown) 93 if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : 93 if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : 94 94 ?> 95 95 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> … … 102 102 </select> 103 103 </p> 104 <?php if ( current_user_can( 'publish_posts' ) ) : ?> 104 <?php if ( current_user_can( 'publish_posts' ) ) : ?> 105 105 <p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p> 106 106 <?php endif; ?> … … 210 210 211 211 212 <?php 212 <?php 213 213 function page_custom_meta_box($post){ 214 214 ?> … … 239 239 <p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p> 240 240 <p><?php _e('These settings apply to this page only. “Pings” are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p> 241 <?php 241 <?php 242 242 } 243 243 add_meta_box('pagecommentstatusdiv', __('Comments & Pings'), 'page_comments_status_meta_box', 'page', 'advanced', 'core'); -
trunk/wp-admin/gears-manifest.php
r8517 r8600 47 47 if ( is_bool( $style->extra['rtl'] ) ) 48 48 $rtl_href = str_replace( '.css', '-rtl.css', $src ); 49 else 49 else 50 50 $rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] ); 51 51 -
trunk/wp-admin/import/mt.php
r7999 r8600 225 225 wp_create_categories($post->categories, $post_id); 226 226 } 227 227 228 228 // Add tags or keywords 229 229 if ( 1 < strlen($post->post_keywords) ) { 230 // Keywords exist. 230 // Keywords exist. 231 231 printf(__('<br />Adding tags <i>%s</i>...'), stripslashes($post->post_keywords)); 232 232 wp_add_post_tags($post_id, $post->post_keywords); -
trunk/wp-admin/import/wordpress.php
r7965 r8600 340 340 if ( $post_ID && !empty($this->post_ids_processed[$post_ID]) ) // Processed already 341 341 return 0; 342 342 343 343 set_time_limit( 60 ); 344 344 -
trunk/wp-admin/import/wp-cat2tag.php
r8279 r8600 104 104 if ( in_array( intval($category->term_id), $this->hybrids_ids ) ) 105 105 echo ' <a href="#note"> * </a>'; 106 106 107 107 if ( isset($hier[$category->term_id]) ) 108 108 $this->_category_children($category, $hier); ?></li> … … 244 244 if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) ) 245 245 $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); 246 246 247 247 $id = $id['term_taxonomy_id']; 248 248 $posts = get_objects_in_term($category->term_id, 'category'); … … 253 253 clean_post_cache($post); 254 254 } 255 255 256 256 if ( $values ) { 257 257 $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); … … 263 263 continue; 264 264 } 265 265 266 266 // if tag already exists, add it to all posts in the category 267 267 if ( $tag_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $category->term_id) ) ) { -
trunk/wp-admin/includes/bookmark.php
r7693 r8600 121 121 if ( $update ) { 122 122 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_url = %s, 123 link_name = %s, link_image = %s, link_target = %s, 124 link_visible = %s, link_description = %s, link_rating = %s, 123 link_name = %s, link_image = %s, link_target = %s, 124 link_visible = %s, link_description = %s, link_rating = %s, 125 125 link_rel = %s, link_notes = %s, link_rss = %s 126 126 WHERE link_id = %s", $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id) ); 127 127 } else { 128 $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", 128 $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", 129 129 $link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss) ); 130 130 $link_id = (int) $wpdb->insert_id; -
trunk/wp-admin/includes/class-wp-filesystem-base.php
r8255 r8600 3 3 var $verbose = false; 4 4 var $cache = array(); 5 5 6 6 var $method = ''; 7 7 8 8 function abspath() { 9 if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false ) 9 if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false ) 10 10 return FTP_BASE; 11 11 return $this->find_folder(ABSPATH); 12 12 } 13 13 function wp_content_dir() { 14 if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false ) 14 if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false ) 15 15 return FTP_CONTENT_DIR; 16 16 return $this->find_folder(WP_CONTENT_DIR); 17 17 } 18 18 function wp_plugins_dir() { 19 if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false ) 19 if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false ) 20 20 return FTP_PLUGIN_DIR; 21 21 return $this->find_folder(WP_PLUGIN_DIR); … … 34 34 return $this->abspath(); 35 35 } 36 36 37 37 function find_folder($folder) { 38 38 $folder = str_replace('\\', '/', $folder); //Windows Sanitiation … … 48 48 return $return; 49 49 } 50 50 51 51 // Assumes $folder is windows sanitized; 52 52 // Assumes that the drive letter is safe to be stripped off, Should not be a problem for windows servers. … … 54 54 if ( empty( $base ) || '.' == $base ) 55 55 $base = trailingslashit($this->cwd()); 56 56 57 57 $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there. 58 58 59 59 $folder_parts = explode('/', $folder); 60 60 $last_path = $folder_parts[ count($folder_parts) - 1 ]; 61 61 62 62 $files = $this->dirlist( $base ); 63 63 64 64 foreach ( $folder_parts as $key ) { 65 65 if ( $key == $last_path ) 66 66 continue; //We want this to be caught by the next code block. 67 67 68 //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, 69 // If its found, change into it and follow through looking for it. 68 //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, 69 // If its found, change into it and follow through looking for it. 70 70 // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on. 71 71 // If it reaches the end, and still cant find it, it'll return false for the entire function. … … 79 79 } 80 80 } 81 81 82 82 //Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take. 83 83 if(isset( $files[ $last_path ] ) ) { … … 89 89 return false;//Prevent tihs function looping again. 90 90 //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. 91 return $this->search_for_folder($folder, '/', true); 92 91 return $this->search_for_folder($folder, '/', true); 92 93 93 } 94 94 95 95 //Common Helper functions. 96 96 function gethchmod($file){ … … 144 144 if($key = array_search($attarray[$i], $legal)) 145 145 $realmode .= $legal[$key]; 146 146 147 147 $mode = str_pad($realmode, 9, '-'); 148 148 $trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1'); 149 149 $mode = strtr($mode,$trans); 150 150 151 151 $newmode = ''; 152 152 $newmode .= $mode[0] + $mode[1] + $mode[2]; -
trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r8540 r8600 83 83 $this->permission = $perm; 84 84 } 85 85 86 86 function get_contents($file, $type = '', $resumepos = 0 ){ 87 87 if( empty($type) ){ -
trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r8018 r8600 126 126 $temp = wp_tempnam( $file ); 127 127 if ( ! $temphandle = fopen($temp, 'w+') ){ 128 unlink($temp); 128 unlink($temp); 129 129 return false; 130 130 } … … 147 147 return $this->ftp->chdir($file); 148 148 } 149 149 150 150 function chgrp($file, $group, $recursive = false ) { 151 151 return false; -
trunk/wp-admin/includes/dashboard.php
r8550 r8600 436 436 if( preg_match('|/([^/]+?)/?$|', $link, $matches) ) 437 437 $slug = $matches[1]; 438 else 438 else 439 439 $slug = ''; 440 440 -
trunk/wp-admin/includes/file.php
r8595 r8600 286 286 287 287 $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); 288 288 289 289 // Strip the query strings. 290 290 $filename = str_replace('?','-', $filename); 291 291 $filename = str_replace('&','-', $filename); 292 292 293 293 // Move the file to the uploads dir 294 294 $new_file = $uploads['path'] . "/$filename"; … … 472 472 if ( 'direct' == $type ) 473 473 return true; 474 474 475 475 if( ! $credentials = get_option('ftp_credentials') ) 476 476 $credentials = array(); -
trunk/wp-admin/includes/image.php
r7673 r8600 18 18 */ 19 19 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { 20 20 21 21 $thumbpath = image_resize( $file, $max_side, $max_side ); 22 22 return apply_filters( 'wp_create_thumbnail', $thumbpath ); … … 99 99 $sizes = array('thumbnail', 'medium'); 100 100 $sizes = apply_filters('intermediate_image_sizes', $sizes); 101 101 102 102 foreach ($sizes as $size) { 103 103 $resized = image_make_intermediate_size( $file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") ); … … 105 105 $metadata['sizes'][$size] = $resized; 106 106 } 107 107 108 108 // fetch additional metadata from exif/iptc 109 109 $image_meta = wp_read_image_metadata( $file ); … … 276 276 else 277 277 $result = true; 278 278 279 279 return apply_filters('file_is_displayable_image', $result, $path); 280 280 } -
trunk/wp-admin/includes/media.php
r8589 r8600 1289 1289 $alt_help = __('Also used as alternate text for the image'); 1290 1290 } 1291 1291 1292 1292 return ' 1293 1293 <table class="describe"><tbody> -
trunk/wp-admin/includes/misc.php
r8540 r8600 165 165 if( $message->get_error_data() ) 166 166 $message = $message->get_error_message() . ': ' . $message->get_error_data(); 167 else 167 else 168 168 $message = $message->get_error_message(); 169 169 } -
trunk/wp-admin/includes/plugin-install.php
r8550 r8600 9 9 $args = apply_filters('plugins_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter. 10 10 $res = apply_filters('plugins_api', false, $action, $args); //NOTE: Allows a plugin to completely override the builtin WordPress.org API. 11 11 12 12 if ( ! $res ) { 13 13 $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array(), array(), array('action' => $action, 'request' => serialize($args)) ); … … 68 68 } 69 69 ?> 70 70 71 71 <p><?php _e('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> via this page.') ?></p> 72 72 73 73 <h4><?php _e('Search') ?></h4> 74 74 <?php install_search_form() ?> … … 77 77 <?php _e('<strong>Tag:</strong> Searches for plugins tagged as such') ?><br /> 78 78 <?php _e('<strong>Author:</strong> Searches for plugins created by the Author, or which the Author contributed to.') ?></p> 79 79 80 80 <h4><?php _e('Popular tags') ?></h4> 81 81 <p><?php _e('You may also search based on these popular tags, These are tags which are most popular on WordPress.org') ?></p> … … 143 143 function display_plugins_table($plugins, $page = 1, $totalpages = 1){ 144 144 global $tab; 145 145 146 146 $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : ''; 147 147 $term = isset($_REQUEST['s']) ? $_REQUEST['s'] : ''; … … 167 167 'current' => $page 168 168 )); 169 169 170 170 if ( $page_links ) 171 echo "\t\t<div class='tablenav-pages'>$page_links</div>"; 171 echo "\t\t<div class='tablenav-pages'>$page_links</div>"; 172 172 ?> 173 173 </div> … … 187 187 if( empty($plugins) ) 188 188 echo '<tr><td colspan="5">', __('No plugins match your request.'), '</td></tr>'; 189 189 190 190 foreach( (array) $plugins as $plugin ){ 191 191 if ( is_object($plugin) ) … … 195 195 $description = wp_kses($plugin['description'], $plugins_allowedtags); 196 196 $version = wp_kses($plugin['version'], $plugins_allowedtags); 197 197 198 198 $name = strip_tags($title . ' ' . $version); 199 199 200 200 $author = $plugin['author']; 201 201 if( ! empty($plugin['author']) ) … … 203 203 204 204 $author = wp_kses($author, $plugins_allowedtags); 205 205 206 206 if( isset($plugin['homepage']) ) 207 207 $title = '<a target="_blank" href="' . $plugin['homepage'] . '">' . $title . '</a>'; 208 208 209 209 $action_links = array(); 210 210 $action_links[] = '<a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] . 211 211 '&TB_iframe=true&width=600&height=800') . '" class="thickbox onclick" title="' . 212 212 attribute_escape($name) . '">' . __('Install') . '</a>'; 213 213 214 214 $action_links = apply_filters('plugin_install_action_links', $action_links, $plugin); 215 215 ?> … … 279 279 function install_plugin_information() { 280 280 global $tab; 281 281 282 282 $api = plugins_api('plugin_information', array('slug' => $_REQUEST['plugin'])); 283 283 … … 285 285 if( empty($section) || ! isset($api->sections[ $section ]) ) 286 286 $section = array_shift( $section_titles = array_keys((array)$api->sections) ); 287 287 288 288 install_iframe_header(); 289 289 echo "<div id='$tab-header'>\n"; 290 290 echo "<ul id='sidemenu'>\n"; 291 291 foreach ( (array)$api->sections as $section_name => $content ) { 292 292 293 293 $title = $section_name; 294 294 $title[0] = strtoupper($title[0]); //Capitalize first character. … … 303 303 echo "</ul>\n"; 304 304 echo "</div>\n"; 305 305 306 306 ?> 307 307 <div class="alignright fyi"> … … 350 350 <li><strong><?php _e('Author:') ?></strong> <?php echo links_add_target($api->author, '_blank') ?></li> 351 351 <?php endif; if ( ! empty($api->last_updated) ) : ?> 352 <li><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $api->last_updated ?>"><?php 352 <li><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $api->last_updated ?>"><?php 353 353 printf( __('%s ago'), human_time_diff(strtotime($api->last_updated)) ) ?></span></li> 354 354 <?php endif; if ( ! empty($api->requires) ) : ?> … … 381 381 $title[0] = strtoupper($title[0]); 382 382 $title = str_replace('_', ' ', $title); 383 383 384 384 $content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/'); 385 385 $content = links_add_target($content, '_blank'); 386 386 387 387 $san_title = attribute_escape(sanitize_title_with_dashes($title)); 388 388 389 389 $display = ( $section_name == $section ) ? 'block' : 'none'; 390 390 391 391 echo "\t<div id='section-{$san_title}' style='display: {$display};'>\n"; 392 392 echo "\t\t<h2 class='long-header'>$title</h2>"; … … 407 407 408 408 install_iframe_header(); 409 409 410 410 $api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth. 411 411 412 412 echo '<div class="wrap">'; 413 413 echo '<h2>', sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version ), '</h2>'; … … 420 420 function do_plugin_install($download_url = '', $plugin_information = NULL) { 421 421 global $wp_filesystem; 422 422 423 423 if ( empty($download_url) ) { 424 424 show_message( __('No plugin Specified') ); 425 425 return; 426 426 } 427 427 428 428 $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : ''; 429 429 430 430 $url = 'plugin-install.php?tab=install'; 431 431 $url = add_query_arg(array('plugin' => $plugin, 'plugin_name' => $_REQUEST['plugin_name'], 'download_url' => $_REQUEST['download_url']), $url); … … 447 447 448 448 $result = wp_install_plugin( $download_url, 'show_message' ); 449 449 450 450 if ( is_wp_error($result) ) { 451 451 show_message($result); … … 490 490 if( empty($content_dir) ) 491 491 return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).')); 492 492 493 493 $plugins_dir = trailingslashit( $plugins_dir ); 494 494 $content_dir = trailingslashit( $content_dir ); … … 513 513 // Unzip package to working directory 514 514 $result = unzip_file($download_file, $working_dir); 515 515 516 516 // Once extracted, delete the package 517 517 unlink($download_file); 518 518 519 519 if ( is_wp_error($result) ) { 520 520 $wp_filesystem->delete($working_dir, true); 521 521 return $result; 522 522 } 523 523 524 524 //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin 525 525 $filelist = array_keys( $wp_filesystem->dirlist($working_dir) ); 526 526 527 527 if( $wp_filesystem->exists( $plugins_dir . $filelist[0] ) ) { 528 528 $wp_filesystem->delete($working_dir, true); 529 529 return new WP_Error('install_folder_exists', __('Folder allready exists.'), $filelist[0] ); 530 530 } 531 531 532 532 apply_filters('install_feedback', __('Installing the plugin')); 533 533 // Copy new version of plugin into place. … … 543 543 // Remove working directory 544 544 $wp_filesystem->delete($working_dir, true); 545 545 546 546 if( empty($filelist) ) 547 547 return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup. 548 548 549 549 $folder = $filelist[0]; 550 550 $plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash -
trunk/wp-admin/includes/plugin.php
r8587 r8600 91 91 92 92 return array( 93 'Name' => $name, 'PluginURI' => $uri, 'Description' => $description, 94 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, 93 'Name' => $name, 'PluginURI' => $uri, 'Description' => $description, 94 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, 95 95 'TextDomain' => $text_domain, 'DomainPath' => $domain_path 96 96 ); … … 98 98 99 99 function get_plugins($plugin_folder = '') { 100 100 101 101 if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') ) 102 102 $cache_plugins = array(); 103 103 104 104 if ( isset($cache_plugins[ $plugin_folder ]) ) 105 105 return $cache_plugins[ $plugin_folder ]; 106 106 107 107 $wp_plugins = array (); 108 108 $plugin_root = WP_PLUGIN_DIR; … … 152 152 uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' )); 153 153 154 $cache_plugins[ $plugin_folder ] = $wp_plugins; 155 wp_cache_set('plugins', $cache_plugins, 'plugins'); 154 $cache_plugins[ $plugin_folder ] = $wp_plugins; 155 wp_cache_set('plugins', $cache_plugins, 'plugins'); 156 156 157 157 return $wp_plugins; … … 280 280 if ( empty($plugins_dir) ) 281 281 return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.')); 282 282 283 283 $plugins_dir = trailingslashit( $plugins_dir ); 284 284 … … 296 296 else 297 297 $deleted = $wp_filesystem->delete($plugins_dir . $plugin_file); 298 298 299 299 if ( ! $deleted ) 300 300 $errors[] = $plugin_file; 301 301 } 302 302 303 303 if( ! empty($errors) ) 304 304 return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) ); 305 305 306 306 return true; 307 307 } … … 318 318 319 319 //Invalid is any plugin that is deactivated due to error. 320 $invalid = array(); 320 $invalid = array(); 321 321 322 322 // If a plugin file does not exist, remove it from the list of active -
trunk/wp-admin/includes/post.php
r8589 r8600 60 60 $previous_status = get_post_field('post_status', $_POST['ID']); 61 61 62 // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. 62 // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. 63 63 // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. 64 64 if ( 'page' == $_POST['post_type'] ) { … … 357 357 wp_cache_delete($post_ID, 'post_meta'); 358 358 359 $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta 359 $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta 360 360 (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)", 361 361 $post_ID, $metakey, $metavalue) ); … … 421 421 $meta_value = maybe_serialize( stripslashes( $meta_value )); 422 422 $meta_id = (int) $meta_id; 423 423 424 424 $data = compact( 'meta_key', 'meta_value' ); 425 425 $where = compact( 'meta_id' ); … … 586 586 $post->post_status = 'publish'; 587 587 $post->post_date = date('Y-m-d H:i:s'); 588 $post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID); 588 $post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID); 589 589 } 590 590 -
trunk/wp-admin/includes/schema.php
r8553 r8600 155 155 function populate_options() { 156 156 global $wpdb, $wp_db_version; 157 157 158 158 $guessurl = wp_guess_url(); 159 159 160 160 do_action('populate_options'); 161 161 162 162 add_option('siteurl', $guessurl); 163 163 add_option('blogname', __('My Blog')); … … 258 258 add_option('enable_app', 0); 259 259 add_option('enable_xmlrpc', 0); 260 260 261 261 // Delete unused options 262 262 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins'); -
trunk/wp-admin/includes/template.php
r8589 r8600 58 58 echo "\t" . _cat_row( $category, $level ); 59 59 60 unset($categories[$i]); // Prune the working set 60 unset($categories[$i]); // Prune the working set 61 61 $count++; 62 62 … … 192 192 193 193 $args = array(); 194 194 195 195 if ( is_array( $selected_cats ) ) 196 196 $args['selected_cats'] = $selected_cats; … … 548 548 } 549 549 550 /* 550 /* 551 551 * arrange pages into two parts: top level pages and children_pages 552 * children_pages is two dimensional array, eg. 553 * children_pages[10][] contains all sub-pages whose parent is 10. 552 * children_pages is two dimensional array, eg. 553 * children_pages[10][] contains all sub-pages whose parent is 10. 554 554 * It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations 555 555 * If searching, ignore hierarchy and treat everything as top level 556 556 */ 557 557 if ( empty($_GET['s']) ) { 558 558 559 559 $top_level_pages = array(); 560 560 $children_pages = array(); 561 561 562 562 foreach ( $pages as $page ) { 563 563 564 564 // catch and repair bad pages 565 565 if ( $page->post_parent == $page->ID ) { … … 568 568 clean_page_cache( $page->ID ); 569 569 } 570 570 571 571 if ( 0 == $page->post_parent ) 572 572 $top_level_pages[] = $page; … … 581 581 $start = ($pagenum - 1) * $per_page; 582 582 $end = $start + $per_page; 583 583 584 584 foreach ( $pages as $page ) { 585 585 if ( $count >= $end ) … … 594 594 _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page ); 595 595 } 596 596 597 597 // if it is the last pagenum and there are orphaned pages, display them with paging as well 598 598 if ( isset($children_pages) && $count < $end ){ … … 614 614 */ 615 615 function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) { 616 616 617 617 if ( ! isset( $children_pages[$parent] ) ) 618 return; 619 618 return; 619 620 620 $start = ($pagenum - 1) * $per_page; 621 621 $end = $start + $per_page; 622 622 623 623 foreach ( $children_pages[$parent] as $page ) { 624 624 625 625 if ( $count >= $end ) 626 626 break; 627 627 628 628 // If the page starts in a subtree, print the parents. 629 629 if ( $count == $start && $page->post_parent > 0 ) { … … 646 646 if ( $count >= $start ) 647 647 echo "\t" . display_page_row( $page, $level ); 648 648 649 649 $count++; 650 650 651 651 _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page ); 652 652 } 653 653 654 654 unset( $children_pages[$parent] ); //required in order to keep track of orphans 655 655 } … … 659 659 660 660 $current_user = wp_get_current_user(); 661 661 662 662 if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) ) 663 663 $user_object = new WP_User( (int) $user_object ); … … 748 748 749 749 $post_link .= get_the_title($comment->comment_post_ID) . '</a>'; 750 750 751 751 $edit_link_start = "<a class='row-title' href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>"; 752 752 $edit_link_end = '</a>'; … … 755 755 $edit_link_start = $edit_link_end =''; 756 756 } 757 757 758 758 $author_url = get_comment_author_url(); 759 759 if ( 'http://' == $author_url ) … … 789 789 <?php endif; ?> 790 790 <a href="edit-comments.php?s=<?php comment_author_IP() ?>&mode=detail"><?php comment_author_IP() ?></a> 791 <?php endif; //current_user_can?> 791 <?php endif; //current_user_can?> 792 792 </p> 793 793 <?php if ( 'detail' == $mode ) comment_text(); ?> … … 1172 1172 global $wp_meta_boxes; 1173 1173 1174 1174 1175 1175 if ( !isset($wp_meta_boxes) ) 1176 1176 $wp_meta_boxes = array(); -
trunk/wp-admin/includes/update-core.php
r8599 r8600 128 128 return new WP_Error('insane_distro', __('The update could not be unpacked') ); 129 129 } 130 130 131 131 apply_filters('update_feedback', __('Installing the latest version')); 132 132 -
trunk/wp-admin/includes/update.php
r8597 r8600 75 75 else 76 76 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $details_url, $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $file, 'upgrade-plugin_' . $file) ); 77 77 78 78 echo '</td></tr>'; 79 79 } … … 110 110 if( empty($content_dir) ) 111 111 return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).')); 112 112 113 113 $plugins_dir = trailingslashit( $plugins_dir ); 114 114 $content_dir = trailingslashit( $content_dir ); … … 137 137 // Unzip package to working directory 138 138 $result = unzip_file($download_file, $working_dir); 139 139 140 140 // Once extracted, delete the package 141 141 unlink($download_file); 142 142 143 143 if ( is_wp_error($result) ) { 144 144 $wp_filesystem->delete($working_dir, true); … … 155 155 apply_filters('update_feedback', __('Removing the old version of the plugin')); 156 156 $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) ); 157 157 158 158 // If plugin is in its own directory, recursively delete the directory. 159 159 if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder … … 183 183 // Force refresh of plugin update information 184 184 delete_option('update_plugins'); 185 185 186 186 if( empty($filelist) ) 187 187 return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup. 188 188 189 189 $folder = $filelist[0]; 190 190 $plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash … … 224 224 if( empty($content_dir) ) 225 225 return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).')); 226 226 227 227 $wp_dir = trailingslashit( $wp_dir ); 228 228 $content_dir = trailingslashit( $content_dir ); -
trunk/wp-admin/includes/upgrade.php
r8540 r8600 572 572 } 573 573 574 $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES 574 $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES 575 575 (%d, %s, %s, %d)", $term_id, $name, $slug, $term_group) ); 576 576 … … 733 733 populate_roles_250(); 734 734 } 735 735 736 736 } 737 737 -
trunk/wp-admin/includes/widgets.php
r8258 r8600 85 85 'key' => array_search( $widget['id'], $sidebars_widgets[$sidebar] ), 86 86 ) ) ); 87 87 88 88 $widget_control_template = '<textarea rows="1" cols="1">' . htmlspecialchars( $widget_control_template ) . '</textarea>'; 89 89 } -
trunk/wp-admin/js/common.js
r7384 r8600 20 20 this.each(function() { 21 21 var el = JQ(this), txt; 22 22 23 23 if ( txt = el.attr('title') ) el.attr('tip', txt).removeAttr('title'); 24 24 else return; -
trunk/wp-admin/js/editor.js
r8313 r8600 16 16 17 17 document.getElementById(el).style.color = '#fff'; 18 if ( tinyMCE.activeEditor.isHidden() ) 18 if ( tinyMCE.activeEditor.isHidden() ) 19 19 content = document.getElementById(el).value; 20 20 else … … 170 170 // pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 '); 171 171 172 // Fix the pre|script tags 172 // Fix the pre|script tags 173 173 pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) { 174 174 a = a.replace(/<br ?\/?>[\r\n]*/g, '\n'); -
trunk/wp-admin/js/media-upload.js
r8313 r8600 8 8 if ( h.indexOf('[caption') != -1 ) 9 9 h = ed.plugins.wpeditimage._do_shcode(h); 10 10 11 11 ed.execCommand('mceInsertContent', false, h); 12 12 } else … … 41 41 }); 42 42 }; 43 43 44 44 jQuery('a.thickbox').click(function(){ 45 45 if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) { -
trunk/wp-admin/js/revisions-js.php
r8306 r8600 9 9 'qwertyuiop[]\\asdfghjkl;\'zxcvbnm,./QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?-=' 10 10 ); 11 } 11 } 12 12 13 13 $j = clean_url( site_url( '/wp-includes/js/jquery/jquery.js' ) ); -
trunk/wp-admin/js/word-count.js
r8035 r8600 9 9 t.block = 0; 10 10 t.wc(co.val()); 11 co.keyup( function(e) { 11 co.keyup( function(e) { 12 12 if ( e.keyCode == last ) return true; 13 13 if ( 13 == e.keyCode || 8 == last || 46 == last ) t.wc(co.val()); … … 34 34 }, 1 ); 35 35 } 36 } 36 } 37 37 }(jQuery)); 38 38 -
trunk/wp-admin/js/wp-gears.js
r8395 r8600 5 5 if ( 'undefined' == typeof google || ! google.gears ) return; 6 6 7 if ( 'undefined' == typeof localServer ) 7 if ( 'undefined' == typeof localServer ) 8 8 localServer = google.gears.factory.create("beta.localserver"); 9 9 -
trunk/wp-admin/plugins.php
r8550 r8600 75 75 if( ! current_user_can('delete_plugins') ) 76 76 wp_die(__('You do not have sufficient permissions to delete plugins for this blog.')); 77 77 78 78 check_admin_referer('bulk-manage-plugins'); 79 79 80 80 $plugins = $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen. 81 81 include(ABSPATH . 'wp-admin/update.php'); … … 83 83 $title = __('Delete Plugin'); 84 84 $parent_file = 'plugins.php'; 85 85 86 86 if( ! isset($_REQUEST['verify-delete']) ) { 87 87 wp_enqueue_script('jquery'); … … 89 89 ?> 90 90 <div class="wrap"> 91 <h2><?php _e('Delete Plugin(s)'); ?></h2> 91 <h2><?php _e('Delete Plugin(s)'); ?></h2> 92 92 <?php 93 93 $files_to_delete = $plugin_info = array(); … … 112 112 <p> 113 113 <ul> 114 <?php 114 <?php 115 115 foreach( $plugin_info as $plugin ) 116 116 echo '<li>', sprintf(__('%s by %s'), $plugin['Name'], $plugin['Author']), '</li>'; … … 141 141 ?> 142 142 </ul> 143 </div> 143 </div> 144 144 </div> 145 145 <?php … … 232 232 if ( !empty($plugin_data['PluginURI']) && !empty($plugin_data['Name']) ) 233 233 $plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '" title="'.__( 'Visit plugin homepage' ).'">' . $plugin_data['Name'] . '</a>'; 234 234 235 235 if ( ! empty($plugin_data['AuthorURI']) ) 236 236 $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="'.__( 'Visit author homepage' ).'">' . $plugin_data['Author'] . '</a>'; 237 237 238 238 $plugin_data['Description'] = wptexturize( $plugin_data['Description'] ); 239 239 … … 299 299 <td class='vers'>{$plugin_data['Version']}</td> 300 300 <td class='desc'><p>{$plugin_data['Description']}</p></td> 301 <td class='togl action-links'>"; 301 <td class='togl action-links'>"; 302 302 if ( !empty($action_links) ) 303 303 echo implode(' | ', $action_links); 304 echo '</td> 304 echo '</td> 305 305 </tr>'; 306 306 do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context ); … … 309 309 </tbody> 310 310 </table> 311 <?php 311 <?php 312 312 } //End print_plugins_table() 313 313 ?> -
trunk/wp-admin/post.php
r8484 r8600 43 43 $location = get_permalink( $post_ID ); 44 44 elseif ( false !== strpos($location, 'edit.php') ) 45 $location = add_query_arg('posted', $post_ID, $location); 45 $location = add_query_arg('posted', $post_ID, $location); 46 46 elseif ( false !== strpos($location, 'wp-admin') ) 47 47 $location = "post-new.php?posted=$post_ID"; -
trunk/wp-admin/press-this.php
r8551 r8600 35 35 36 36 foreach( (array) $_REQUEST['photo_src'] as $key => $image) { 37 37 38 38 // see if files exist in content - we don't want to upload non-used selected files. 39 39 if( strpos($_REQUEST['content'], $image) !== false ) { 40 40 $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); 41 41 42 42 // Replace the POSTED content <img> with correct uploaded ones. 43 43 // escape quote for matching … … 50 50 51 51 case "video": 52 if($_REQUEST['embed_code']) 52 if($_REQUEST['embed_code']) 53 53 $content .= $_REQUEST['embed_code']."\n\n"; 54 54 $content .= $_REQUEST['content']; … … 74 74 75 75 // For submitted posts. 76 if ( 'post' == $_REQUEST['action'] ) { 76 if ( 'post' == $_REQUEST['action'] ) { 77 77 check_admin_referer('press-this'); $post_ID = press_it(); ?> 78 78 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 139 139 140 140 <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p> 141 <?php die; 141 <?php die; 142 142 } 143 143 … … 164 164 165 165 <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> 166 <?php die; 166 <?php die; 167 167 } 168 168 … … 177 177 if($_REQUEST['ajax'] == 'photo_images') { 178 178 function get_images_from_uri($uri) { 179 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com') ) 179 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com') ) 180 180 return "'".$uri."'"; 181 181 … … 187 187 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is'; 188 188 preg_match_all($pattern, $content, $matches); 189 189 190 190 if ( empty($matches[1]) ) return ''; 191 191 … … 199 199 else 200 200 $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); 201 201 202 202 $sources[] = clean_url($src); 203 203 } 204 204 return "'" . implode("','", $sources) . "'"; 205 } 205 } 206 206 207 207 $url = urldecode($url); 208 208 $url = str_replace(' ', '%20', $url); 209 echo 'new Array('.get_images_from_uri($url).')'; 209 echo 'new Array('.get_images_from_uri($url).')'; 210 210 die; 211 211 } … … 227 227 228 228 for (i = 0; i < my_src.length; i++) { 229 img = new Image(); 230 img.src = my_src[i]; 231 img_attr = 'id="img' + i + '"'; 229 img = new Image(); 230 img.src = my_src[i]; 231 img_attr = 'id="img' + i + '"'; 232 232 skip = false; 233 233 if (img.width && img.height) { 234 if (img.width * img.height < 2500) 234 if (img.width * img.height < 2500) 235 235 skip = true; 236 236 aspect = img.width / img.height; … … 304 304 ?> 305 305 <script type="text/javascript"> 306 <?php if ( user_can_richedit() ) { 306 <?php if ( user_can_richedit() ) { 307 307 $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); 308 308 // Add TinyMCE languages … … 360 360 }); 361 361 jQuery('#newtag').blur(function() { 362 if ( this.value == '' ) 362 if ( this.value == '' ) 363 363 jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' ); 364 364 }); … … 412 412 jQuery('body').addClass('video_split'); 413 413 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo attribute_escape($selection); ?>'}, function() { 414 <?php 414 <?php 415 415 $content = ''; 416 416 if ( preg_match("/youtube\.com\/watch/i", $url) ) { … … 461 461 462 462 jQuery(document).ready(function() { 463 jQuery('#menu li').click(function (){ 463 jQuery('#menu li').click(function (){ 464 464 tab_name = this.id.split('_'); 465 465 tab_name = tab_name[0]; … … 519 519 </ul> 520 520 </div> 521 521 522 522 <h2><?php _e('Tags') ?></h2> 523 523 <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p> … … 525 525 </div> 526 526 527 <p class="submit"> 527 <p class="submit"> 528 528 <input type="submit" name="draft" value="<?php _e('Save') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> 529 529 <input type="submit" name="publish" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> -
trunk/wp-admin/revision.php
r8480 r8600 85 85 ) 86 86 break; 87 87 88 88 $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>'; 89 89 $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); … … 155 155 <?php endif; 156 156 157 // use get_post_to_edit filters? 157 // use get_post_to_edit filters? 158 158 $identical = true; 159 159 foreach ( _wp_post_revision_fields() as $field => $field_title ) : -
trunk/wp-admin/rtl.css
r8592 r8600 14 14 15 15 #update-nag { 16 clear: both; 17 margin-bottom: 1em; 16 clear: both; 17 margin-bottom: 1em; 18 18 } 19 19 20 20 /* Clears update nag, so it doesn't hide the submenu */ 21 #update-nag { 22 clear: both; 23 margin-bottom: 1em; 21 #update-nag { 22 clear: both; 23 margin-bottom: 1em; 24 24 } 25 25 … … 131 131 } 132 132 133 .tablenav .delete 133 .tablenav .delete 134 134 { 135 135 margin-left: 40px; … … 338 338 /* WPH - TinyMCE */ 339 339 340 #media-items th.label { 341 width: 120px; 342 } 343 #media-items th.label .alignleft { 344 width: 100px; 345 } 346 347 #media-items th.label .alignright { 348 width: 16px; 349 height: 16px; 350 } 340 #media-items th.label { 341 width: 120px; 342 } 343 #media-items th.label .alignleft { 344 width: 100px; 345 } 346 347 #media-items th.label .alignright { 348 width: 16px; 349 height: 16px; 350 } 351 351 352 352 /* LTRs some url- and code-only form fields */ 353 input#href, input#src, input#class_name { 354 direction: ltr; 355 text-align: left; 356 } 357 358 #sidemenu a { 359 float: right; 353 input#href, input#src, input#class_name { 354 direction: ltr; 355 text-align: left; 356 } 357 358 #sidemenu a { 359 float: right; 360 360 } 361 361 … … 376 376 377 377 #gallery-form table.widefat th { 378 float: left; 378 float: left; 379 379 width: 74%; 380 380 text-align: center; … … 399 399 } 400 400 401 #library-form { 402 float: right; 401 #library-form { 402 float: right; 403 403 } 404 404 -
trunk/wp-admin/update.php
r8597 r8600 36 36 } else { 37 37 //Result is the new plugin file relative to WP_PLUGIN_DIR 38 show_message( __('Plugin upgraded successfully') ); 38 show_message( __('Plugin upgraded successfully') ); 39 39 if( $result && $was_activated ){ 40 40 show_message(__('Attempting reactivation of the plugin')); … … 107 107 show_message( __('Installation Failed') ); 108 108 } else { 109 show_message( __('WordPress upgraded successfully') ); 109 show_message( __('WordPress upgraded successfully') ); 110 110 } 111 111 echo '</div>'; … … 125 125 check_admin_referer('activate-plugin_' . $plugin); 126 126 if( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { 127 wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); 127 wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); 128 128 activate_plugin($plugin); 129 wp_redirect( 'update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); 129 wp_redirect( 'update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); 130 130 die(); 131 131 } -
trunk/wp-admin/upload.php
r8484 r8600 210 210 211 211 <?php 212 212 213 213 if ( 1 == count($posts) && is_singular() ) : 214 214 215 215 $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); 216 216 if ( $comments ) : -
trunk/wp-admin/user-edit.php
r8462 r8600 42 42 43 43 } 44 44 45 45 function update_nickname ( ) { 46 46 47 47 var nickname = jQuery('#nickname').val(); 48 48 var display_nickname = jQuery('#display_nickname').val(); 49 49 50 50 if ( nickname == '' ) { 51 51 jQuery('#display_nickname').remove(); 52 52 } 53 53 jQuery('#display_nickname').val(nickname).html(nickname); 54 55 } 56 57 jQuery(function($) { 58 $('#pass1').keyup( check_pass_strength ) 54 55 } 56 57 jQuery(function($) { 58 $('#pass1').keyup( check_pass_strength ) 59 59 $('.color-palette').click(function(){$(this).siblings('input[name=admin_color]').attr('checked', 'checked')}); 60 60 } ); 61 61 62 62 jQuery(document).ready( function() { 63 63 jQuery('#pass1,#pass2').attr('autocomplete','off'); … … 191 191 </tr> 192 192 </table> 193 193 194 194 <label for="admin_color_<?php echo $color; ?>"><?php echo $color_info->name ?></label> 195 195 </div> -
trunk/wp-admin/widgets.php
r7979 r8600 133 133 <br /> 134 134 <form action="<?php echo clean_url( remove_query_arg( $query_args ) ); ?>" method="post"> 135 135 136 136 <ul class="widget-control-list"> 137 137 <li class="widget-list-control-item"> -
trunk/wp-admin/wp-admin.css
r8305 r8600 226 226 border-radius: 3px; 227 227 cursor: pointer; 228 text-decoration: none; 228 text-decoration: none; 229 229 } 230 230 … … 913 913 } 914 914 915 #profile-page .form-table input[type=text] { 915 #profile-page .form-table input[type=text] { 916 916 width: 300px; 917 917 } … … 1517 1517 #poststuff h3, #poststuff .closed h3 { 1518 1518 cursor: pointer; 1519 } 1519 } 1520 1520 1521 1521 .hide-if-no-js { -
trunk/wp-app.php
r8390 r8600 176 176 $path = $_SERVER['ORIG_PATH_INFO']; 177 177 else 178 $path = $_SERVER['PATH_INFO']; 178 $path = $_SERVER['PATH_INFO']; 179 179 180 180 $method = $_SERVER['REQUEST_METHOD']; -
trunk/wp-includes/cache.php
r7990 r8600 252 252 * by default. 253 253 * 254 * On success the group and the id will be added to the 254 * On success the group and the id will be added to the 255 255 * $non_existant_objects property in the class. 256 256 * -
trunk/wp-includes/class-phpass.php
r8082 r8600 51 51 52 52 $this->random_state = microtime() . (function_exists('getmypid') ? getmypid() : '') . uniqid(rand(), TRUE); 53 53 54 54 } 55 55 -
trunk/wp-includes/class.wp-dependencies.php
r7970 r8600 80 80 else 81 81 continue; // We're at the top level. Move on to the next one. 82 } 82 } 83 83 84 84 $this->to_do[$handle] = true; -
trunk/wp-includes/classes.php
r8572 r8600 430 430 call_user_func_array(array(&$this, 'start_el'), $cb_args); 431 431 432 $id = $element->$id_field; 433 432 $id = $element->$id_field; 433 434 434 // descend only the depth is right and there are chilrens for this element 435 if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) { 435 if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) { 436 436 437 437 foreach( $children_elements[ $id ] as $child ){ 438 438 439 439 if ( !isset($newlevel) ) { 440 440 $newlevel = true; … … 445 445 $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); 446 446 } 447 unset( $children_elements[ $id ] ); 447 unset( $children_elements[ $id ] ); 448 448 } 449 449 … … 491 491 * need to display in hierarchical order 492 492 * seperate elements into two buckets: top level and children elements 493 * children_elements is two dimensional array, eg. 494 * children_elements[10][] contains all sub-elements whose parent is 10. 493 * children_elements is two dimensional array, eg. 494 * children_elements[10][] contains all sub-elements whose parent is 10. 495 495 */ 496 496 $top_level_elements = array(); … … 510 510 511 511 $root = $elements[0]; 512 512 513 513 $top_level_elements = array(); 514 514 $children_elements = array(); … … 534 534 $this->display_element( $op, $empty_array, 1, 0, $args, $output ); 535 535 } 536 536 537 537 return $output; 538 538 } -
trunk/wp-includes/comment-template.php
r8543 r8600 666 666 667 667 define('COMMENTS_TEMPLATE', true); 668 668 669 669 $include = apply_filters('comments_template', STYLESHEETPATH . $file ); 670 670 if ( file_exists( $include ) ) -
trunk/wp-includes/feed.php
r8572 r8600 307 307 * @subpackage Feed 308 308 * @since 2.1.0 309 * @uses apply_filters() 309 * @uses apply_filters() 310 310 * 311 311 * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. -
trunk/wp-includes/formatting.php
r8589 r8600 845 845 if ( '' == $text ) { 846 846 $text = get_the_content(''); 847 848 $text = strip_shortcodes( $text ); 849 847 848 $text = strip_shortcodes( $text ); 849 850 850 $text = apply_filters('the_content', $text); 851 851 $text = str_replace(']]>', ']]>', $text); … … 1437 1437 function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) { 1438 1438 $attrs = implode('|', (array)$attrs); 1439 return preg_replace_callback("!($attrs)=(['\"])(.+?)\\2!i", 1439 return preg_replace_callback("!($attrs)=(['\"])(.+?)\\2!i", 1440 1440 create_function('$m', 'return _links_add_base($m, "' . $base . '");'), 1441 1441 $content); … … 1456 1456 function _links_add_base($m, $base) { 1457 1457 //1 = attribute name 2 = quotation mark 3 = URL 1458 return $m[1] . '=' . $m[2] . 1458 return $m[1] . '=' . $m[2] . 1459 1459 (strpos($m[3], 'http://') === false ? 1460 1460 path_join($base, $m[3]) : … … 1466 1466 * Adds a Target attribute to all links in passed content. 1467 1467 * 1468 * This function by default only applies to <a> tags, 1468 * This function by default only applies to <a> tags, 1469 1469 * however this can be modified by the 3rd param. 1470 1470 * NOTE: Any current target attributed will be striped and replaced. … … 1480 1480 function links_add_target( $content, $target = '_blank', $tags = array('a') ) { 1481 1481 $tags = implode('|', (array)$tags); 1482 return preg_replace_callback("!<($tags)(.+?)>!i", 1482 return preg_replace_callback("!<($tags)(.+?)>!i", 1483 1483 create_function('$m', 'return _links_add_target($m, "' . $target . '");'), 1484 1484 $content); -
trunk/wp-includes/functions.php
r8598 r8600 1475 1475 if ( $echo ) 1476 1476 echo $nonce_field; 1477 1477 1478 1478 if ( $referer ) 1479 1479 wp_referer_field( $echo, 'previous' ); 1480 1480 1481 1481 return $nonce_field; 1482 1482 } … … 1600 1600 if ( empty($upload_path) ) 1601 1601 $dir = WP_CONTENT_DIR . '/uploads'; 1602 else 1602 else 1603 1603 $dir = $upload_path; 1604 1604 1605 1605 // $dir is absolute, $path is (maybe) relative to ABSPATH 1606 1606 $dir = path_join( ABSPATH, $dir ); 1607 1607 1608 1608 if ( !$url = get_option( 'upload_url_path' ) ) { 1609 1609 if ( empty($upload_path) or ( $upload_path == $dir ) ) … … 1618 1618 } 1619 1619 1620 $bdir = $dir; 1620 $bdir = $dir; 1621 1621 $burl = $url; 1622 1622 … … 1639 1639 return array( 'error' => $message ); 1640 1640 } 1641 1641 1642 1642 $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false ); 1643 1643 … … 1886 1886 $trans['activate']['plugin'] = array( __( 'Your attempt to activate this plugin: "%s" has failed.' ), 'use_id' ); 1887 1887 $trans['deactivate']['plugin'] = array( __( 'Your attempt to deactivate this plugin: "%s" has failed.' ), 'use_id' ); 1888 $trans['upgrade']['plugin'] = array( __( 'Your attempt to upgrade this plugin: "%s" has failed.' ), 'use_id' ); 1888 $trans['upgrade']['plugin'] = array( __( 'Your attempt to upgrade this plugin: "%s" has failed.' ), 'use_id' ); 1889 1889 1890 1890 $trans['add']['post'] = array( __( 'Your attempt to add this post has failed.' ), false ); … … 2525 2525 */ 2526 2526 function is_ssl() { 2527 return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; 2527 return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; 2528 2528 } 2529 2529 -
trunk/wp-includes/general-template.php
r8572 r8600 374 374 375 375 $link_html = apply_filters( "get_archives_link", $link_html ); 376 376 377 377 return $link_html; 378 378 } … … 1198 1198 1199 1199 /** 1200 * Enqueues the default ThickBox js and css. 1200 * Enqueues the default ThickBox js and css. 1201 1201 * If any of the settings need to be changed, this can be done with another js file 1202 1202 * similar to media-upload.js and theme-preview.js. That file should require array('thickbox') 1203 * to ensure it is loaded after. 1203 * to ensure it is loaded after. 1204 1204 */ 1205 1205 function add_thickbox() { -
trunk/wp-includes/http.php
r8588 r8600 226 226 /** 227 227 * Uses the POST HTTP method. 228 * 228 * 229 229 * Used for sending data that is expected to be in the body. 230 230 * … … 245 245 246 246 /** 247 * Uses the GET HTTP method. 247 * Uses the GET HTTP method. 248 248 * 249 249 * Used for sending data that is expected to be in the body. … … 265 265 266 266 /** 267 * Uses the HEAD HTTP method. 267 * Uses the HEAD HTTP method. 268 268 * 269 269 * Used for sending data that is expected to be in the body. … … 345 345 * 346 346 * @param string|array $headers 347 * @return array Processed string headers 347 * @return array Processed string headers 348 348 */ 349 349 function processHeaders($headers) { … … 358 358 continue; 359 359 360 360 361 361 if ( false === strpos($tempheader, ':') ) { 362 362 list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3); … … 661 661 $url = str_replace($arrURL['scheme'], 'http', $url); 662 662 663 $arrContext = array('http' => 663 $arrContext = array('http' => 664 664 array( 665 665 'method' => strtoupper($r['method']), … … 896 896 if ( !ini_get('safe_mode') && !ini_get('open_basedir') ) 897 897 curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true ); 898 898 899 899 if( ! is_null($headers) ) 900 900 curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers ); -
trunk/wp-includes/js/autosave.js
r8170 r8600 11 11 //Disable autosave after the form has been submitted 12 12 $("#post").submit(function() { $.cancel(autosavePeriodical); }); 13 14 // Autosave when the preview button is clicked. 13 14 // Autosave when the preview button is clicked. 15 15 $('#previewview a').click(function(e) { 16 16 autosave(); … … 110 110 jQuery('#previewview').html('<a target="_blank" href="'+permalink+'" tabindex="4">'+previewText+'</a>'); 111 111 112 // Autosave when the preview button is clicked. 112 // Autosave when the preview button is clicked. 113 113 jQuery('#previewview a').click(function(e) { 114 114 autosave(); … … 131 131 action: 'sample-permalink', 132 132 post_id: post_id, 133 new_title: jQuery('#title').val(), 133 new_title: jQuery('#title').val(), 134 134 samplepermalinknonce: jQuery('#samplepermalinknonce').val() 135 135 }, … … 181 181 182 182 /* Gotta do this up here so we can check the length when tinyMCE is in use */ 183 if ( rich ) { 183 if ( rich ) { 184 184 var ed = tinyMCE.activeEditor; 185 185 if ( 'mce_fullscreen' == ed.id ) … … 187 187 tinyMCE.get('content').save(); 188 188 } 189 189 190 190 post_data["content"] = jQuery("#content").val(); 191 191 if ( jQuery('#post_name').val() ) -
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r8517 r8600 1 <?php 1 <?php 2 2 // some code below is from: 3 3 /** … … 69 69 $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' ); 70 70 71 /* 71 /* 72 72 The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'. 73 It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin. 74 The url should be absolute and should include the js file name to be loaded. Example: 73 It adds the plugin's name to TinyMCE's plugins init and the call to PluginManager to load the plugin. 74 The url should be absolute and should include the js file name to be loaded. Example: 75 75 array( 'myplugin' => 'http://my-site.com/wp-content/plugins/myfolder/mce_plugin.js' ) 76 76 If the plugin uses a button, it should be added with one of the "$mce_buttons" filters. … … 80 80 $ext_plugins = "\n"; 81 81 if ( ! empty($mce_external_plugins) ) { 82 82 83 83 /* 84 84 The following filter loads external language files for TinyMCE plugins. 85 It takes an associative array 'plugin_name' => 'path', where path is the 86 include path to the file. The language file should follow the same format as 87 /tinymce/langs/wp-langs.php and should define a variable $strings that 88 holds all translated strings. Example: 85 It takes an associative array 'plugin_name' => 'path', where path is the 86 include path to the file. The language file should follow the same format as 87 /tinymce/langs/wp-langs.php and should define a variable $strings that 88 holds all translated strings. Example: 89 89 $strings = 'tinyMCE.addI18n("' . $mce_locale . '.mypluginname_dlg",{tab_general:"General", ... })'; 90 90 */ 91 $mce_external_languages = apply_filters('mce_external_languages', array()); 92 91 $mce_external_languages = apply_filters('mce_external_languages', array()); 92 93 93 $loaded_langs = array(); 94 94 $strings = ''; 95 95 96 96 if ( ! empty($mce_external_languages) ) { 97 97 foreach ( $mce_external_languages as $name => $path ) { 98 if ( is_file($path) && is_readable($path) ) { 98 if ( is_file($path) && is_readable($path) ) { 99 99 include_once($path); 100 100 $ext_plugins .= $strings; … … 105 105 106 106 foreach ( $mce_external_plugins as $name => $url ) { 107 107 108 108 if ( is_ssl() ) $url = str_replace('http://', 'https://', $url); 109 109 110 110 $plugins[] = '-' . $name; 111 111 … … 127 127 $mce_buttons_3 = apply_filters('mce_buttons_3', array()); 128 128 $mce_buttons_3 = implode($mce_buttons_3, ','); 129 129 130 130 $mce_buttons_4 = apply_filters('mce_buttons_4', array()); 131 131 $mce_buttons_4 = implode($mce_buttons_4, ','); … … 196 196 197 197 // Cache path, this is where the .gz files will be stored 198 $cache_path = WP_CONTENT_DIR . '/uploads/js_cache'; 198 $cache_path = WP_CONTENT_DIR . '/uploads/js_cache'; 199 199 if ( $disk_cache && ! is_dir($cache_path) ) 200 200 $disk_cache = wp_mkdir_p($cache_path); … … 204 204 $theme = ( 'simple' == $initArray['theme'] ) ? 'simple' : 'advanced'; 205 205 $language = ( isset($initArray['language']) && ! empty($initArray['language']) ) ? substr( $initArray['language'], 0, 2 ) : 'en'; 206 $cacheKey = $mce_options = ''; 206 $cacheKey = $mce_options = ''; 207 207 208 208 // Check if browser supports gzip … … 225 225 $cacheKey .= $n; 226 226 } 227 227 228 228 $cacheKey = md5( $cacheKey ); 229 229 $cache_file = $cache_path . '/tinymce_' . $cacheKey . $cache_ext; … … 239 239 240 240 $mtime = gmdate("D, d M Y H:i:s", filemtime($cache_file)) . " GMT"; 241 241 242 242 if ( isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $mtime ) { 243 243 header('HTTP/1.1 304 Not Modified'); … … 248 248 249 249 $content = getFileContents( $cache_file ); 250 250 251 251 if ( '.gz' == $cache_ext ) 252 252 header( 'Content-Encoding: gzip' ); … … 256 256 } 257 257 258 foreach ( $initArray as $k => $v ) 258 foreach ( $initArray as $k => $v ) 259 259 $mce_options .= $k . ':"' . $v . '",'; 260 260 … … 278 278 279 279 // Add plugins 280 foreach ( $plugins as $plugin ) 280 foreach ( $plugins as $plugin ) 281 281 $content .= getFileContents( 'plugins/' . $plugin . '/editor_plugin.js' ); 282 282 283 // Add external plugins 283 // Add external plugins 284 284 $content .= $ext_plugins; 285 285 -
trunk/wp-includes/js/tinymce/wp-mce-help.php
r8512 r8600 8 8 <title><?php _e('Rich Editor Help') ?></title> 9 9 <script type="text/javascript" src="tiny_mce_popup.js?ver=311b"></script> 10 <?php 10 <?php 11 11 wp_admin_css( 'global', true ); 12 12 wp_admin_css( 'wp-admin', true ); … … 205 205 </script> 206 206 </table> 207 207 208 208 <p><?php _e('The following shortcuts use different access keys: Alt + Shift + letter.') ?></p> 209 209 <table class="keys" width="100%" style="border: 0 none;"> -
trunk/wp-includes/l10n.php
r8556 r8600 292 292 function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false) { 293 293 $locale = get_locale(); 294 294 295 295 if ( false !== $plugin_rel_path ) 296 296 $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/'); -
trunk/wp-includes/link-template.php
r8502 r8600 86 86 if ( empty($category) ) { 87 87 $default_category = get_category( get_option( 'default_category' ) ); 88 $category = is_wp_error( $default_category ) ? '' : $default_category->slug; 88 $category = is_wp_error( $default_category ) ? '' : $default_category->slug; 89 89 } 90 90 } … … 479 479 break; 480 480 endswitch; 481 481 482 482 return apply_filters( 'get_edit_post_link', admin_url("$file.php?{$action}$var=$post->ID"), $post->ID, $context ); 483 483 } … … 781 781 * @since 2.6 782 782 * 783 * Returns the 'site_url' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. 783 * Returns the 'site_url' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. 784 784 * If $scheme is 'http' or 'https', is_ssl() is overridden. 785 785 * -
trunk/wp-includes/media.php
r8358 r8600 306 306 if ( is_array($size) || empty($size) || empty($imagedata['sizes'][$size]) ) 307 307 return false; 308 308 309 309 $data = $imagedata['sizes'][$size]; 310 310 // include the full filesystem path of the intermediate file … … 320 320 // returns an array (url, width, height), or false if no image is available 321 321 function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) { 322 322 323 323 // get a thumbnail or intermediate image if there is one 324 324 if ( $image = image_downsize($attachment_id, $size) ) … … 347 347 $html = '<img src="'.attribute_escape($src).'" '.$hwstring.'class="attachment-'.attribute_escape($size).'" alt="" />'; 348 348 } 349 349 350 350 return $html; 351 351 } … … 367 367 'caption' => '' 368 368 ), $attr)); 369 369 370 370 if ( 1 > (int) $width || empty($caption) ) 371 371 return $content; 372 372 373 373 if ( $id ) $id = 'id="' . $id . '" '; 374 374 375 375 return '<div ' . $id . 'class="wp-caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">' 376 376 . $content . '<p class="wp-caption-text">' . $caption . '</p></div>'; … … 423 423 $columns = intval($columns); 424 424 $itemwidth = $columns > 0 ? floor(100/$columns) : 100; 425 425 426 426 $output = apply_filters('gallery_style', " 427 427 <style type='text/css'> -
trunk/wp-includes/pluggable.php
r8581 r8600 668 668 } else { 669 669 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 670 exit(); 670 exit(); 671 671 } 672 672 } … … 757 757 $location = apply_filters('wp_redirect', $location, $status); 758 758 $status = apply_filters('wp_redirect_status', $status, $location); 759 759 760 760 if ( !$location ) // allows the wp_redirect filter to cancel a redirect 761 761 return false; … … 830 830 // In php 5 parse_url may fail if the URL query part contains http://, bug #38143 831 831 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 832 832 833 833 $lp = parse_url($test); 834 834 $wpp = parse_url(get_option('home')); … … 975 975 $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n"; 976 976 977 $notify_message .= sprintf( __ngettext('Currently %s comment is waiting for approval. Please visit the moderation panel:', 977 $notify_message .= sprintf( __ngettext('Currently %s comment is waiting for approval. Please visit the moderation panel:', 978 978 'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n"; 979 979 $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n"; … … 1541 1541 $left_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $left_string ); 1542 1542 $right_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $right_string ); 1543 1543 1544 1544 $left_lines = split("\n", $left_string); 1545 1545 $right_lines = split("\n", $right_string); -
trunk/wp-includes/post-template.php
r8572 r8600 87 87 88 88 if ( NULL == $more_link_text ) 89 $more_link_text = __( '(more...)' ); 89 $more_link_text = __( '(more...)' ); 90 90 91 91 $output = ''; … … 451 451 if ( !$post = & get_post($id) ) 452 452 return false; 453 453 454 454 if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) 455 455 return false; -
trunk/wp-includes/post.php
r8572 r8600 922 922 923 923 array_splice($stickies, $offset, 1); 924 924 925 925 update_option('sticky_posts', $stickies); 926 926 } … … 1446 1446 return new WP_Error('db_insert_error', __('Could not insert post into the database'), $wpdb->last_error); 1447 1447 else 1448 return 0; 1448 return 0; 1449 1449 } 1450 1450 $post_ID = (int) $wpdb->insert_id; … … 2149 2149 if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) { 2150 2150 $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )"; 2151 2152 // meta_key and met_value might be slashed 2151 2152 // meta_key and met_value might be slashed 2153 2153 $meta_key = stripslashes($meta_key); 2154 2154 $meta_value = stripslashes($meta_value); … … 2343 2343 if ( $file ) 2344 2344 update_attached_file( $post_ID, $file ); 2345 2345 2346 2346 clean_post_cache($post_ID); 2347 2347 … … 2535 2535 if ( !$url = wp_get_attachment_url( $post->ID ) ) 2536 2536 return false; 2537 2537 2538 2538 $sized = image_downsize( $post_id, 'thumbnail' ); 2539 2539 if ( $sized ) -
trunk/wp-includes/query.php
r8589 r8600 122 122 function is_tax( $slug = '' ) { 123 123 global $wp_query; 124 124 125 125 if ( !$wp_query->is_tax ) 126 126 return false; … … 1359 1359 if ( ! empty($q['meta_key']) || ! empty($q['meta_value']) ) 1360 1360 $join .= " LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) "; 1361 if ( ! empty($q['meta_key']) ) 1361 if ( ! empty($q['meta_key']) ) 1362 1362 $where .= $wpdb->prepare("AND $wpdb->postmeta.meta_key = %s ", $q['meta_key']); 1363 1363 if ( ! empty($q['meta_value']) ) -
trunk/wp-includes/rewrite.php
r8572 r8600 65 65 * @param string $base the taxonomy base that we're going to filter 66 66 * @return string 67 * @author Mark Jaquith 67 * @author Mark Jaquith 68 68 */ 69 69 function _wp_filter_taxonomy_base( $base ) { -
trunk/wp-includes/script-loader.php
r8540 r8600 194 194 'count' => __('Word count: %d') 195 195 )); 196 196 197 197 $scripts->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080721' ); 198 198 $scripts->localize( 'wp-gears', 'wpGearsL10n', array( … … 200 200 'error' => __('Error:') 201 201 )); 202 202 203 203 $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); 204 204 … … 207 207 'plugin_information' => __('Plugin Information:') 208 208 ) ); 209 209 210 210 } 211 211 } -
trunk/wp-includes/shortcodes.php
r8196 r8600 49 49 * plugin has a similar shortcode, it will override yours or yours will override 50 50 * theirs depending on which order the plugins are included and/or ran. 51 * 51 * 52 52 * Simplest example of a shortcode tag using the API: 53 53 * … … 205 205 * @since 2.5 206 206 * 207 * @param string $text 207 * @param string $text 208 208 * @return array List of attributes and their value. 209 209 */ … … 279 279 } 280 280 281 add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() 281 add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() 282 282 283 283 ?> -
trunk/wp-includes/taxonomy.php
r8572 r8600 785 785 if ( $result = $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $slug, $taxonomy), ARRAY_A) ) 786 786 return $result; 787 787 788 788 return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $else_where AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); 789 789 } -
trunk/wp-includes/theme.php
r8497 r8600 234 234 $stylesheet_files = array(); 235 235 $template_files = array(); 236 236 237 237 $stylesheet_dir = @ dir("$theme_root/$stylesheet"); 238 238 if ( $stylesheet_dir ) { -
trunk/wp-includes/user.php
r8572 r8600 24 24 if ( '' === $secure_cookie ) 25 25 $secure_cookie = is_ssl() ? true : false; 26 26 27 27 // If no credential info provided, check cookie. 28 28 if ( empty($credentials['user_login']) && empty($credentials['user_password']) ) { … … 103 103 else // Blog global 104 104 $result = get_option( $option ); 105 105 106 106 return apply_filters("get_user_option_{$option}", $result, $option, $user); 107 107 } -
trunk/wp-includes/widgets.php
r8572 r8600 167 167 function wp_register_widget_control($id, $name, $control_callback, $options = array()) { 168 168 global $wp_registered_widget_controls; 169 169 170 170 $id = strtolower($id); 171 171 … … 463 463 extract($args); 464 464 $searchform_template = get_template_directory() . '/searchform.php'; 465 465 466 466 echo $before_widget; 467 467 468 468 // Use current theme search form if it exists 469 469 if ( file_exists($searchform_template) ) { … … 476 476 </div></form> 477 477 <?php } 478 478 479 479 echo $after_widget; 480 480 } … … 744 744 ?> 745 745 <ul> 746 <?php 746 <?php 747 747 $cat_args['title_li'] = ''; 748 wp_list_categories($cat_args); 748 wp_list_categories($cat_args); 749 749 ?> 750 750 </ul> -
trunk/wp-includes/wp-db.php
r8572 r8600 340 340 $collation_query .= " COLLATE '{$this->collate}'"; 341 341 } 342 342 343 343 if ( !empty($collation_query) ) 344 344 $this->query($collation_query); 345 346 } 347 345 346 } 347 348 348 $this->select($dbname); 349 349 } … … 686 686 else 687 687 return false; 688 688 689 689 return $this->query( "UPDATE $table SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ) ); 690 690 } -
trunk/wp-login.php
r8489 r8600 19 19 } else { 20 20 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 21 exit(); 21 exit(); 22 22 } 23 23 } … … 136 136 else if ( is_wp_error($allow) ) 137 137 return $allow; 138 138 139 139 $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login)); 140 140 if ( empty($key) ) { -
trunk/wp-settings.php
r8595 r8600 436 436 if ( !defined( 'AUTOSAVE_INTERVAL' ) ) 437 437 define( 'AUTOSAVE_INTERVAL', 60 ); 438 438 439 439 440 440 require (ABSPATH . WPINC . '/vars.php'); -
trunk/xmlrpc.php
r8543 r8600 1014 1014 // We've got all the data -- post it: 1015 1015 $comment = compact('comment_ID', 'comment_content', 'comment_approved', 'comment_date', 'comment_date_gmt', 'comment_author', 'comment_author_email', 'comment_author_url'); 1016 1016 1017 1017 $result = wp_update_comment($comment); 1018 1018 if ( is_wp_error( $result ) ) … … 1093 1093 1094 1094 do_action('xmlrpc_call', 'wp.newComment'); 1095 1095 1096 1096 return wp_new_comment($comment); 1097 1097 } … … 1882 1882 } 1883 1883 1884 // Handle enclosures 1885 $enclosure = $content_struct['enclosure']; 1886 if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { 1884 // Handle enclosures 1885 $enclosure = $content_struct['enclosure']; 1886 if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { 1887 1887 add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] ); 1888 } 1888 } 1889 1889 1890 1890 $this->attach_uploads( $post_ID, $post_content ); … … 2150 2150 } 2151 2151 2152 // Handle enclosures 2153 $enclosure = $content_struct['enclosure']; 2154 if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { 2152 // Handle enclosures 2153 $enclosure = $content_struct['enclosure']; 2154 if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { 2155 2155 add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] ); 2156 } 2156 } 2157 2157 2158 2158 $this->attach_uploads( $ID, $post_content );
Note: See TracChangeset
for help on using the changeset viewer.