Making WordPress.org

Changeset 12546


Ignore:
Timestamp:
04/18/2023 12:42:34 AM (3 years ago)
Author:
dd32
Message:

Trac: Add a canonical header for Changeset URLS.

Fixes #6936.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/site.html

    r12415 r12546  
    2525
    2626        # <link rel="canonical">
    27         if req.environ['PATH_INFO'].startswith('/ticket/') :
    28                 canonical = 'https://' + req.environ['HTTP_HOST'] + '/ticket/' + req.environ['PATH_INFO'].split('/')[2]
     27        if req.environ['PATH_INFO'].startswith( ( '/ticket/', '/changeset/' ) ) :
     28                url_path_parts = req.environ['PATH_INFO'].split('/')
     29                canonical  = 'https://' + req.environ['HTTP_HOST'] + '/' + url_path_parts[1] + '/' + url_path_parts[2]
    2930        else :
    3031                canonical = false;
Note: See TracChangeset for help on using the changeset viewer.