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

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 style issue 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
Index: Source/core/frame/DOMWindowBase64.cpp
diff --git a/Source/core/frame/DOMWindowBase64.cpp b/Source/core/frame/DOMWindowBase64.cpp
index d2c178728dfcaf44d11712c9522645cb1877ffd2..7bb7e6471028087f79b67bc8ba87184675bf962a 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>, ValidatePadding)) {
es.throwDOMException(InvalidCharacterError, "'atob' failed: The string to be decoded is not correctly encoded.");
return String();
}

Powered by Google App Engine
This is Rietveld 408576698