Ticket #9008: 9008.2.diff
File 9008.2.diff, 21.6 KB (added by , 15 years ago) |
---|
-
wp-includes/post-template.php
818 818 $class = ''; 819 819 if ( is_front_page() && !is_paged() ) 820 820 $class = 'class="current_page_item"'; 821 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';821 $menu .= '<li ' . $class . '><a href="' . home_url() . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>'; 822 822 // If the front page is a page, add it to the exclude list 823 823 if (get_option('show_on_front') == 'page') { 824 824 if ( !empty( $list_args['exclude'] ) ) { -
wp-includes/taxonomy.php
2220 2220 $slug = $term->slug; 2221 2221 2222 2222 if ( empty($termlink) ) { 2223 $file = trailingslashit( get_option('home') );2223 $file = trailingslashit( home_url() ); 2224 2224 $t = get_taxonomy($taxonomy); 2225 2225 if ( $t->query_var ) 2226 2226 $termlink = "$file?$t->query_var=$slug"; … … 2228 2228 $termlink = "$file?taxonomy=$taxonomy&term=$slug"; 2229 2229 } else { 2230 2230 $termlink = str_replace("%$taxonomy%", $slug, $termlink); 2231 $termlink = get_option('home') . user_trailingslashit($termlink, 'category');2231 $termlink = home_url() . user_trailingslashit($termlink, 'category'); 2232 2232 } 2233 2233 return apply_filters('term_link', $termlink, $term, $taxonomy); 2234 2234 } -
wp-includes/default-widgets.php
447 447 var dropdown = document.getElementById("cat"); 448 448 function onCatChange() { 449 449 if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { 450 location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;450 location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value; 451 451 } 452 452 } 453 453 dropdown.onchange = onCatChange; -
wp-includes/theme.php
1098 1098 if ( 1099 1099 ( false !== strpos($matches[3], '/wp-admin/') ) 1100 1100 || 1101 ( false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], get_option('home')) )1101 ( false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) ) 1102 1102 || 1103 1103 ( false !== strpos($matches[3], '/feed/') ) 1104 1104 || -
wp-includes/comment.php
78 78 if ( 'trackback' == $comment_type || 'pingback' == $comment_type ) { // check if domain is in blogroll 79 79 $uri = parse_url($url); 80 80 $domain = $uri['host']; 81 $uri = parse_url( get_option('home') );81 $uri = parse_url( home_url() ); 82 82 $home_domain = $uri['host']; 83 83 if ( $wpdb->get_var($wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_url LIKE (%s) LIMIT 1", '%'.$domain.'%')) || $domain == $home_domain ) 84 84 return true; … … 1817 1817 1818 1818 // when set to true, this outputs debug messages by itself 1819 1819 $client->debug = false; 1820 $home = trailingslashit( get_option('home') );1820 $home = trailingslashit( home_url() ); 1821 1821 if ( !$client->query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping 1822 1822 $client->query('weblogUpdates.ping', get_option('blogname'), $home); 1823 1823 } -
wp-includes/comment-template.php
954 954 echo '<a href="'; 955 955 if ( $wpcommentsjavascript ) { 956 956 if ( empty( $wpcommentspopupfile ) ) 957 $home = get_option('home');957 $home = home_url(); 958 958 else 959 959 $home = get_option('siteurl'); 960 960 echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id; -
wp-includes/feed-atom-comments.php
32 32 <link rel="self" type="application/atom+xml" href="<?php echo get_post_comments_feed_link('', 'atom'); ?>" /> 33 33 <id><?php echo get_post_comments_feed_link('', 'atom'); ?></id> 34 34 <?php } elseif(is_search()) { ?> 35 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_option('home') . '?s=' . esc_attr(get_search_query()); ?>" />35 <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo home_url() . '?s=' . esc_attr(get_search_query()); ?>" /> 36 36 <link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" /> 37 37 <id><?php echo get_search_comments_feed_link('', 'atom'); ?></id> 38 38 <?php } else { ?> -
wp-includes/link-template.php
150 150 $author, 151 151 $post->post_name, 152 152 ); 153 $permalink = get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink);153 $permalink = home_url() . str_replace($rewritecode, $rewritereplace, $permalink); 154 154 $permalink = user_trailingslashit($permalink, 'single'); 155 155 return apply_filters('post_link', $permalink, $post, $leavename); 156 156 } else { // if they're not using the fancy permalink option 157 $permalink = trailingslashit( get_option('home')) . '?p=' . $post->ID;157 $permalink = trailingslashit(home_url()) . '?p=' . $post->ID; 158 158 return apply_filters('post_link', $permalink, $post, $leavename); 159 159 } 160 160 } … … 192 192 $id = (int) $post->ID; 193 193 194 194 if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) 195 $link = get_option('home');195 $link = home_url(); 196 196 else 197 197 $link = _get_page_link( $id , $leavename, $sample ); 198 198 … … 225 225 if ( '' != $pagestruct && ( ( isset($post->post_status) && 'draft' != $post->post_status && 'pending' != $post->post_status ) || $sample ) ) { 226 226 $link = get_page_uri($id); 227 227 $link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct); 228 $link = trailingslashit( get_option('home')) . $link;228 $link = trailingslashit(home_url()) . $link; 229 229 $link = user_trailingslashit($link, 'page'); 230 230 } else { 231 $link = trailingslashit( get_option('home')) . "?page_id=$id";231 $link = trailingslashit(home_url()) . "?page_id=$id"; 232 232 } 233 233 234 234 return apply_filters( '_get_page_link', $link, $id ); … … 290 290 $yearlink = $wp_rewrite->get_year_permastruct(); 291 291 if ( !empty($yearlink) ) { 292 292 $yearlink = str_replace('%year%', $year, $yearlink); 293 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year);293 return apply_filters('year_link', home_url() . user_trailingslashit($yearlink, 'year'), $year); 294 294 } else { 295 return apply_filters('year_link', trailingslashit( get_option('home')) . '?m=' . $year, $year);295 return apply_filters('year_link', trailingslashit(home_url()) . '?m=' . $year, $year); 296 296 } 297 297 } 298 298 … … 315 315 if ( !empty($monthlink) ) { 316 316 $monthlink = str_replace('%year%', $year, $monthlink); 317 317 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 318 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month);318 return apply_filters('month_link', home_url() . user_trailingslashit($monthlink, 'month'), $year, $month); 319 319 } else { 320 return apply_filters('month_link', trailingslashit( get_option('home')) . '?m=' . $year . zeroise($month, 2), $year, $month);320 return apply_filters('month_link', trailingslashit(home_url()) . '?m=' . $year . zeroise($month, 2), $year, $month); 321 321 } 322 322 } 323 323 … … 345 345 $daylink = str_replace('%year%', $year, $daylink); 346 346 $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink); 347 347 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 348 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day);348 return apply_filters('day_link', home_url() . user_trailingslashit($daylink, 'day'), $year, $month, $day); 349 349 } else { 350 return apply_filters('day_link', trailingslashit( get_option('home')) . '?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);350 return apply_filters('day_link', trailingslashit(home_url()) . '?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day); 351 351 } 352 352 } 353 353 … … 374 374 375 375 $permalink = str_replace('%feed%', $feed, $permalink); 376 376 $permalink = preg_replace('#/+#', '/', "/$permalink"); 377 $output = get_option('home') . user_trailingslashit($permalink, 'feed');377 $output = home_url() . user_trailingslashit($permalink, 'feed'); 378 378 } else { 379 379 if ( empty($feed) ) 380 380 $feed = get_default_feed(); … … 382 382 if ( false !== strpos($feed, 'comments_') ) 383 383 $feed = str_replace('comments_', 'comments-', $feed); 384 384 385 $output = trailingslashit( get_option('home')) . "?feed={$feed}";385 $output = trailingslashit(home_url()) . "?feed={$feed}"; 386 386 } 387 387 388 388 return apply_filters('feed_link', $output, $feed); … … 414 414 } else { 415 415 $type = get_post_field('post_type', $post_id); 416 416 if ( 'page' == $type ) 417 $url = trailingslashit( get_option('home')) . "?feed=$feed&page_id=$post_id";417 $url = trailingslashit(home_url()) . "?feed=$feed&page_id=$post_id"; 418 418 else 419 $url = trailingslashit( get_option('home')) . "?feed=$feed&p=$post_id";419 $url = trailingslashit(home_url()) . "?feed=$feed&p=$post_id"; 420 420 } 421 421 422 422 return apply_filters('post_comments_feed_link', $url); … … 468 468 $feed = get_default_feed(); 469 469 470 470 if ( '' == $permalink_structure ) { 471 $link = trailingslashit( get_option('home')) . "?feed=$feed&author=" . $author_id;471 $link = trailingslashit(home_url()) . "?feed=$feed&author=" . $author_id; 472 472 } else { 473 473 $link = get_author_posts_url($author_id); 474 474 if ( $feed == get_default_feed() ) … … 512 512 $permalink_structure = get_option('permalink_structure'); 513 513 514 514 if ( '' == $permalink_structure ) { 515 $link = trailingslashit( get_option('home')) . "?feed=$feed&cat=" . $cat_id;515 $link = trailingslashit(home_url()) . "?feed=$feed&cat=" . $cat_id; 516 516 } else { 517 517 $link = get_category_link($cat_id); 518 518 if( $feed == get_default_feed() ) … … 551 551 $feed = get_default_feed(); 552 552 553 553 if ( '' == $permalink_structure ) { 554 $link = trailingslashit( get_option('home')) . "?feed=$feed&tag=" . $tag->slug;554 $link = trailingslashit(home_url()) . "?feed=$feed&tag=" . $tag->slug; 555 555 } else { 556 556 $link = get_tag_link($tag->term_id); 557 557 if ( $feed == get_default_feed() ) … … 626 626 if ( empty($feed) ) 627 627 $feed = get_default_feed(); 628 628 629 $link = trailingslashit( get_option('home')) . "?s=$search&feed=$feed";629 $link = trailingslashit(home_url()) . "?s=$search&feed=$feed"; 630 630 631 631 $link = apply_filters('search_feed_link', $link); 632 632 … … 651 651 if ( empty($feed) ) 652 652 $feed = get_default_feed(); 653 653 654 $link = trailingslashit( get_option('home')) . "?s=$search&feed=comments-$feed";654 $link = trailingslashit(home_url()) . "?s=$search&feed=comments-$feed"; 655 655 656 656 $link = apply_filters('search_feed_link', $link); 657 657 … … 1293 1293 1294 1294 $request = remove_query_arg( 'paged' ); 1295 1295 1296 $home_root = parse_url( get_option('home'));1296 $home_root = parse_url(home_url()); 1297 1297 $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : ''; 1298 1298 $home_root = preg_quote( trailingslashit( $home_root ), '|' ); 1299 1299 … … 1727 1727 } 1728 1728 1729 1729 /** 1730 * Retrieve the home url. 1731 * 1732 * Returns the 'home' option with the appropriate protocol, 'https' if 1733 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is 1734 * overridden. 1735 * 1736 * @package WordPress 1737 * @since 2.9.0 1738 * 1739 * @param string $path Optional. Path relative to the home url. 1740 * @param string $scheme Optional. Scheme to give the home url context. Currently 'http','https' 1741 * @return string Home url link with optional path appended. 1742 */ 1743 function home_url($path = '', $scheme = null) { 1744 $orig_scheme = $scheme; 1745 $scheme = ( is_ssl() &&!is_admin() ? 'https' : 'http' ); 1746 $url = str_replace( 'http://', "{$scheme}://", get_option('home') ); 1747 1748 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 1749 $url .= '/' . ltrim($path, '/'); 1750 1751 return apply_filters('home_url', $url, $path, $orig_scheme); 1752 } 1753 1754 /** 1730 1755 * Retrieve the site url. 1731 1756 * 1732 1757 * Returns the 'site_url' option with the appropriate protocol, 'https' if -
wp-includes/author-template.php
200 200 $link = $wp_rewrite->get_author_permastruct(); 201 201 202 202 if ( empty($link) ) { 203 $file = get_option('home') . '/';203 $file = home_url() . '/'; 204 204 $link = $file . '?author=' . $auth_ID; 205 205 } else { 206 206 if ( '' == $author_nicename ) { … … 209 209 $author_nicename = $user->user_nicename; 210 210 } 211 211 $link = str_replace('%author%', $author_nicename, $link); 212 $link = get_option('home') . trailingslashit($link);212 $link = home_url() . trailingslashit($link); 213 213 } 214 214 215 215 $link = apply_filters('author_link', $link, $author_id, $author_nicename); -
wp-includes/rewrite.php
256 256 $url = $url_split[0]; 257 257 258 258 // Add 'www.' if it is absent and should be there 259 if ( false !== strpos( get_option('home'), '://www.') && false === strpos($url, '://www.') )259 if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') ) 260 260 $url = str_replace('://', '://www.', $url); 261 261 262 262 // Strip 'www.' if it is present and shouldn't be 263 if ( false === strpos( get_option('home'), '://www.') )263 if ( false === strpos(home_url(), '://www.') ) 264 264 $url = str_replace('://www.', '://', $url); 265 265 266 266 // Strip 'index.php/' if we're not using path info permalinks 267 267 if ( !$wp_rewrite->using_index_permalinks() ) 268 268 $url = str_replace('index.php/', '', $url); 269 269 270 if ( false !== strpos($url, get_option('home')) ) {270 if ( false !== strpos($url, home_url()) ) { 271 271 // Chop off http://domain.com 272 $url = str_replace( get_option('home'), '', $url);272 $url = str_replace(home_url(), '', $url); 273 273 } else { 274 274 // Chop off /path/to/blog 275 $home_path = parse_url( get_option('home'));275 $home_path = parse_url(home_url()); 276 276 $home_path = $home_path['path']; 277 277 $url = str_replace($home_path, '', $url); 278 278 } … … 1645 1645 $site_root = trailingslashit($site_root['path']); 1646 1646 } 1647 1647 1648 $home_root = parse_url( get_option('home'));1648 $home_root = parse_url(home_url()); 1649 1649 if ( isset( $home_root['path'] ) ) { 1650 1650 $home_root = trailingslashit($home_root['path']); 1651 1651 } else { -
wp-includes/general-template.php
121 121 return; 122 122 } 123 123 124 $form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" >124 $form = '<form role="search" method="get" id="searchform" action="' . home_url() . '/" > 125 125 <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> 126 126 <input type="text" value="' . esc_attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" /> 127 127 <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> … … 304 304 case 'url' : 305 305 case 'home' : // DEPRECATED 306 306 case 'siteurl' : // DEPRECATED 307 $output = get_option('home');307 $output = home_url(); 308 308 break; 309 309 case 'wpurl' : 310 310 $output = get_option('siteurl'); … … 889 889 $arc_week = get_weekstartend($arcresult->yyyymmdd, get_option('start_of_week')); 890 890 $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); 891 891 $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); 892 $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_option('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week);892 $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&', '=', $arcresult->week); 893 893 $text = $arc_week_start . $archive_week_separator . $arc_week_end; 894 894 if ($show_post_count) 895 895 $after = ' ('.$arcresult->posts.')'.$afterafter; -
wp-includes/canonical.php
198 198 $redirect = @parse_url($redirect_url); 199 199 200 200 // www.example.com vs example.com 201 $user_home = @parse_url( get_option('home'));201 $user_home = @parse_url(home_url()); 202 202 if ( !empty($user_home['host']) ) 203 203 $redirect['host'] = $user_home['host']; 204 204 if ( empty($user_home['path']) ) -
wp-includes/classes.php
159 159 $req_uri_array = explode('?', $req_uri); 160 160 $req_uri = $req_uri_array[0]; 161 161 $self = $_SERVER['PHP_SELF']; 162 $home_path = parse_url( get_option('home'));162 $home_path = parse_url(home_url()); 163 163 if ( isset($home_path['path']) ) 164 164 $home_path = $home_path['path']; 165 165 else -
wp-includes/pluggable.php
944 944 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 945 945 946 946 $lp = parse_url($test); 947 $wpp = parse_url( get_option('home'));947 $wpp = parse_url(home_url()); 948 948 949 949 $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : ''); 950 950 -
wp-includes/feed.php
475 475 * @since 2.5 476 476 */ 477 477 function self_link() { 478 $host = @parse_url( get_option('home'));478 $host = @parse_url(home_url()); 479 479 $host = $host['host']; 480 480 echo esc_url( 481 481 'http' -
wp-includes/category-template.php
20 20 $catlink = $wp_rewrite->get_category_permastruct(); 21 21 22 22 if ( empty( $catlink ) ) { 23 $file = get_option( 'home') . '/';23 $file = home_url() . '/'; 24 24 $catlink = $file . '?cat=' . $category_id; 25 25 } else { 26 26 $category = &get_category( $category_id ); -
xmlrpc.php
1611 1611 1612 1612 $struct = array( 1613 1613 'isAdmin' => $is_admin, 1614 'url' => get_option('home') . '/',1614 'url' => home_url() . '/', 1615 1615 'blogid' => '1', 1616 1616 'blogName' => get_option('blogname'), 1617 1617 'xmlrpc' => site_url( 'xmlrpc.php' ) … … 1786 1786 } 1787 1787 1788 1788 /* warning: here we make the assumption that the blog's URL is on the same server */ 1789 $filename = get_option('home') . '/';1789 $filename = home_url() . '/'; 1790 1790 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 1791 1791 1792 1792 $f = fopen($filename, 'r'); … … 1828 1828 } 1829 1829 1830 1830 /* warning: here we make the assumption that the blog's URL is on the same server */ 1831 $filename = get_option('home') . '/';1831 $filename = home_url() . '/'; 1832 1832 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 1833 1833 1834 1834 if ($f = fopen($filename, 'w+')) { … … 3230 3230 $pagelinkedto = str_replace('&', '&', $pagelinkedto); 3231 3231 3232 3232 // Check if the page linked to is in our site 3233 $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_option('home')));3233 $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', home_url())); 3234 3234 if( !$pos1 ) 3235 3235 return new IXR_Error(0, __('Is there no link to us?')); 3236 3236 -
wp-content/themes/default/header.php
38 38 39 39 <div id="header" role="banner"> 40 40 <div id="headerimg"> 41 <h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>41 <h1><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a></h1> 42 42 <div class="description"><?php bloginfo('description'); ?></div> 43 43 </div> 44 44 </div> -
wp-settings.php
509 509 * @since 1.2.0 510 510 */ 511 511 if ( !defined('COOKIEPATH') ) 512 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );512 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', home_url() . '/' ) ); 513 513 514 514 /** 515 515 * It is possible to define this in wp-config.php