mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Reverse the '&' and '+' replacement done on StringCriterion Decodes special characters in IHierarchicalLabeledIdCriterion
This commit is contained in:
@@ -206,7 +206,10 @@ export function createStringCriterionOption(
|
|||||||
|
|
||||||
export class StringCriterion extends Criterion<string> {
|
export class StringCriterion extends Criterion<string> {
|
||||||
public getLabelValue() {
|
public getLabelValue() {
|
||||||
return this.value;
|
let ret = this.value;
|
||||||
|
ret = StringCriterion.unreplaceSpecialCharacter(ret, "&");
|
||||||
|
ret = StringCriterion.unreplaceSpecialCharacter(ret, "+");
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public encodeValue() {
|
public encodeValue() {
|
||||||
@@ -221,6 +224,10 @@ export class StringCriterion extends Criterion<string> {
|
|||||||
return str.replaceAll(c, encodeURIComponent(c));
|
return str.replaceAll(c, encodeURIComponent(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static unreplaceSpecialCharacter(str: string, c: string) {
|
||||||
|
return str.replaceAll(encodeURIComponent(c), c);
|
||||||
|
}
|
||||||
|
|
||||||
constructor(type: CriterionOption) {
|
constructor(type: CriterionOption) {
|
||||||
super(type, "");
|
super(type, "");
|
||||||
}
|
}
|
||||||
@@ -435,7 +442,9 @@ export class IHierarchicalLabeledIdCriterion extends Criterion<IHierarchicalLabe
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getLabelValue(): string {
|
public getLabelValue(): string {
|
||||||
const labels = (this.value.items ?? []).map((v) => v.label).join(", ");
|
const labels = decodeURI(
|
||||||
|
(this.value.items ?? []).map((v) => v.label).join(", ")
|
||||||
|
);
|
||||||
|
|
||||||
if (this.value.depth === 0) {
|
if (this.value.depth === 0) {
|
||||||
return labels;
|
return labels;
|
||||||
|
|||||||
Reference in New Issue
Block a user