Skip to content

feat: Support Roundcube 1.7 static files handling#34

Merged
GermanCoding merged 2 commits intomasterfrom
roundcube-1.7
May 10, 2026
Merged

feat: Support Roundcube 1.7 static files handling#34
GermanCoding merged 2 commits intomasterfrom
roundcube-1.7

Conversation

@GermanCoding
Copy link
Copy Markdown
Owner

@GermanCoding GermanCoding commented May 2, 2026

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

@GermanCoding
Copy link
Copy Markdown
Owner Author

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.

@GermanCoding GermanCoding mentioned this pull request May 2, 2026
@GermanCoding
Copy link
Copy Markdown
Owner Author

Note: Reading the current Roundcube code, there may be a simpler alternative: Instead of parsing the Roundcube version ourselves, we could call asset_url which handles the static.php redirection automatically on RC1.7 (and this function also exists on older versions)

@GermanCoding GermanCoding force-pushed the roundcube-1.7 branch 4 times, most recently from b242240 to 40d1440 Compare May 10, 2026 14:11
@GermanCoding
Copy link
Copy Markdown
Owner Author

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.

Copy link
Copy Markdown
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

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 use asset_url() for icon src values.
  • Refactor PHPUnit expectations to derive icon URLs from the plugin helper and add stub-based tests for legacy vs static.php URL 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.

Comment thread test/TlsIconTest.php
Comment thread test/TlsIconTest.php
Comment thread test/TlsIconTest.php
Copy link
Copy Markdown

Copilot AI commented May 10, 2026

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:

  • plugins.roundcube.net
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cbqa0P /usr/bin/composer install --no-interaction (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@GermanCoding GermanCoding force-pushed the roundcube-1.7 branch 3 times, most recently from 4d283da to fdb30da Compare May 10, 2026 15:05
GermanCoding and others added 2 commits May 10, 2026 17:08
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>
@GermanCoding GermanCoding merged commit feac2cc into master May 10, 2026
22 checks passed
@GermanCoding GermanCoding deleted the roundcube-1.7 branch May 10, 2026 15:11
Copy link
Copy Markdown
Collaborator

@williamdes williamdes left a comment

Choose a reason for hiding this comment

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

💯

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.

RC1.7 "public_html" folder requirements

4 participants