summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/url_fixer_upper.cc
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-06 05:25:55 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-06 05:25:55 +0000
commita64c3cf0ab6da24a9a010a45ebe4794422d40c71 (patch)
tree81a97f4a89be379405ee068ca4a5843ffa0ef6a3 /chrome/browser/net/url_fixer_upper.cc
parent507bad5377a236f93f8ec190ca4354dd3cb47b39 (diff)
downloadchromium_src-a64c3cf0ab6da24a9a010a45ebe4794422d40c71.zip
chromium_src-a64c3cf0ab6da24a9a010a45ebe4794422d40c71.tar.gz
chromium_src-a64c3cf0ab6da24a9a010a45ebe4794422d40c71.tar.bz2
Be a little more careful whether something is an URL or a file path.
BUG=72492 Review URL: http://codereview.chromium.org/7572046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/url_fixer_upper.cc')
-rw-r--r--chrome/browser/net/url_fixer_upper.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/net/url_fixer_upper.cc b/chrome/browser/net/url_fixer_upper.cc
index 37125d0..4d85b42 100644
--- a/chrome/browser/net/url_fixer_upper.cc
+++ b/chrome/browser/net/url_fixer_upper.cc
@@ -538,8 +538,12 @@ GURL URLFixerUpper::FixupRelativeFile(const FilePath& base_dir,
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.