WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/06/2008 07:39:11 AM (12 years ago)
Author:
ryan
Message:

More use of site_url(), admin_url(), and site_url(). Force login and admin links to be https if FORCE_SSL_LOGIN. see #7001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r7998 r8058  
    644644    nocache_headers();
    645645
    646     $login_url = get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']);
    647 
    648     //  Redirect to https if connection is secure
    649     if ( $secure )
    650         $login_url = str_replace('http://', 'https://', $login_url);
     646    $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']), 'forceable' );
     647
    651648    wp_redirect($login_url);
    652649    exit();
     
    665662 */
    666663function check_admin_referer($action = -1, $query_arg = '_wpnonce') {
    667     $adminurl = strtolower(get_option('siteurl')).'/wp-admin';
     664    $adminurl = strtolower(admin_url());
    668665    $referer = strtolower(wp_get_referer());
    669666    $result = wp_verify_nonce($_REQUEST[$query_arg], $action);
     
    795792
    796793    if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
    797         $location = get_option('siteurl') . '/wp-admin/';
     794        $location = admin_url();
    798795
    799796    wp_redirect($location, $status);
     
    849846    }
    850847    $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
    851     $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
    852     $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
     848    $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
     849    $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
    853850
    854851    $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
     
    929926    }
    930927
    931     $notify_message .= sprintf( __('Approve it: %s'),  get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
    932     $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
    933     $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
     928    $notify_message .= sprintf( __('Approve it: %s'),  admin_url("comment.php?action=mac&c=$comment_id") ) . "\r\n";
     929    $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
     930    $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
    934931
    935932    $notify_message .= sprintf( __ngettext('Currently %s comment is waiting for approval. Please visit the moderation panel:',
    936933        'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
    937     $notify_message .= get_option('siteurl') . "/wp-admin/edit-comments.php?comment_status=moderated\r\n";
     934    $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n";
    938935
    939936    $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title );
     
    975972    $message  = sprintf(__('Username: %s'), $user_login) . "\r\n";
    976973    $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
    977     $message .= get_option('siteurl') . "/wp-login.php\r\n";
     974    $message .= site_url("wp-login.php", 'forceable') . "\r\n";
    978975
    979976    wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
     
    12951292        $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
    12961293    elseif ( 'blank' == $default )
    1297         $default = get_option('siteurl') . '/wp-includes/images/blank.gif';
     1294        $default = includes_url('images/blank.gif');
    12981295    elseif ( !empty($email) && 'gravatar_default' == $default )
    12991296        $default = '';
Note: See TracChangeset for help on using the changeset viewer.