8000 fix: Fix MenuItem::is_external() returning false positives for relative URLs by amustill · Pull Request #3089 · timber/timber · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Fix MenuItem::is_external() returning false positives for relative URLs #3089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2025

Conversation

amustill
Copy link
Contributor

Related: #3080

Issue

MenuItem::is_external currently returns true for relative paths in a custom link, eg. /about/.

Solution

An additional check inside MenuItem::is_external has been added to return false for links failing a URLHelper::is_url check as proposed by @Levdbas here.

@Levdbas
Copy link
Member
Levdbas commented Feb 25, 2025

Thanks @amustill , added some tests to make sure this keeps working in the future!

@Levdbas
Copy link
Member
Levdbas commented Apr 21, 2025

@nlemoine , @gchtr , can you take a look at this PR?

Copy link
Member
@gchtr gchtr left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@gchtr gchtr changed the title Fix MenuItem::is_external returning false positive for relative URLs. fix: Fix MenuItem::is_external() returning false positives for relative URLs May 6, 2025
@Levdbas Levdbas merged commit 2a14525 into timber:2.x May 7, 2025
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.

3 participants
0