Skip to content

Commit 791339b

Browse files
authored
Merge pull request Expensify#65836 from bernhardoj/fix/65709-crashes-when-use-emoij-on-tax-code
Fix app crashes when using emoji as tax code
2 parents af8418a + e7fde40 commit 791339b

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@react-navigation/core/lib/module/getPathFromState.js b/node_modules/@react-navigation/core/lib/module/getPathFromState.js
2+
index 0d1ca6a..5c9d316 100644
3+
--- a/node_modules/@react-navigation/core/lib/module/getPathFromState.js
4+
+++ b/node_modules/@react-navigation/core/lib/module/getPathFromState.js
5+
@@ -156,7 +156,7 @@ export function getPathFromState(state, options) {
6+
7+
// Valid characters according to
8+
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 (see pchar definition)
9+
- return String(value).replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g, char => encodeURIComponent(char));
10+
+ return Array.from(value).map(char => /[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g.test(char) ? encodeURIComponent(char) : char).join('');
11+
}
12+
return encodeURIComponent(segment);
13+
}).join('/');

patches/react-navigation/details.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
- PR Introducing Patch: [#37891](https://github.com/Expensify/App/pull/37891)
2424
- PR Updating Patch: [#64155](https://github.com/Expensify/App/pull/64155)
2525

26+
### [@react-navigation+core+7.10.0+002+fix-crash-when-parsing-emoji.patch](@react-navigation+core+7.10.0+002+fix-crash-when-parsing-emoji.patch)
27+
28+
- Reason: App crashes when the path contains emoji
29+
- Upstream PR/issue: https://www.github.com/react-navigation/react-navigation/pull/12679
30+
- E/App issue: [#65709](https://github.com/Expensify/App/issues/65709)
31+
- PR Introducing Patch: [#65836](https://github.com/Expensify/App/pull/65836)
32+
- PR Updating Patch: N/A
33+
2634
### [@react-navigation+native-stack+7.3.14+001+added-interaction-manager-integration.patch](@react-navigation+native-stack+7.3.14+001+added-interaction-manager-integration.patch)
2735

2836
- Reason: Adds `InteractionManager` implementation to `@react-navigation/native-stack`

0 commit comments

Comments
 (0)