General fixes and security improvements#199
Merged
Merged
Conversation
Removing for security reasons due to XHR to raw.githubusercontent.com in bundled code. Bad for privacy, CSP, offline/local installs, and reliability.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #199 +/- ##
=========================================
Coverage 98.67% 98.67%
Complexity 285 285
=========================================
Files 38 38
Lines 905 907 +2
=========================================
+ Hits 893 895 +2
Misses 12 12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR focuses on tightening security around “visual demo” ad rendering and removing the external adblock-detection dependency by replacing it with a small local detector.
Changes:
- Render “visual demo” ad locations via structured template data (escaped in Twig) instead of injecting raw HTML strings.
- Replace
just-detect-adblock(bundled UMD + npm metadata) with a localdetector.jsand same-origin bait request. - Fix/adjust ACP ad-location
<optgroup>rendering and make minor markup tweaks in the ad management UI.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| styles/all/template/phpbb_ads_macro.html | Adds safe visual-demo rendering branch (escaped name/desc). |
| styles/all/template/js/detector.js | Introduces local adblock detection (DOM bait + optional fetch bait). |
| styles/all/template/js/bundle.umd.js | Removes bundled third-party adblock detector. |
| styles/all/template/js/adsbygoogle.js | Adds same-origin “bait” asset for request-based detection. |
| styles/all/template/event/overall_header_stylesheets_after.html | Avoids outputting AD_SCRIPTS when it’s an iterable (visual demo). |
| styles/all/template/event/overall_footer_body_after.html | Switches inline detection call to the new local detector + bait URL. |
| styles/all/template/event/overall_footer_after.html | Updates JS include to load the new detector script when enabled. |
| package.json | Removes npm dependency metadata no longer needed. |
| package-lock.json | Removes npm lockfile no longer needed. |
| event/main_listener.php | Changes visual-demo assignment from HTML string to structured array consumed by Twig. |
| config/services.yml | Fixes banner service DI args by removing an unused/incorrect parameter. |
| adm/style/manage_ads.html | Fixes optgroup handling and adjusts some markup in the ACP form. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.