Skip to content

Conversation

@NoumaanAhamed
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings January 2, 2026 11:30
@NoumaanAhamed NoumaanAhamed changed the title fix: enhance security by safely parsing HTML Security-fix: enhance security by safely parsing HTML Jan 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances security in the Magnific Popup library by implementing safer HTML parsing techniques to prevent potential XSS vulnerabilities. The changes focus on preventing malicious HTML execution by using explicit parsing methods instead of relying on jQuery's implicit HTML interpretation.

  • Replaces jQuery's implicit HTML parsing with explicit $.parseHTML() for close button markup
  • Switches from jQuery selector/HTML parsing to native document.querySelector() for the prependTo option to ensure strings are treated strictly as CSS selectors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NoumaanAhamed NoumaanAhamed requested a review from mi5t4n January 2, 2026 11:44
if (typeof mfp.st.prependTo === 'string') {
appendToEl = $(document.body).find(mfp.st.prependTo);
if (typeof mfp.st.prependTo === 'string') {
// FIX: Use document.querySelector to ensure the string is treated
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove the FIX:? Some of the tools think it's a todo directive.

@NoumaanAhamed NoumaanAhamed requested a review from mi5t4n January 2, 2026 12:05
@rtBot
Copy link
Contributor

rtBot commented Jan 2, 2026

Unable to PHPCS or SVG scan one or more files due to error running PHPCS/SVG scanner:

  • app/assets/js/vendors/magnific-popup.js

The error may be temporary. If the error persists, please contact a human (commit-ID: 67e3d1e).

Copy link
Member

@mi5t4n mi5t4n left a comment

Choose a reason for hiding this comment

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

LGTM

@NoumaanAhamed NoumaanAhamed merged commit 5f4c43a into develop Jan 2, 2026
5 of 6 checks passed
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.

4 participants