summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorstelar7 <dudedbz@gmail.com>2021-07-23 11:31:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-23 14:18:17 +0200
commit8264511d3283e54901dc452f4f74b2cc4889af3b (patch)
tree8eab6f67095867ec308d898e89cf9876bc0ef563 /Userland
parent204d5ff8f86547a8b100cf26a958aaabf49211f2 (diff)
downloadserenity-8264511d3283e54901dc452f4f74b2cc4889af3b.zip
LibWeb: Dont try to parse "data" urls as links
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
index 385a2ab1b2..dff94a6b87 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
@@ -1600,8 +1600,13 @@ RefPtr<StyleValue> Parser::parse_image_value(ParsingContext const& context, Styl
auto& value = function_values[i];
if (value.is(Token::Type::Whitespace))
continue;
- if (value.is(Token::Type::String))
+ if (value.is(Token::Type::String)) {
+ // FIXME: RFC2397
+ if (value.token().string().starts_with("data:"))
+ continue;
+
return ImageStyleValue::create(context.complete_url(value.token().string()), *context.document());
+ }
}
}
// FIXME: Handle gradients.