Changeset 6592
- Timestamp:
- 01/10/2008 08:51:07 PM (17 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/bookmark.php
r6480 r6592 185 185 } 186 186 187 if ($show_updated) { 188 $get_updated = ", UNIX_TIMESTAMP(link_updated) AS link_updated_f "; 189 } 187 $get_updated = ( $show_updated ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : ''; 190 188 191 189 $orderby = strtolower($orderby); -
trunk/wp-includes/functions.php
r6568 r6592 991 991 992 992 function wp_get_referer() { 993 foreach ( array( $_REQUEST['_wp_http_referer'], $_SERVER['HTTP_REFERER'] ) as $ref ) 994 if ( !empty( $ref ) ) 995 return $ref; 993 if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) 994 return $_REQUEST['_wp_http_referer']; 995 else if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) 996 return $_SERVER['HTTP_REFERER']; 996 997 return false; 997 998 } -
trunk/wp-includes/link-template.php
r6551 r6592 143 143 $pagestruct = $wp_rewrite->get_page_permastruct(); 144 144 145 if ( '' != $pagestruct && 'draft' != $post->post_status ) {145 if ( '' != $pagestruct && isset($post->post_status) && 'draft' != $post->post_status ) { 146 146 $link = get_page_uri($id); 147 147 $link = str_replace('%pagename%', $link, $pagestruct); … … 598 598 599 599 $home_root = parse_url(get_option('home')); 600 $home_root = $home_root['path'];600 $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : ''; 601 601 $home_root = preg_quote( trailingslashit( $home_root ), '|' ); 602 602 -
trunk/wp-includes/post-template.php
r6399 r6592 57 57 if ( !empty($post->post_password) ) 58 58 $title = sprintf(__('Protected: %s'), $title); 59 else if ( 'private' == $post->post_status )59 else if ( isset($post->post_status) && 'private' == $post->post_status ) 60 60 $title = sprintf(__('Private: %s'), $title); 61 61 … … 444 444 $constraint = ''; 445 445 } 446 } else { 447 $constraint = ''; 446 448 } 447 449 -
trunk/wp-includes/post.php
r6551 r6592 158 158 function &get_post(&$post, $output = OBJECT, $filter = 'raw') { 159 159 global $wpdb; 160 $null = null; 160 161 161 162 if ( empty($post) ) { … … 163 164 $_post = & $GLOBALS['post']; 164 165 else 165 return null;166 return $null; 166 167 } elseif ( is_object($post) ) { 167 168 wp_cache_add($post->ID, $post, 'posts'); -
trunk/wp-includes/rewrite.php
r6398 r6592 68 68 69 69 // First, check to see if there is a 'p=N' or 'page_id=N' to match against 70 preg_match('#[?&](p|page_id)=(\d+)#', $url, $values); 71 $id = intval($values[2]); 72 if ( $id ) return $id; 70 if ( preg_match('#[?&](p|page_id)=(\d+)#', $url, $values) ) { 71 $id = absint($values[2]); 72 if ($id) 73 return $id; 74 } 73 75 74 76 // Check to see if we are using rewrite rules … … 592 594 if (0 < $i) { 593 595 $queries[$i] = $queries[$i - 1] . '&'; 596 } else { 597 $queries[$i] = ''; 594 598 } 595 599 … … 629 633 $num_toks = preg_match_all('/%.+?%/', $struct, $toks); 630 634 //get the 'tagname=$matches[i]' 631 $query = $queries[$num_toks - 1];635 $query = ( isset($queries) && is_array($queries) ) ? $queries[$num_toks - 1] : ''; 632 636 633 637 //set up $ep_mask_specific which is used to match more specific URL types … … 722 726 723 727 //do endpoints for attachments 724 if ( $endpoint) { foreach ($ep_query_append as $regex => $ep) {728 if (! empty($endpoint) ) { foreach ($ep_query_append as $regex => $ep) { 725 729 if ($ep[0] & EP_ATTACHMENT) { 726 730 $rewrite[$sub1 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2); -
trunk/wp-includes/taxonomy.php
r6551 r6592 507 507 function &get_terms($taxonomies, $args = '') { 508 508 global $wpdb; 509 $empty_array = array(); 509 510 510 511 $single_taxonomy = false; … … 546 547 $hierarchy = _get_term_hierarchy($taxonomies[0]); 547 548 if ( !isset($hierarchy[$child_of]) ) 548 return array();549 return $empty_array; 549 550 } 550 551 … … 552 553 $hierarchy = _get_term_hierarchy($taxonomies[0]); 553 554 if ( !isset($hierarchy[$parent]) ) 554 return array();555 return $empty_array; 555 556 } 556 557 … … 1582 1583 */ 1583 1584 function &get_object_term_cache($id, $taxonomy) { 1584 return wp_cache_get($id, "{$taxonomy}_relationships"); 1585 $cache = wp_cache_get($id, "{$taxonomy}_relationships"); 1586 return $cache; 1585 1587 } 1586 1588 … … 1728 1730 */ 1729 1731 function &_get_term_children($term_id, $terms, $taxonomy) { 1732 $empty_array = array(); 1730 1733 if ( empty($terms) ) 1731 return array();1734 return $empty_array; 1732 1735 1733 1736 $term_list = array(); … … 1735 1738 1736 1739 if ( ( 0 != $term_id ) && ! isset($has_children[$term_id]) ) 1737 return array();1740 return $empty_array; 1738 1741 1739 1742 foreach ( $terms as $term ) { -
trunk/wp-includes/theme.php
r6530 r6592 77 77 preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ); 78 78 preg_match( '|Description:(.*)$|mi', $theme_data, $description ); 79 preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ); 80 preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ); 81 preg_match( '|Template:(.*)$|mi', $theme_data, $template ); 79 80 if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) ) 81 $author_uri = clean_url( trim( $author_uri[1]) ); 82 else 83 $author_uti = ''; 84 85 if ( preg_match( '|Template:(.*)$|mi', $theme_data, $template ) ) 86 $template = wp_kses( trim( $template[1], $themes_allowed_tags ) ); 87 else 88 $template = ''; 82 89 83 90 if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) … … 99 106 $theme_uri = clean_url( trim( $theme_uri[1] ) ); 100 107 $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) ); 101 $template = wp_kses( trim( $template[1] ), $themes_allowed_tags ); 102 103 $author_uri = clean_url( trim( $author_uri[1] ) ); 104 105 if ( empty( $author_uri[1] ) ) { 106 $author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags ); 108 109 if ( preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ) ) { 110 if ( empty( $author_uri ) ) { 111 $author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags ); 112 } else { 113 $author = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $author_uri, __( 'Visit author homepage' ), wp_kses( trim( $author_name[1] ), $themes_allowed_tags ) ); 114 } 107 115 } else { 108 $author = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $author_uri, __( 'Visit author homepage' ), wp_kses( trim( $author_name[1] ), $themes_allowed_tags ));116 $author = __('Anonymous'); 109 117 } 110 118
Note: See TracChangeset
for help on using the changeset viewer.