feat: Support Roundcube 1.7 static files handling#34
Conversation
fff81ca to
a69b58e
Compare
|
As we do not have full E2E testing, I manually gave this a spin with 1.7-RC6 (in docker), and confirmed that this works as intended. |
|
Note: Reading the current Roundcube code, there may be a simpler alternative: Instead of parsing the Roundcube version ourselves, we could call |
b242240 to
40d1440
Compare
|
Redesigned to switch to asset_url function instead, much simpler now. Tested it, appears to work. Inclined to merge this ASAP as Roundcube 1.7 was released today. |
There was a problem hiding this comment.
Pull request overview
Adds Roundcube 1.7-compatible handling for plugin static assets by routing icon URLs through Roundcube’s asset URL resolver, while preserving legacy behavior for older versions.
Changes:
- Introduce
get_svg_path()and update message header rendering to useasset_url()for iconsrcvalues. - Refactor PHPUnit expectations to derive icon URLs from the plugin helper and add stub-based tests for legacy vs
static.phpURL generation. - Update README to note testing up to Roundcube 1.7.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tls_icon.php |
Uses Roundcube’s asset URL resolution for SVG icon URLs to support 1.7 static.php handling. |
test/TlsIconTest.php |
Refactors expected HTML strings and adds unit tests around asset URL stubbing. |
test/rcmail.php |
Extends the Roundcube test stub to include output->asset_url() behavior via a callback. |
README.md |
Documents compatibility testing up to Roundcube 1.7. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
4d283da to
fdb30da
Compare
BREAKING CHANGE: Due to lack of PHPUnit support for older releases, require a more recent PHP release. 7.1 went EOL in 2019 anyway. Technically breaking though.
Roundcube 1.7 forces us to go trough static.php for security. However, this script does not exist in older Roundcube releases. Fortunately, there's an API function available that exists in both old and new releases and accounts for the new behaviour. test: reset rcmail singleton between tests Agent-Logs-Url: https://github.com/GermanCoding/Roundcube_TLS_Icon/sessions/1a348c23-50d8-4c86-9ac7-408ac7badf4a Co-authored-by: GermanCoding <4279661+GermanCoding@users.noreply.github.com> chore: Add extra test for new static file handling Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fdb30da to
6705fed
Compare
Roundcube 1.7 forces us to go through static.php for security. However, this script does not exist in older Roundcube releases. To maintain backwards compatibility, figure out the correct path at runtime depending on the version.
Fixes #33