Changeset 12284
- Timestamp:
- 11/26/2009 11:29:54 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r12246 r12284 934 934 * @since unknown 935 935 * 936 * @param unknown_type $id937 * @param unknown_type $title938 * @param unknown_type $name939 * @return unknown936 * @param int|object $id Post ID or post object. 937 * @param string $title (optional) Title 938 * @param string $name (optional) Name 939 * @return array With two entries of type string 940 940 */ 941 941 function get_sample_permalink($id, $title = null, $name = null) { … … 952 952 if (in_array($post->post_status, array('draft', 'pending'))) { 953 953 $post->post_status = 'publish'; 954 $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID);954 $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID); 955 955 } 956 956 … … 960 960 // Note: if empty name is supplied -- use the title instead, see #6072 961 961 if (!is_null($name)) { 962 $post->post_name = sanitize_title($name ? $name : $title, $post->ID);962 $post->post_name = sanitize_title($name ? $name : $title, $post->ID); 963 963 } 964 964 … … 988 988 989 989 /** 990 * {@internal Missing Short Description}} 991 * 992 * @since unknown 993 * 994 * @param unknown_type $id 995 * @param unknown_type $new_title 996 * @param unknown_type $new_slug 997 * @return unknown 990 * sample permalink html 991 * 992 * intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. 993 * 994 * @since unknown 995 * 996 * @param int|object $id Post ID or post object. 997 * @param string $new_title (optional) New title 998 * @param string $new_slug (optional) New slug 999 * @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. 998 1000 */ 999 1001 function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { -
trunk/wp-admin/includes/widgets.php
r12213 r12284 191 191 <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($id_format); ?>" /> 192 192 <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" /> 193 <input type="hidden" name="widget-width" class="widget-width" value="<?php echo esc_attr($control['width']); ?>" />194 <input type="hidden" name="widget-height" class="widget-height" value="<?php echo esc_attr($control['height']); ?>" />193 <input type="hidden" name="widget-width" class="widget-width" value="<?php if (isset( $control['width'] )) echo esc_attr($control['width']); ?>" /> 194 <input type="hidden" name="widget-height" class="widget-height" value="<?php if (isset( $control['height'] )) echo esc_attr($control['height']); ?>" /> 195 195 <input type="hidden" name="widget_number" class="widget_number" value="<?php echo esc_attr($widget_number); ?>" /> 196 196 <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" /> -
trunk/wp-admin/upload.php
r12231 r12284 309 309 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?> 310 310 <select name='m'> 311 <option <?php selected( @$_GET['m'], 0 ); ?>value='0'><?php _e('Show all dates'); ?></option>311 <option value='0'><?php _e('Show all dates'); ?></option> 312 312 <?php 313 313 foreach ($arc_result as $arc_row) { -
trunk/wp-comments-post.php
r12267 r12284 18 18 nocache_headers(); 19 19 20 $comment_post_ID = (int) $_POST['comment_post_ID'];20 $comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0; 21 21 22 22 $status = $wpdb->get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); -
trunk/wp-includes/author-template.php
r12012 r12284 23 23 function get_the_author($deprecated = '') { 24 24 global $authordata; 25 return apply_filters('the_author', $authordata->display_name);25 return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null); 26 26 } 27 27 -
trunk/wp-includes/comment.php
r12267 r12284 1138 1138 $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_id']; 1139 1139 1140 $commentdata['comment_parent'] = absint($commentdata['comment_parent']);1140 $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0; 1141 1141 $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : ''; 1142 1142 $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; -
trunk/wp-includes/post.php
r12279 r12284 1942 1942 * Given the desired slug and some post details computes a unique slug for the post. 1943 1943 * 1944 * @global wpdb $wpdb 1945 * @global WP_Rewrite $wp_rewrite 1944 1946 * @param string $slug the desired slug (post_name) 1945 1947 * @param integer $post_ID … … 1954 1956 1955 1957 global $wpdb, $wp_rewrite; 1958 1959 $feeds = $wp_rewrite->feeds; 1960 if ( !is_array($feeds) ) 1961 $feeds = array(); 1962 1956 1963 $hierarchical_post_types = apply_filters('hierarchical_post_types', array('page')); 1957 1964 if ( 'attachment' == $post_type ) { … … 1960 1967 $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID)); 1961 1968 1962 if ( $post_name_check || in_array($slug, $ wp_rewrite->feeds) ) {1969 if ( $post_name_check || in_array($slug, $feeds) ) { 1963 1970 $suffix = 2; 1964 1971 do { … … 1975 1982 $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID, $post_parent)); 1976 1983 1977 if ( $post_name_check || in_array($slug, $ wp_rewrite->feeds) ) {1984 if ( $post_name_check || in_array($slug, $feeds) ) { 1978 1985 $suffix = 2; 1979 1986 do { -
trunk/wp-includes/vars.php
r11761 r12284 38 38 $is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false; 39 39 40 if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) { 41 $is_lynx = true; 42 } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) { 43 $is_chrome = true; 44 } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) { 45 $is_safari = true; 46 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) { 47 $is_gecko = true; 48 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false) { 49 $is_winIE = true; 50 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) { 51 $is_macIE = true; 52 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) { 53 $is_opera = true; 54 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false) { 55 $is_NS4 = true; 40 if ( isset($_SERVER['HTTP_USER_AGENT']) ) { 41 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false ) { 42 $is_lynx = true; 43 } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) { 44 $is_chrome = true; 45 } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) { 46 $is_safari = true; 47 } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ) { 48 $is_gecko = true; 49 } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false ) { 50 $is_winIE = true; 51 } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false ) { 52 $is_macIE = true; 53 } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false ) { 54 $is_opera = true; 55 } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false ) { 56 $is_NS4 = true; 57 } 56 58 } 57 59 -
trunk/wp-trackback.php
r12032 r12284 37 37 $request_array = 'HTTP_POST_VARS'; 38 38 39 if ( ! $_GET['tb_id'] ) {39 if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ) { 40 40 $tb_id = explode('/', $_SERVER['REQUEST_URI']); 41 41 $tb_id = intval( $tb_id[ count($tb_id) - 1 ] ); 42 42 } 43 43 44 $tb_url = $_POST['url'];45 $charset = $_POST['charset'];44 $tb_url = isset($_POST['url']) ? $_POST['url'] : ''; 45 $charset = isset($_POST['charset']) ? $_POST['charset'] : ''; 46 46 47 47 // These three are stripslashed here so that they can be properly escaped after mb_convert_encoding() 48 $title = stripslashes($_POST['title']);49 $excerpt = stripslashes($_POST['excerpt']);50 $blog_name = stripslashes($_POST['blog_name']);48 $title = isset($_POST['title']) ? stripslashes($_POST['title']) : ''; 49 $excerpt = isset($_POST['excerpt']) ? stripslashes($_POST['excerpt']) : ''; 50 $blog_name = isset($_POST['blog_name']) ? stripslashes($_POST['blog_name']) : ''; 51 51 52 52 if ($charset) … … 73 73 $tb_id = $posts[0]->ID; 74 74 75 if ( !i ntval( $tb_id ) )75 if ( !isset($tb_id) || !intval( $tb_id ) ) 76 76 trackback_response(1, 'I really need an ID for this to work.'); 77 77
Note: See TracChangeset
for help on using the changeset viewer.