mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
This commit is contained in:
parent
b2454888e8
commit
7ceeb74535
Notes:
sideshowbarker
2024-07-17 09:40:48 +09:00
Author: https://github.com/Dexesttp
Commit: 7ceeb74535
Pull-request: https://github.com/SerenityOS/serenity/pull/14497
Reviewed-by: https://github.com/linusg ✅
47 changed files with 108 additions and 102 deletions
|
@ -54,7 +54,7 @@ Vector<QueryParam> url_decode(StringView input)
|
|||
}
|
||||
|
||||
// 4. Replace any 0x2B (+) in name and value with 0x20 (SP).
|
||||
auto space_decoded_name = name.replace("+"sv, " "sv, true);
|
||||
auto space_decoded_name = name.replace("+"sv, " "sv, ReplaceMode::All);
|
||||
|
||||
// 5. Let nameString and valueString be the result of running UTF-8 decode without BOM on the percent-decoding of name and value, respectively.
|
||||
auto name_string = AK::URL::percent_decode(space_decoded_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue