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

Newlines to <br> lost in context ouput #284

Closed
GavG opened this issue Oct 8, 2023 · 2 comments
Closed

Newlines to <br> lost in context ouput #284

GavG opened this issue Oct 8, 2023 · 2 comments

Comments

@GavG
Copy link

GavG commented Oct 8, 2023

The prepareContextForOutput method translates newlines to
tage for display.

https://github.com/opcodesio/log-viewer/blob/main/resources/js/components/BaseLogTable.vue#L193

However, the output is then passed through the highlightSearchResult method:

https://github.com/opcodesio/log-viewer/blob/main/resources/js/helpers.js#L16

Which calls escapeHtml, escaping any added <br> tags.

I suspect an additional,:

.replace(/&lt;br\/&gt;/g, '<br/>');

Call might solve the issue, I can't forsee this opening up an XSS vector.

@GavG
Copy link
Author

GavG commented Oct 10, 2023

Addressing in the above PR: #285

@arukompas
Copy link
Contributor

arukompas commented Oct 10, 2023

Thanks a lot for the report and the fix @GavG 💪 tagged a new release, v3.1.5

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

No branches or pull requests

2 participants