Making WordPress.org

Changeset 1256


Ignore:
Timestamp:
02/13/2015 12:17:58 AM (10 years ago)
Author:
obenland
Message:

WP.org Themes: Make sure URLs are passed correctly.

Fixes a big where URLs where not created correctly, leading to invalid
locations if if used outside the current context (like in a new tab).

See #745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js

    r1250 r1256  
    7474            });
    7575
    76             wp.themes.router.navigate( wp.themes.router.baseUrl( 'tag/' + tags.join( '+' ) ), { replace: true } );
     76            wp.themes.router.navigate( wp.themes.router.baseUrl( 'tag/' + tags.join( '+' ) ) );
    7777
    7878            // Get the themes by sending Ajax POST request to api.wordpress.org/themes
     
    139139            var data = this.model.toJSON();
    140140
    141             data.permalink = wp.themes.router.baseUrl( data.slug );
     141            data.permalink = wp.themes.data.settings.adminUrl + wp.themes.router.baseUrl( data.slug );
    142142
    143143            // Render themes using the html template
     
    201201            // Make tags click-able and separated by a comma.
    202202            data.tags = _.map( data.tags, function( tag ) {
    203                 return '<a href="' + wp.themes.router.baseUrl( 'tag/' + tag ) + '">' + tag + '</a>';
     203                return '<a href="' + wp.themes.data.settings.adminUrl + wp.themes.router.baseUrl( 'tag/' + tag ) + '">' + tag + '</a>';
    204204            }).join( ', ' );
    205205
     
    527527                url += '/';
    528528            }
    529             return '/' + url;
     529            return url;
    530530        },
    531531
Note: See TracChangeset for help on using the changeset viewer.