Skip to content

Commit

Permalink
Fix URL encoding on Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedawson committed Jun 8, 2022
1 parent 2f43717 commit 6481e55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.github.UstadMobile.door'
version '0.0.59d'
version '0.0.59f'

ext.localProperties = new Properties()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ class SQLitePreparedStatementJs(

/**
* JS doesn't support 64 bit, so inserting a long to a web worker won't pass it,
* instead we convert it to a String and pass it to a worker and SQLite will convert
* it by default to INTEGER/REAL respectively
* Instead we use eval to turn it into a bigint.
*
* @see <a href="https://www.sqlite.org/datatype3.html">Datatypes</a>
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.ustadmobile.door.ext

import com.ustadmobile.door.util.encodeURIComponent

/**
* Encode the given string using URL encoding
*/
//url is used by js code
@Suppress("UNUSED_VARIABLE")
actual fun String.urlEncode(): String {
val url = this
return js("encodeURI(url)") as String
}
actual fun String.urlEncode() = encodeURIComponent(this)

0 comments on commit 6481e55

Please sign in to comment.