From bbdb1653a63cdfaf48230d84c6dd3fab2e5ade29 Mon Sep 17 00:00:00 2001 From: Sergei <488252+sergeich@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:43:26 +0000 Subject: [PATCH] [Android] Fix possible bug in source scheme validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `lowercase(Locale.getDefault()) can produce wrong result in Turkish locale. E.g. `"FILE".lowercase(Locale.forLanguageTag("TR"))` will result in string `fıle`. Note the "ı" character. `lowercase()` without params uses `Locale.ROOT` which produces expected result --- android/src/main/java/com/brentvatne/common/api/Source.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/java/com/brentvatne/common/api/Source.kt b/android/src/main/java/com/brentvatne/common/api/Source.kt index ef807e5458..de054e6ae0 100644 --- a/android/src/main/java/com/brentvatne/common/api/Source.kt +++ b/android/src/main/java/com/brentvatne/common/api/Source.kt @@ -16,7 +16,6 @@ import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetMap import com.brentvatne.common.toolbox.ReactBridgeUtils.safeGetString import com.brentvatne.react.BuildConfig import com.facebook.react.bridge.ReadableMap -import java.util.Locale import java.util.Objects /** @@ -273,7 +272,7 @@ class Source { if (scheme == null) { return false } - val lowerCaseUri = scheme.lowercase(Locale.getDefault()) + val lowerCaseUri = scheme.lowercase() return ( lowerCaseUri == "http" || lowerCaseUri == "https" ||