mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix invalid scene queue generated link (#1425)
* Escape quotes in criterion label JSON encoding and slicing off the encompassing JSON-string quotes seems like a safer option * Wrap criterion parse in try/catch to prevent the page from crashing
This commit is contained in:
@@ -5,11 +5,12 @@
|
|||||||
* Added [DLNA server](/settings?tab=dlna). ([#1364](https://github.com/stashapp/stash/pull/1364))
|
* Added [DLNA server](/settings?tab=dlna). ([#1364](https://github.com/stashapp/stash/pull/1364))
|
||||||
|
|
||||||
### 🎨 Improvements
|
### 🎨 Improvements
|
||||||
* Add `CreatedAt` and `UpdatedAt` (and `FileModTime` where applicable) to API objects.
|
* Add `CreatedAt` and `UpdatedAt` (and `FileModTime` where applicable) to API objects. ([#1421](https://github.com/stashapp/stash/pull/1421))
|
||||||
* Add Studios Performer filter criterion. ([#1405](https://github.com/stashapp/stash/pull/1405))
|
* Add Studios Performer filter criterion. ([#1405](https://github.com/stashapp/stash/pull/1405))
|
||||||
* Add `subtractDays` post-process scraper action. ([#1399](https://github.com/stashapp/stash/pull/1399))
|
* Add `subtractDays` post-process scraper action. ([#1399](https://github.com/stashapp/stash/pull/1399))
|
||||||
* Skip scanning directories if path matches image and video exclude patterns. ([#1382](https://github.com/stashapp/stash/pull/1382))
|
* Skip scanning directories if path matches image and video exclude patterns. ([#1382](https://github.com/stashapp/stash/pull/1382))
|
||||||
* Add button to remove studio stash ID. ([#1378](https://github.com/stashapp/stash/pull/1378))
|
* Add button to remove studio stash ID. ([#1378](https://github.com/stashapp/stash/pull/1378))
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
* Fix quotes in filter labels causing UI errors. ([#1425](https://github.com/stashapp/stash/pull/1425))
|
||||||
* Fix post-processing not running when scraping by performer fragment. ([#1387](https://github.com/stashapp/stash/pull/1387))
|
* Fix post-processing not running when scraping by performer fragment. ([#1387](https://github.com/stashapp/stash/pull/1387))
|
||||||
|
|||||||
@@ -425,13 +425,18 @@ export class ListFilterModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jsonParameters.forEach((jsonString) => {
|
jsonParameters.forEach((jsonString) => {
|
||||||
const encodedCriterion = JSON.parse(jsonString);
|
try {
|
||||||
const criterion = makeCriteria(encodedCriterion.type);
|
const encodedCriterion = JSON.parse(jsonString);
|
||||||
// it's possible that we have unsupported criteria. Just skip if so.
|
const criterion = makeCriteria(encodedCriterion.type);
|
||||||
if (criterion) {
|
// it's possible that we have unsupported criteria. Just skip if so.
|
||||||
criterion.value = encodedCriterion.value;
|
if (criterion) {
|
||||||
criterion.modifier = encodedCriterion.modifier;
|
criterion.value = encodedCriterion.value;
|
||||||
this.criteria.push(criterion);
|
criterion.modifier = encodedCriterion.modifier;
|
||||||
|
this.criteria.push(criterion);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error("Failed to parse encoded criterion:", err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ export interface ILabeledValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function encodeILabeledId(o: ILabeledId) {
|
export function encodeILabeledId(o: ILabeledId) {
|
||||||
// escape \ to \\ so that it encodes to JSON correctly
|
// escape " and \ and by encoding to JSON so that it encodes to JSON correctly down the line
|
||||||
const adjustedLabel = o.label.replaceAll("\\", "\\\\");
|
const adjustedLabel = JSON.stringify(o.label).slice(1, -1);
|
||||||
return { ...o, label: encodeURIComponent(adjustedLabel) };
|
return { ...o, label: encodeURIComponent(adjustedLabel) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user