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

Unified Diff: webkit/database/database_util.cc

Issue 12327022: Merge 183141 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 years, 10 months 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 | « webkit/database/database_util.h ('k') | webkit/database/database_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/database/database_util.cc
===================================================================
--- webkit/database/database_util.cc (revision 183642)
+++ webkit/database/database_util.cc (working copy)
@@ -4,6 +4,7 @@
#include "webkit/database/database_util.h"
+#include "base/basictypes.h"
#include "base/utf_string_conversions.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
@@ -90,4 +91,15 @@
return GURL(web_security_origin.toString());
}
+bool DatabaseUtil::IsValidOriginIdentifier(const string16& origin_identifier) {
+ string16 dotdot = ASCIIToUTF16("..");
+ char16 forbidden[] = {'\\', '/', '\0'};
+
+ string16::size_type pos = origin_identifier.find(dotdot);
+ if (pos == string16::npos)
+ pos = origin_identifier.find_first_of(forbidden, 0, arraysize(forbidden));
+
+ return pos == string16::npos;
+}
+
} // namespace webkit_database
« no previous file with comments | « webkit/database/database_util.h ('k') | webkit/database/database_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698