Commit e2c5007 1 parent baa1000 commit e2c5007 Copy full SHA for e2c5007
File tree 3 files changed +1
-37
lines changed
main/java/at/bitfire/icsdroid
test/kotlin/at/bitfire/icsdroid
3 files changed +1
-37
lines changed Original file line number Diff line number Diff line change @@ -32,25 +32,4 @@ object UriUtils {
32
32
33
33
return false
34
34
}
35
-
36
- /* *
37
- * Strips the URL from a string. For example, the following string:
38
- * ```
39
- * "This is a URL: https://example.com"
40
- * ```
41
- * will return:
42
- * ```
43
- * "https://example.com"
44
- * ```
45
- * _Quotes are not included_
46
- * @return The URL found in the string
47
- * @throws IllegalArgumentException if no URL is found in the string
48
- */
49
- fun String.stripUrl (): String? {
50
- // schema host port path query
51
- return (" ([a-zA-Z]+://)" + " ([\\ w\\ -.]+)" + " (:\\ d+)?" + " ([\\ w\\ -./]+)?" + " (\\ ?[\\ w.&=*]*)?" )
52
- .toRegex()
53
- .find(this )
54
- ?.value
55
- }
56
35
}
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import androidx.compose.ui.platform.LocalContext
21
21
import androidx.core.view.WindowCompat
22
22
import at.bitfire.icsdroid.HttpClient
23
23
import at.bitfire.icsdroid.R
24
- import at.bitfire.icsdroid.UriUtils.stripUrl
25
24
import at.bitfire.icsdroid.calendar.LocalCalendar
26
25
import at.bitfire.icsdroid.model.CreateSubscriptionModel
27
26
import at.bitfire.icsdroid.model.CredentialsModel
@@ -88,7 +87,7 @@ class AddCalendarActivity : AppCompatActivity() {
88
87
try {
89
88
(data ? : getStringExtra(Intent .EXTRA_TEXT ))
90
89
?.toString()
91
- ?.stripUrl ()
90
+ ?.trim ()
92
91
?.let (subscriptionSettingsModel::setUrl)
93
92
?.also {
94
93
createSubscriptionModel.checkUrlIntroductionPage(
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments