Bug 37232

Summary: Quotation mark in title does not show correctly in page title
Product: Koha Reporter: Janusz Kaczmarek <januszop>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 33911    
Bug Blocks:    

Description Janusz Kaczmarek 2024-07-02 13:42:36 UTC
If a title of a book starts with (or contains) a quotation mark, it will be displayed in a wrong way in the browser page title (in librarian interface).

This is because the title string, after bug 33911, is being | html filtered twice: for the first time inside biblio-title-head.inc, and then as the result of tx MACRO:

" | html ==> &quot; | html ==> &amp;quot;

To see the problem, search in ktd, standard data, for "Páipéir bhána agus páipéir bhreaca."  In title of the page you will see: 

Details for &quot;Páipéir bhána...

instead:

Details for "Páipéir bhána...
Comment 1 Owen Leonard 2024-07-02 14:10:21 UTC
It would probably make the qa tool unhappy, but we could just remove the second html filter:

 [% tx("Details for {title}", { title = title_in_title }) %]

Am I missing a danger here?
Comment 2 Janusz Kaczmarek 2024-07-02 14:44:41 UTC
(In reply to Owen Leonard from comment #1)
> Am I missing a danger here?

This is exactly the question I was asking myself.  Is it possible that tx introduces some dangerous characters?  No idea...