Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: Source/core/frame/DOMWindowBase64.cpp

Issue 58143002: WindowBase64::atob() does not remove space characters from input (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix nits Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/Window/atob-btoa-expected.txt ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/DOMWindowBase64.cpp
diff --git a/Source/core/frame/DOMWindowBase64.cpp b/Source/core/frame/DOMWindowBase64.cpp
index d2c178728dfcaf44d11712c9522645cb1877ffd2..a2e8d5ec185591b23fc6e560cb87dc024e92e076 100644
--- a/Source/core/frame/DOMWindowBase64.cpp
+++ b/Source/core/frame/DOMWindowBase64.cpp
@@ -35,6 +35,7 @@
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
+#include "core/html/parser/HTMLParserIdioms.h"
#include "wtf/text/Base64.h"
namespace WebCore {
@@ -63,9 +64,8 @@ String atob(void*, const String& encodedString, ExceptionState& es)
es.throwDOMException(InvalidCharacterError, "'atob' failed: The string to be decoded contains characters outside of the Latin1 range.");
return String();
}
-
Vector<char> out;
- if (!base64Decode(encodedString, out, Base64FailOnInvalidCharacterOrExcessPadding)) {
+ if (!base64Decode(encodedString, out, isHTMLSpace<UChar>, Base64ValidatePadding)) {
es.throwDOMException(InvalidCharacterError, "'atob' failed: The string to be decoded is not correctly encoded.");
return String();
}
« no previous file with comments | « LayoutTests/fast/dom/Window/atob-btoa-expected.txt ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698