Skip to content

Conversation

belcirelk
Copy link
Contributor

The html characters are not (un)escaped properly in many TPLs. This fix the display of user names containing an apostrophe or html code. It also prevent the html display of the description and title of the reservation that
can break the html pages.

closes #762

@JohnVillalovos
Copy link
Contributor

Thanks @belcirelk I think this needs to be rebased with the current develop branch. And may want to then double check Pages/Ajax/AutoCompletePage.php as I think it has been modified since.

Copy link
Contributor

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused on why sometimes unescape and other times escape.

@JohnVillalovos JohnVillalovos requested a review from Copilot July 31, 2025 04:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses HTML escaping and unescaping issues across multiple template files to properly handle user names containing apostrophes or HTML characters, and prevent HTML code in reservation titles and descriptions from breaking page rendering.

  • Adds proper HTML unescaping before JavaScript escaping for user names and reservation data in PDF generation
  • Implements consistent HTML escaping for reservation titles and descriptions displayed in UI
  • Removes redundant HTML escaping from form input values where it's automatically handled
  • Updates user name handling in autocomplete functionality to properly decode HTML entities

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tpl/Reservation/pdf.tpl Adds HTML unescaping before JavaScript escaping for user names, reservation titles, and descriptions in PDF generation
tpl/Dashboard/dashboard_reservation.tpl Adds HTML escaping for reservation titles and HTML unescaping for user names in dashboard display
tpl/Ajax/user_details.tpl Adds HTML unescaping for user names in popup details
tpl/Ajax/respopup.tpl Adds HTML escaping for titles and descriptions, HTML unescaping for user names in reservation popups
tpl/Admin/Users/user-update.tpl Removes redundant HTML escaping from form input values
tpl/Admin/Users/manage_users.tpl Adds HTML unescaping for user names in user management table
tpl/Admin/Resources/manage_resources_user_permissions.tpl Adds HTML unescaping for user names in resource permissions
tpl/Admin/Reservations/manage_reservations.tpl Adds HTML escaping for titles/descriptions and HTML unescaping for user names
Pages/Ajax/AutoCompletePage.php Adds HTML entity decoding for user names in autocomplete functionality

The html characters are not (un)escaped properly in many TPLs. This fix the display of
user names containing an apostrophe or html code. It also prevent the html display of the description and title of the reservation that
 can break the html pages.

closes LibreBooking#762
@JohnVillalovos JohnVillalovos force-pushed the fix/resolve-html-encode-issues-dashboard branch from 46e9469 to 4d897e9 Compare August 6, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First Name and Last Name containing an apostrophe are not displayed correctly

2 participants