Make WordPress Core

Ticket #26412: patch.diff

File patch.diff, 1.3 KB (added by codix, 12 years ago)
  • wp-includes/default-constants.php

    From f2b5b56ea53f22566bd4d61a5aa93c3251d0bbd2 Mon Sep 17 00:00:00 2001
    From: S H Mohanjith <moha@mohanjith.net>
    Date: Wed, 4 Dec 2013 23:02:22 +0200
    Subject: [PATCH] Change WP_CONTENT_URL if using SSL
    
    ---
     wp-includes/default-constants.php | 9 +++++++--
     1 file changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php
    index 4f135c8..51dc5ce 100644
    a b function wp_initial_constants() { 
    9797 * @since 3.0.0
    9898 */
    9999function wp_plugin_directory_constants() {
    100         if ( !defined('WP_CONTENT_URL') )
    101                 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
     100        if ( !defined('WP_CONTENT_URL') ) {
     101                if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
     102                        define( 'WP_CONTENT_URL', preg_replace( '/^http:/', 'https:' , get_option('siteurl') ) . '/wp-content' ); // full url - WP_CONTENT_DIR is defined further up with http: replaced by https:
     103                } else {
     104                        define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
     105                }
     106        }
    102107
    103108        /**
    104109         * Allows for the plugins directory to be moved from the default location.