-
Notifications
You must be signed in to change notification settings - Fork 497
[Port dspace-8_x] Escape html tags in innerHTML #4737 #4882
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
base: dspace-8_x
Are you sure you want to change the base?
[Port dspace-8_x] Escape html tags in innerHTML #4737 #4882
Conversation
…rough an innerHTML attribute or not to properly escape them
…rt-4737-to-dspace-8_x
tdonohue
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bram-maegerman : Thanks also for this backport. Similar to my review on #4881, I believe there's a few minor bugs in this backport. Also there's a change that is unrelated to this PR. See inline below.
Once this is updated, I can retest / rereview.
| for (const inputKey of inputKeys) { | ||
| if (inputKey.includes('*')) { | ||
| const inputKeyRegex = new RegExp('^' + inputKey.replace(/\\/g, '\\\\').replace(/\./g, '\\.').replace(/\*/g, '.*') + '$'); | ||
| const inputKeyRegex = new RegExp('^' + inputKey.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this change, as this seems to be reverting a different bug fix. In other words this change is not in the original PR you are backporting.
| [innerHTML]="item.firstMetadataValue('dc.publisher') + ', '"></span> | ||
| [innerHTML]="item.firstMetadataValue('dc.publisher', undefined, true) + ', '"></span> | ||
| <span class="item-list-date" | ||
| [innerHTML]="item.firstMetadataValue('dc.date.issued') || ('mydspace.results.no-date' | translate)"></span>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <span [ngClass]="{'text-muted': !item.hasMetadata('dc.description.abstract')}" | ||
| [innerHTML]="(item.firstMetadataValue('dc.description.abstract')) || ('mydspace.results.no-abstract' | translate)"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port of #4737 by @bram-maegerman to
dspace-8_x