[wp-trac] [WordPress Trac] #53308: The WP_CONTENT_URL constant contains an incorrect URL

WordPress Trac noreply at wordpress.org
Mon May 31 11:49:50 UTC 2021


#53308: The WP_CONTENT_URL constant contains an incorrect URL
--------------------------+-----------------------------
 Reporter:  webtemyk      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.7.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In one of the latest versions of WordPress, we added this code to the file
 wp-config.php:
 {{{#!php
 <?php
 if ( ! defined( 'WP_CLI' ) ) {
         define( 'WP_SITEURL', $_SERVER['REQUEST_SCHEME'] . '://' .
 $_SERVER['HTTP_HOST'] );
         define( 'WP_HOME', $_SERVER['REQUEST_SCHEME'] . '://' .
 $_SERVER['HTTP_HOST'] );
 }
 }}}

 However, when declaring some constants, the site URL continues to be taken
 from the option in the database:
 {{{#!php
 <?php
 define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
 }}}

 The problem occurs when the site administrator moves the site to another
 domain or switches to HTTPS, but does not change the URL in the database.
 At the same time, Wordpress continues to work, even with the wrong address
 in the option in the database, but the old site address turns out to be in
 the constant

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53308>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list