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

Unified Diff: chrome/browser/net/url_fixer_upper.cc

Issue 7572046: Be a little more careful whether something is an URL or a file path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « no previous file | chrome/browser/net/url_fixer_upper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/url_fixer_upper.cc
===================================================================
--- chrome/browser/net/url_fixer_upper.cc (revision 95185)
+++ chrome/browser/net/url_fixer_upper.cc (working copy)
@@ -538,8 +538,12 @@
PrepareStringForFileOps(text, &trimmed);
bool is_file = true;
+ // Avoid recognizing definite non-file URLs as file paths.
+ GURL gurl(trimmed);
+ if (gurl.is_valid() && gurl.IsStandard())
+ is_file = false;
FilePath full_path;
- if (!ValidPathForFile(trimmed, &full_path)) {
+ if (is_file && !ValidPathForFile(trimmed, &full_path)) {
// Not a path as entered, try unescaping it in case the user has
// escaped things. We need to go through 8-bit since the escaped values
// only represent 8-bit values.
« no previous file with comments | « no previous file | chrome/browser/net/url_fixer_upper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698