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

captionText with innerHTML (fixes #88) #92

Closed
wants to merge 1 commit into from

Conversation

mbabini
Copy link

@mbabini mbabini commented Dec 10, 2021

Change captionText to use innerHTML instead of textContent.

Please check... (it's my first pull request ;-))

@mbabini mbabini changed the title captionText with innerHTML captionText with innerHTML (fixes #88) Dec 10, 2021
@midzer
Copy link
Owner

midzer commented Dec 10, 2021

Thanks for your PR @mbabini 👍

Changes look good to me at first. But I hope there are no security issues with using innerHTML, because you could inject inline code via <script>.

Ofc the developer has to abuse it. Or can even users inject it somehow? What do you think @viliusle ?

@viliusle
Copy link
Collaborator

If developer will generate image gallery with captions from untrusted source, then yes, somebody will be able to inject malicious JS code.

we can add additional config variable, that is false, but developer can set it to true during init and allow HTML inside captions.

@viliusle
Copy link
Collaborator

Another idea is leave captionText as it was, but add captionHTML as new option

@midzer
Copy link
Owner

midzer commented Apr 22, 2022

So captionHTML would have a higher priority than captionTextif set.

@mbabini wanna help out and update this PR with the new option?

@midzer midzer added enhancement New feature or request and removed enhancement New feature or request labels Apr 22, 2022
@midzer
Copy link
Owner

midzer commented Dec 23, 2022

bump

I'm gonna start working on this one over the holidays for next minor revision.

@midzer midzer self-assigned this Dec 23, 2022
@midzer
Copy link
Owner

midzer commented Dec 24, 2022

Should be solved by b43119e

@midzer midzer closed this Dec 24, 2022
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.

3 participants