Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/escape.h" | 5 #include "net/base/escape.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 unsigned char first_byte; | 153 unsigned char first_byte; |
| 154 if (UnescapeUnsignedCharAtIndex(escaped_text, i, &first_byte)) { | 154 if (UnescapeUnsignedCharAtIndex(escaped_text, i, &first_byte)) { |
| 155 // Per http://tools.ietf.org/html/rfc3987#section-4.1, the following BiDi | 155 // Per http://tools.ietf.org/html/rfc3987#section-4.1, the following BiDi |
| 156 // control characters are not allowed to appear unescaped in URLs: | 156 // control characters are not allowed to appear unescaped in URLs: |
| 157 // | 157 // |
| 158 // U+200E LEFT-TO-RIGHT MARK (%E2%80%8E) | 158 // U+200E LEFT-TO-RIGHT MARK (%E2%80%8E) |
| 159 // U+200F RIGHT-TO-LEFT MARK (%E2%80%8F) | 159 // U+200F RIGHT-TO-LEFT MARK (%E2%80%8F) |
| 160 // U+202A LEFT-TO-RIGHT EMBEDDING (%E2%80%AA) | 160 // U+202A LEFT-TO-RIGHT EMBEDDING (%E2%80%AA) |
| 161 // U+202B RIGHT-TO-LEFT EMBEDDING (%E2%80%AB) | 161 // U+202B RIGHT-TO-LEFT EMBEDDING (%E2%80%AB) |
| 162 // U+202C POP DIRECTIONAL FORMATTING (%E2%80%AC) | 162 // U+202C POP DIRECTIONAL FORMATTING (%E2%80%AC) |
| 163 // U+202D LEFT-TO-RIGHT OVERRIDE (%E2%80%AD) | 163 // U+202D LEFT-TO-RIGHT override (%E2%80%AD) |
| 164 // U+202E RIGHT-TO-LEFT OVERRIDE (%E2%80%AE) | 164 // U+202E RIGHT-TO-LEFT override (%E2%80%AE) |
|
dcheng
2014/10/08 20:25:47
These look like incorrect replacements.
Mostyn Bramley-Moore
2014/10/08 20:48:30
Fixed in patchset 3.
My cpp based cross-check did
| |
| 165 // | 165 // |
| 166 // Additionally, the Unicode Technical Report (TR9) as referenced by RFC | 166 // Additionally, the Unicode Technical Report (TR9) as referenced by RFC |
| 167 // 3987 above has since added some new BiDi control characters. | 167 // 3987 above has since added some new BiDi control characters. |
| 168 // http://www.unicode.org/reports/tr9 | 168 // http://www.unicode.org/reports/tr9 |
| 169 // | 169 // |
| 170 // U+061C ARABIC LETTER MARK (%D8%9C) | 170 // U+061C ARABIC LETTER MARK (%D8%9C) |
| 171 // U+2066 LEFT-TO-RIGHT ISOLATE (%E2%81%A6) | 171 // U+2066 LEFT-TO-RIGHT ISOLATE (%E2%81%A6) |
| 172 // U+2067 RIGHT-TO-LEFT ISOLATE (%E2%81%A7) | 172 // U+2067 RIGHT-TO-LEFT ISOLATE (%E2%81%A7) |
| 173 // U+2068 FIRST STRONG ISOLATE (%E2%81%A8) | 173 // U+2068 FIRST STRONG ISOLATE (%E2%81%A8) |
| 174 // U+2069 POP DIRECTIONAL ISOLATE (%E2%81%A9) | 174 // U+2069 POP DIRECTIONAL ISOLATE (%E2%81%A9) |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 1, kEscapeToChars[i].replacement); | 402 1, kEscapeToChars[i].replacement); |
| 403 break; | 403 break; |
| 404 } | 404 } |
| 405 } | 405 } |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 return text; | 408 return text; |
| 409 } | 409 } |
| 410 | 410 |
| 411 } // namespace net | 411 } // namespace net |
| OLD | NEW |