Commit 48c64fc8 authored by Ricki Hirner's avatar Ricki Hirner

Update ez-vcard, allow null arguments for toURIScheme

parent f8bf656f
Pipeline #10829626 passed with stage
in 2 minutes and 22 seconds
......@@ -54,7 +54,7 @@ dependencies {
compile 'commons-io:commons-io:2.5'
// ez-vcard to parse/generate VCards
compile('com.googlecode.ez-vcard:ez-vcard:0.10.2') {
compile('com.googlecode.ez-vcard:ez-vcard:0.10.3') {
// hCard functionality not needed
exclude group: 'org.jsoup'
exclude group: 'org.freemarker'
......
......@@ -69,12 +69,12 @@ open class AndroidContact(
}
@JvmStatic
protected fun toURIScheme(s: String) =
protected fun toURIScheme(s: String?) =
// RFC 3986 3.1
// scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
// ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
// DIGIT = %x30-39 ; 0-9
s.replace(Regex("^[^a-zA-Z]+"), "").replace(Regex("[^\\da-zA-Z+-.]"), "")
s?.replace(Regex("^[^a-zA-Z]+"), "")?.replace(Regex("[^\\da-zA-Z+-.]"), "")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment