Make WordPress Core

Opened 12 months ago

Last modified 12 months ago

#40334 new defect (bug)

Trim siteurl and homeurl

Reported by: thamaraiselvam Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.3
Component: General Keywords:
Focuses: Cc:


I have seen some sites accidently put new line or space end of the siteurl and home in the wp_options
So whenever WordPress defines constants like WP_CONTENT_URL its not trimming the siteurl

function wp_plugin_directory_constants() {
        if (!defined('WP_CONTENT_URL')) {
                define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');

If siteurl has the new line in the end and plugin_url()

gives the result as follow


As javascript is not supporting multiline string so it just broke my UI.

Attachments (1)

40334.patch (662 bytes) - added by thamaraiselvam 12 months ago.
This sample patch but it should be done everywhere

Download all attachments as: .zip

Change History (3)

12 months ago

This sample patch but it should be done everywhere

#1 @thamaraiselvam
12 months ago

Also if siteurl and home keys has the new line or space at the end WordPress never shows any warnings or error

Note: See TracTickets for help on using tickets.