0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00

skip fully empty query parameters

note that strings like '?=&' will be skipped too.
and also strings like '?abc' will be converted to '?abc='

fixing these examples will require to implement a custom query parsing logic (or use the original from the query remover module)

fixes #244
This commit is contained in:
TrianguloY 2023-06-18 18:39:06 +02:00
parent a2a19ed13b
commit 38f01db127
2 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,8 @@ class UriPartsDialog extends AModuleDialog {
if (value == null) return;
var part = Inflater.inflate(R.layout.uri_part, container);
part.<TextView>findViewById(R.id.key).setText(name);
part.<TextView>findViewById(R.id.key)
.setText(name.isEmpty() ? getActivity().getString(R.string.mParts_empty) : name);
var value_view = part.<TextView>findViewById(R.id.value);
value_view.setText(value);
AndroidUtils.setAsClickable(value_view);
@ -192,6 +193,7 @@ class UriPartsDialog extends AModuleDialog {
var queries = new ArrayList<Pair<String, String>>();
for (var name : uri.getQueryParameterNames()) {
for (var value : uri.getQueryParameters(name)) {
if (name.isEmpty() && value.isEmpty()) continue; // skip fully empty entries
queries.add(Pair.create(name, value));
}
}

View File

@ -322,4 +322,5 @@ With the button below you can edit the default state and the visibility of the f
By clicking a part it will be set as the new url, useful for example if one of the queries or paths was an encoded redirection url.
You can also click the 'X' button to remove some of them.
This is an advanced version of the 'Queries Remover' module."</string>
<string name="mParts_empty">(empty)</string>
</resources>