| 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/net_util.h" | 5 #include "net/base/net_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 "\\u05c3\\u05f4\\u06d4\\u0702\\u115f\\u1160][\\u2000-\\u200b]" | 216 "\\u05c3\\u05f4\\u06d4\\u0702\\u115f\\u1160][\\u2000-\\u200b]" |
| 217 "[\\u2024\\u2027\\u2028\\u2029\\u2039\\u203a\\u2044\\u205f]" | 217 "[\\u2024\\u2027\\u2028\\u2029\\u2039\\u203a\\u2044\\u205f]" |
| 218 "[\\u2154-\\u2156][\\u2159-\\u215b][\\u215f\\u2215\\u23ae" | 218 "[\\u2154-\\u2156][\\u2159-\\u215b][\\u215f\\u2215\\u23ae" |
| 219 "\\u29f6\\u29f8\\u2afb\\u2afd][\\u2ff0-\\u2ffb][\\u3014" | 219 "\\u29f6\\u29f8\\u2afb\\u2afd][\\u2ff0-\\u2ffb][\\u3014" |
| 220 "\\u3015\\u3033\\u3164\\u321d\\u321e\\u33ae\\u33af\\u33c6\\u33df\\ufe14" | 220 "\\u3015\\u3033\\u3164\\u321d\\u321e\\u33ae\\u33af\\u33c6\\u33df\\ufe14" |
| 221 "\\ufe15\\ufe3f\\ufe5d\\ufe5e\\ufeff\\uff0e\\uff06\\uff61\\uffa0\\ufff9]" | 221 "\\ufe15\\ufe3f\\ufe5d\\ufe5e\\ufeff\\uff0e\\uff06\\uff61\\uffa0\\ufff9]" |
| 222 "[\\ufffa-\\ufffd]]", -1, US_INV), status); | 222 "[\\ufffa-\\ufffd]]", -1, US_INV), status); |
| 223 DCHECK(U_SUCCESS(status)); | 223 DCHECK(U_SUCCESS(status)); |
| 224 icu::RegexMatcher dangerous_patterns(icu::UnicodeString( | 224 icu::RegexMatcher dangerous_patterns(icu::UnicodeString( |
| 225 // Lone katakana no, so, or n | 225 // Lone katakana no, so, or n |
| 226 "[^\\p{Katakana}][\\u30ce\\u30f3\u30bd][^\\p{Katakana}]" | 226 "[^\\p{Katakana}][\\u30ce\\u30f3\\u30bd][^\\p{Katakana}]" |
| 227 // Repeating Japanese accent characters | 227 // Repeating Japanese accent characters |
| 228 "|[\\u3099\\u309a\\u309b\\u309c][\\u3099\\u309a\\u309b\\u309c]"), | 228 "|[\\u3099\\u309a\\u309b\\u309c][\\u3099\\u309a\\u309b\\u309c]"), |
| 229 0, status); | 229 0, status); |
| 230 #endif | 230 #endif |
| 231 DCHECK(U_SUCCESS(status)); | 231 DCHECK(U_SUCCESS(status)); |
| 232 icu::UnicodeSet component_characters; | 232 icu::UnicodeSet component_characters; |
| 233 icu::UnicodeString component_string(str, str_len); | 233 icu::UnicodeString component_string(str, str_len); |
| 234 component_characters.addAll(component_string); | 234 component_characters.addAll(component_string); |
| 235 if (dangerous_characters.containsSome(component_characters)) | 235 if (dangerous_characters.containsSome(component_characters)) |
| 236 return false; | 236 return false; |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 if (offset_for_adjustment) | 823 if (offset_for_adjustment) |
| 824 offsets.push_back(*offset_for_adjustment); | 824 offsets.push_back(*offset_for_adjustment); |
| 825 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, | 825 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, |
| 826 unescape_rules, new_parsed, prefix_end, &offsets); | 826 unescape_rules, new_parsed, prefix_end, &offsets); |
| 827 if (offset_for_adjustment) | 827 if (offset_for_adjustment) |
| 828 *offset_for_adjustment = offsets[0]; | 828 *offset_for_adjustment = offsets[0]; |
| 829 return result; | 829 return result; |
| 830 } | 830 } |
| 831 | 831 |
| 832 } // namespace net | 832 } // namespace net |
| OLD | NEW |