[wp-trac] [WordPress Trac] #40334: Trim siteurl and homeurl

WordPress Trac noreply at wordpress.org
Sat Apr 1 19:20:35 UTC 2017


#40334: Trim siteurl and homeurl
----------------------------+-----------------------------
 Reporter:  thamaraiselvam  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  General         |    Version:  4.7.3
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 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'''
 ''/wp-includes/default-constants.php''
 {{{#!php
 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

 {{{
 https://example.com
 /wp-content/plugins/myplugin/
 }}}

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

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


More information about the wp-trac mailing list