Edgewall Software
Modify

Opened 6 months ago

Closed 6 months ago

#13754 closed defect (fixed)

Blame view doesn't work when the repository name has meta characters

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: version control/browser Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed blame view not working when repository name has meta characters.

API Changes:
Internal Changes:

Description

The following error is logged after clicking revision number in rev column of blame view for the repository name has meta characters.

2024-05-26 10:57:06,360 Trac[main] WARNING: [127.0.0.1]
 HTTPInternalServerError: 500 Trac Error (Repository 'svn&repos' not found),
 <RequestWithSession "GET '/changeset/3/svn&amp;amp;repos?annotate=%2Fnormal.txt'">,
 referrer 'http://127.0.0.1:3000/tracenv/browser/svn%26amp%3Brepos/normal.txt?annotate=blame'

We should use to_json()|safe in the <script> tag of templates.

  • trac/versioncontrol/templates/browser.html

    diff --git a/trac/versioncontrol/templates/browser.html b/trac/versioncontrol/templates/browser.html
    index aabdc428d..9c98c081b 100644
    a b  
    6363            });
    6464      # elif file:
    6565      #   if file.annotate == 'blame':
    66             enableBlame("${href.changeset()}/", "${reponame}", "${path}");
     66            enableBlame(${to_json(href.changeset() + '/')|safe}, ${to_json(reponame)|safe}, ${to_json(path)|safe});
    6767      #   endif
    6868          $('#preview table.code').enableCollapsibleColumns(
    6969             $('#preview table.code thead th.content'));

Attachments (0)

Change History (1)

comment:1 by Jun Omae, 6 months ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [17806] and merged in [17807].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.