Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-19150: The Page Like UI is not following the common template style for a page #2788

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
#livetable_filterObfuscated($map)
$jsontool.serialize($map)
#else
<h1>$escapetool.xml($services.localization.render('like.likers.title', [$doc.plainTitle]))</h1>
#set($titleToDisplay = $services.localization.render('like.likers.title', ["<a href='$doc.getURL()'>$escapetool.xml($doc.plainTitle)</a>"]))
Copy link
Contributor

@manuelleduc manuelleduc Jan 11, 2024

Choose a reason for hiding this comment

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

To be tested but escaping html properties is probably safer.

Suggested change
#set($titleToDisplay = $services.localization.render('like.likers.title', ["<a href='$doc.getURL()'>$escapetool.xml($doc.plainTitle)</a>"]))
#set($titleToDisplay = $services.localization.render('like.likers.title', ["<a href='$escapetool.xml($doc.getURL())'>$escapetool.xml($doc.plainTitle)</a>"]))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure we shouldn't escape this URL: https://github.com/search?q=repo%3Axwiki%2Fxwiki-platform+%2Fhref%3D%27.*getURL%2F&type=code

Most of those are not escaped ...

#template('contentheader.vm')
#set($columns = ["name", "first_name", "last_name"])
#set($columnsProperties = {
"name" : { "type" : "text", "sortable": false, "filterable": false, "html": true },
Expand All @@ -118,5 +119,7 @@
'translationPrefix' : "xe.admin.users."
})

#livetable("likers" $columns $columnsProperties $options)
## The id of the table needs to be complex in order to avoid the risk of 'id collision' that would break
## the livetable.
#livetable("likersTable" $columns $columnsProperties $options)
manuelleduc marked this conversation as resolved.
Show resolved Hide resolved
#end