mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWebView: Trim whitespace when sanitizing file paths
Previously, the presence of surrounding whitespace would give file paths the `https` schema instead of the `file` schema, making navigation unsuccessful.
This commit is contained in:
parent
9ce727d315
commit
ff7ca5c48c
Notes:
sideshowbarker
2024-07-16 18:26:46 +09:00
Author: https://github.com/dzfrias Commit: https://github.com/LadybirdBrowser/ladybird/commit/ff7ca5c48c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/631 Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 2 additions and 2 deletions
|
@ -36,8 +36,8 @@ Optional<String> get_public_suffix([[maybe_unused]] StringView host)
|
|||
|
||||
Optional<URL::URL> sanitize_url(StringView url, Optional<StringView> search_engine, AppendTLD append_tld)
|
||||
{
|
||||
if (FileSystem::exists(url)) {
|
||||
auto path = FileSystem::real_path(url);
|
||||
if (FileSystem::exists(url.trim_whitespace())) {
|
||||
auto path = FileSystem::real_path(url.trim_whitespace());
|
||||
if (path.is_error())
|
||||
return {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue