Make WordPress Core


Ignore:
Timestamp:
03/25/2014 01:06:21 PM (12 years ago)
Author:
nacin
Message:

Encode spaces in get_template_directory_uri() and get_stylesheet_directory_uri().

props SergeyBiryukov.
fixes #21969.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/WPTheme.php

    r25254 r27710  
    111111        }
    112112
     113        /**
     114         * @ticket 21969
     115         */
     116        function test_theme_uris_with_spaces() {
     117                $callback = array( $this, 'filter_theme_with_spaces' );
     118                add_filter( 'stylesheet', $callback );
     119                add_filter( 'template', $callback );
     120
     121                $this->assertEquals( get_theme_root_uri() . '/subdir/theme%20with%20spaces', get_stylesheet_directory_uri() );
     122                $this->assertEquals( get_theme_root_uri() . '/subdir/theme%20with%20spaces', get_template_directory_uri() );
     123
     124                remove_filter( 'stylesheet', $callback );
     125                add_filter( 'template', $callback );
     126        }
     127
     128        function filter_theme_with_spaces() {
     129                return 'subdir/theme with spaces';
     130        }
    113131}
Note: See TracChangeset for help on using the changeset viewer.