Repository navigation
Bundle the Patreon button instead of loading it from Patreon's CDN - #212
Merged
Merged
Conversation
The ACP page loaded its "Become a patron" image from c5.patreon.com, so every view of the page made the admin's browser call a third party, and the button would break if Patreon moved the file. Ship the image with the extension and pass its URL to the template as U_PATREON_BUTTON. Closes #200 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #200.
Problem
The Recent Topics ACP page loaded its "Become a patron" image from
https://c5.patreon.com/external/logo/become_a_patron_button.png. Every view of the page made the admin's browser call Patreon, and the button would break if Patreon moved the file.Fix
adm/style/images/become_a_patron_button.png: the same 217×51 PNG (3,086 bytes), now shipped with the extension.acp/recenttopics_module.php: passesU_PATREON_BUTTON($phpbb_root_path . 'ext/avathar/recenttopics/adm/style/images/become_a_patron_button.png'). In the ACP,$phpbb_root_pathis./../, which resolves fromadm/.adm/style/acp_recenttopics.html:<img src="{{ U_PATREON_BUTTON }}">. The link to the Patreon page itself is unchanged.Tests
tests/acp/acp_template_test.php:patreon.com/externalURL;Both failed before the change.
test_acp_patreon_button_is_local: the rendered ACP page's buttonsrcis the bundled file, and that URL returns 200. CI only.tests/tests.mdupdated. Unit suite: 71 tests, 0 failures locally, with the harness now loadingfunctions_content.phplike CI.Checked on the local board: with the image copied into the board's extension folder,
adm/./../ext/avathar/recenttopics/adm/style/images/become_a_patron_button.pngreturns 200image/png(3,086 bytes). The board doesn't block direct access toext/. The copy was removed afterwards.No changelog entry or version bump, per this repo's convention. I'll confirm this PR's CI run before calling it ready.
🤖 Generated with Claude Code