Ticket #9008: 9008.diff
File 9008.diff, 20.9 KB (added by , 15 years ago) |
---|
-
wp-includes/post-template.php
822 822 $class = ''; 823 823 if ( is_front_page() && !is_paged() ) 824 824 $class = 'class="current_page_item"'; 825 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';825 $menu .= '<li ' . $class . '><a href="' . home_url() . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>'; 826 826 // If the front page is a page, add it to the exclude list 827 827 if (get_option('show_on_front') == 'page') { 828 828 if ( !empty( $list_args['exclude'] ) ) { -
wp-includes/taxonomy.php
2191 2191 $slug = $term->slug; 2192 2192 2193 2193 if ( empty($termlink) ) { 2194 $file = get_option('home') . '/';2194 $file = home_url() . '/'; 2195 2195 $t = get_taxonomy($taxonomy); 2196 2196 if ( $t->query_var ) 2197 2197 $termlink = "$file?$t->query_var=$slug"; … … 2199 2199 $termlink = "$file?taxonomy=$taxonomy&term=$slug"; 2200 2200 } else { 2201 2201 $termlink = str_replace("%$taxonomy%", $slug, $termlink); 2202 $termlink = get_option('home') . user_trailingslashit($termlink, 'category');2202 $termlink = home_url() . user_trailingslashit($termlink, 'category'); 2203 2203 } 2204 2204 return apply_filters('term_link', $termlink, $term, $taxonomy); 2205 2205 } -
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/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; … … 1540 1540 1541 1541 // when set to true, this outputs debug messages by itself 1542 1542 $client->debug = false; 1543 $home = trailingslashit( get_option('home') );1543 $home = trailingslashit( home_url() ); 1544 1544 if ( !$client->query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping 1545 1545 $client->query('weblogUpdates.ping', get_option('blogname'), $home); 1546 1546 } -
wp-includes/theme.php
921 921 if ( 922 922 ( false !== strpos($matches[3], '/wp-admin/') ) 923 923 || 924 ( false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], get_option('home')) )924 ( false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], home_url()) ) 925 925 || 926 926 ( false !== strpos($matches[3], '/feed/') ) 927 927 || -
wp-includes/comment-template.php
931 931 echo '<a href="'; 932 932 if ( $wpcommentsjavascript ) { 933 933 if ( empty( $wpcommentspopupfile ) ) 934 $home = get_option('home');934 $home = home_url(); 935 935 else 936 936 $home = get_option('siteurl'); 937 937 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 ) || $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 … … 1234 1234 1235 1235 $request = remove_query_arg( 'paged' ); 1236 1236 1237 $home_root = parse_url( get_option('home'));1237 $home_root = parse_url(home_url()); 1238 1238 $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : ''; 1239 1239 $home_root = preg_quote( trailingslashit( $home_root ), '|' ); 1240 1240 … … 1676 1676 } 1677 1677 1678 1678 /** 1679 * Retrieve the home url. 1680 * 1681 * Returns the 'home' option with the appropriate protocol, 'https' if 1682 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is 1683 * overridden. 1684 * 1685 * @package WordPress 1686 * @since 2.9.0 1687 * 1688 * @param string $path Optional. Path relative to the site url. 1689 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http','https' 1690 * @return string Home url link with optional path appended. 1691 */ 1692 function home_url($path = '', $scheme = null) { 1693 $scheme = ( is_ssl() ? 'https' : 'http' ); 1694 $url = str_replace( 'http://', "{$scheme}://", home_url() ); 1695 1696 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 1697 $url .= '/' . ltrim($path, '/'); 1698 1699 return apply_filters('home_url', $url, $path, $orig_scheme); 1700 } 1701 1702 /** 1679 1703 * Retrieve the site url. 1680 1704 * 1681 1705 * Returns the 'site_url' option with the appropriate protocol, 'https' if -
wp-includes/author-template.php
199 199 $link = $wp_rewrite->get_author_permastruct(); 200 200 201 201 if ( empty($link) ) { 202 $file = get_option('home') . '/';202 $file = home_url() . '/'; 203 203 $link = $file . '?author=' . $auth_ID; 204 204 } else { 205 205 if ( '' == $author_nicename ) { … … 208 208 $author_nicename = $user->user_nicename; 209 209 } 210 210 $link = str_replace('%author%', $author_nicename, $link); 211 $link = get_option('home') . trailingslashit($link);211 $link = home_url() . trailingslashit($link); 212 212 } 213 213 214 214 $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 } … … 1641 1641 $site_root = trailingslashit($site_root['path']); 1642 1642 } 1643 1643 1644 $home_root = parse_url( get_option('home'));1644 $home_root = parse_url(home_url()); 1645 1645 if ( isset( $home_root['path'] ) ) { 1646 1646 $home_root = trailingslashit($home_root['path']); 1647 1647 } 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'); … … 888 888 $arc_week = get_weekstartend($arcresult->yyyymmdd, get_option('start_of_week')); 889 889 $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); 890 890 $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); 891 $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);891 $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&', '=', $arcresult->week); 892 892 $text = $arc_week_start . $archive_week_separator . $arc_week_end; 893 893 if ($show_post_count) 894 894 $after = ' ('.$arcresult->posts.')'.$afterafter; -
wp-includes/canonical.php
192 192 $redirect = @parse_url($redirect_url); 193 193 194 194 // www.example.com vs example.com 195 $user_home = @parse_url( get_option('home'));195 $user_home = @parse_url(home_url()); 196 196 if ( !empty($user_home['host']) ) 197 197 $redirect['host'] = $user_home['host']; 198 198 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
926 926 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 927 927 928 928 $lp = parse_url($test); 929 $wpp = parse_url( get_option('home'));929 $wpp = parse_url(home_url()); 930 930 931 931 $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : ''); 932 932 -
wp-includes/feed.php
501 501 * @since 2.5 502 502 */ 503 503 function self_link() { 504 $host = @parse_url( get_option('home'));504 $host = @parse_url(home_url()); 505 505 $host = $host['host']; 506 506 echo esc_url( 507 507 'http' -
xmlrpc.php
1598 1598 1599 1599 $struct = array( 1600 1600 'isAdmin' => $is_admin, 1601 'url' => get_option('home') . '/',1601 'url' => home_url() . '/', 1602 1602 'blogid' => '1', 1603 1603 'blogName' => get_option('blogname'), 1604 1604 'xmlrpc' => site_url( 'xmlrpc.php' ) … … 1773 1773 } 1774 1774 1775 1775 /* warning: here we make the assumption that the blog's URL is on the same server */ 1776 $filename = get_option('home') . '/';1776 $filename = home_url() . '/'; 1777 1777 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 1778 1778 1779 1779 $f = fopen($filename, 'r'); … … 1815 1815 } 1816 1816 1817 1817 /* warning: here we make the assumption that the blog's URL is on the same server */ 1818 $filename = get_option('home') . '/';1818 $filename = home_url() . '/'; 1819 1819 $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); 1820 1820 1821 1821 if ($f = fopen($filename, 'w+')) { … … 3202 3202 $pagelinkedto = str_replace('&', '&', $pagelinkedto); 3203 3203 3204 3204 // Check if the page linked to is in our site 3205 $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_option('home')));3205 $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', home_url())); 3206 3206 if( !$pos1 ) 3207 3207 return new IXR_Error(0, __('Is there no link to us?')); 3208 3208 -
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
472 472 * @since 1.2.0 473 473 */ 474 474 if ( !defined('COOKIEPATH') ) 475 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );475 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', home_url() . '/' ) ); 476 476 477 477 /** 478 478 * It is possible to define this in wp-config.php