Repository navigation
fix: accept upper-case link schemes and trim widget icons - #3416
Draft
rubenvdlinde wants to merge 2 commits into
Draft
rubenvdlinde wants to merge 2 commits into
rubenvdlinde wants to merge 2 commits into
Conversation
HTTPS://example.com is the same link as https://example.com; schemes compare without case, as RFC 3986 defines them. Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
Blanks around an icon name, no-break and zero-width spaces included, are dropped, so " star " is the star icon and an icon of blanks is none. Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
3 of 5 tasks
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.
Two small input fixes, split out of #3135 at review:
HTTPS://nextcloud.comis the same link ashttps://nextcloud.com, because RFC 3986 compares schemes without case. Until now it was refused.TextHelper::trim(), the same way titles and descriptions are. So" star "is the star icon, and an icon of only blanks (no-break and zero-width spaces included) counts as no icon. Until now" star "was refused.These are two separate commits, so either can be dropped if you'd rather not have it.
How it was tested
TextLinkBusinessTest: an upper-case scheme is accepted.GridWidgetTypesTest: a data provider with spaces, no-break and zero-width spaces around an icon. Full unit suite (787 tests) and psalm green.How it was tested on a live instance
On Nextcloud 34 with PostgreSQL. Link cells through the API and in the browser:
HTTPS://nextcloud.comandHttps://nextcloud.com/xare saved as typed and the cell opens the link in a new tab; on main both were refused.https://still works, andjavascript:andFTP://are still refused. Widget icons through the page API:" star "and a no-break/zero-width paddedstarare stored asstar, an icon of only no-break spaces is stored as no icon, and an unknown icon is still refused; on main the padded ones were refused.🖼️ Screenshots
None, no visible change.
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)