Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,11 @@ private fun getFontResId(
return defaultValue
}

val fontFileName =
bundle.getString(key)
?: throw PaymentSheetAppearanceException(
"$fontErrorPrefix expected String for font.$key, but received null.",
)
if (Regex("[^a-z0-9]").containsMatchIn(fontFileName)) {
val fontFileName = bundle.getString(key)
?: throw PaymentSheetAppearanceException("$fontErrorPrefix expected String for font.$key, but received null.")
if (Regex("[^a-z0-9_]").containsMatchIn(fontFileName)) {
throw PaymentSheetAppearanceException(
"$fontErrorPrefix appearance.font.$key should only contain lowercase alphanumeric characters on Android, but received '$fontFileName'. This value must match the filename in android/app/src/main/res/font",
"$fontErrorPrefix appearance.font.$key should only contain lowercase alphanumeric characters and underscores on Android, but received '$fontFileName'. This value must match the filename in android/app/src/main/res/font"
)
}

Expand Down
Loading