Commit 0ce11f16 authored by Orin Jaworski's avatar Orin Jaworski Committed by Commit Bot

[omnibox] Fix drag and drop acceptance of unsanitized text

The omnibox was accepting raw text from drag data when such text
was left empty by stripping Javascript schemas and whitespace.
This allowed invalid omnibox edit text content, containing e.g.
newline characters which would then render with confusing glyphs.
This CL fixes the issue by using the sanitized text even if empty.

Bug: 904380
Change-Id: Ia43a9429d200261a929e858681cb771e6b8bc91c
Reviewed-on: https://chromium-review.googlesource.com/c/1334558Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608865}
parent 3b13cccc
......@@ -1560,10 +1560,9 @@ int OmniboxViewViews::OnDrop(const ui::OSExchangeData& data) {
}
} else if (data.HasString() && data.GetString(&text)) {
text = StripJavascriptSchemas(base::CollapseWhitespace(text, true));
}
if (text.empty())
} else {
return ui::DragDropTypes::DRAG_NONE;
}
SetUserText(text);
if (!HasFocus())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment