Commit 9f037d2a authored by Mygod's avatar Mygod

Forbid usage of control characters in PluginOptions

parent 0bac32b7
......@@ -149,7 +149,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
DataStore.plugin = pluginConfiguration.toString()
DataStore.dirty = true
true
} catch (exc: IllegalArgumentException) {
} catch (exc: RuntimeException) {
(activity as MainActivity).snackbar(exc.localizedMessage).show()
false
}
......
......@@ -84,6 +84,7 @@
android:key="plugin.configure"
android:icon="@drawable/ic_action_settings"
android:persistent="false"
android:singleLine="true"
app:pref_summaryHasText="%s"
android:title="@string/plugin_configure"/>
<Preference
......
* 1.1.0:
* Having control characters in plugin options is no longer allowed.
If this breaks your plugin, you are doing it wrong.
* New helper method: `PluginOptions.putWithDefault`.
* 1.0.0:
* `PathProvider` now takes `Int` instead of `String` for file modes;
......
......@@ -38,6 +38,7 @@ class PluginOptions : HashMap<String, String?> {
@Suppress("NAME_SHADOWING")
var parseId = parseId
if (options.isNullOrEmpty()) return
check(options.all { !it.isISOControl() }) { "No control characters allowed." }
val tokenizer = StringTokenizer("$options;", "\\=;", true)
val current = StringBuilder()
var key: String? = null
......
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