Repository navigation
[Port to dtq-dev-93] HTML-escape metadata and load the process log without a URL token - #1750
Open
milanmajchrak wants to merge 1 commit into
Open
milanmajchrak wants to merge 1 commit into
milanmajchrak wants to merge 1 commit into
Conversation
…t a URL token 9968e2d escape submitter metadata before rendering it as HTML 254a002 load the process output log without a token in the URL Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Ports these dtq-dev PRs:
Description
Metadata values are HTML-escaped before they are inserted with
innerHTMLin the places v9 does not cover yet, and the process output log is loaded without a token in the URL.Instructions for Reviewers
v9 already escapes metadata values in result lists, grids and names, and the backend escapes hit highlights (
discovery.highlights.escape-html). So the hit highlight part of 1665 is left out. The{{ }}display-only fields (journal editor and publisher, org unit address, item grid date) are left as in DSpace 9.3. This PR adds the parts that insert HTML, and the change from 1734.List of changes in this PR:
EmphasizePipe(facet value suggestions) escapes the value and adds only the<em>tags.makeLinks(item page description, full item page) escapes the text and builds the links from escaped parts. Links getrel="noopener noreferrer". The full item page now appliesdsReplacebeforemakeLinks, so it does not touch the escaped text.<b>and<br>.HttpClientsends theAuthorizationheader, so the short-lived token is no longer added to the URL.Visible change: a description or full item page value that contains markup such as
<i>now shows the tags as text.How to test:
&and<. Search for a word in the title. Results, the item page, the full item page and the facet suggestions show the value exactly as typed, and the matched word is still highlighted.authentication-tokenparameter.npm run test -- --include=src/app/shared/utils/emphasize.pipe.spec.ts --include=src/app/shared/clarin-shared-util.spec.ts --include=src/app/item-page/simple/field-components/clarin-description-item-field/clarin-description-item-field.component.spec.ts --include=src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts --include=src/app/shared/form/builder/ds-dynamic-form-ui/models/autocomplete/ds-dynamic-autocomplete.component.spec.ts --include=src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.spec.ts --include=src/app/process-page/detail/process-detail.component.spec.tsCodex review (gpt-6.2-sol, high): 1 finding, the same as on dtq-dev. It needs hit highlights on
dc.title.alternative, which the shipped discovery.xml does not have. Not changed.Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.🤖 Generated with Claude Code