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

Fix #6960 Beacon script can be injected multiple times when there are multiple </body> in the page. #7231

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Khadreal
Copy link
Contributor

Description

Fix multiple tag beacon script issue.

Fixes #6960

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Detailed scenario

Create a template with multiple </body> tag and open in a browser, check the script and notice that the beacon script is run twice(inserted twice)

Technical description

Documentation

Change the beacon script insertion with str_replace to preg_replace

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

@Khadreal Khadreal self-assigned this Jan 16, 2025
@Khadreal Khadreal requested a review from a team January 16, 2025 12:24
Copy link

codacy-production bot commented Jan 16, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for e726c3d1 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e726c3d) Report Missing Report Missing Report Missing
Head commit (7aff6de) 38762 17144 44.23%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7231) 4 4 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@Mai-Saad
Copy link
Contributor

@Miraeld Miraeld self-assigned this Jan 23, 2025
@Miraeld
Copy link
Contributor

Miraeld commented Jan 23, 2025

Everything green ! Great!
testrail-report-683.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Beacon script can be injected multiple times when there are multiple </body> in the page.
4 participants