marklieberman / downloadstar

Download all items in a webpage that match a pattern
GNU General Public License v3.0
90 stars 16 forks source link

Naming Mask Strings passed through Filters are Pre-Sanitized #58

Closed MegaScience closed 5 years ago

MegaScience commented 6 years ago

Filters are only processed after the string being operated on has been filename-sanitized. This is a problem when trying to do Filter operations, as sanitized characters may be the only identifiers.

For instance, I was attempting to use the pathname, breaking it by the / marks and taking each part to form unique filenames, similar to this: ${tabUrl[pathname]|replace:/\/([^\/]+)\/[^\/]+\/([^\/]+)$/:$2-$1} However, as the string is pre-sanitized, the separators are missing, and the string is just one blob of text in the format of [a-zA-Z0-9-]+. Ideally, sanitizing should take place post-filtering, so potentially sanitize-able landmarks are retained for the filter process.