mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-27 11:19:30 +02:00
Fix:Sanitize new podcast folder names and ensure feedUrl is in feed metadata #589
This commit is contained in:
parent
578a946ca5
commit
113026ce13
4 changed files with 17 additions and 5 deletions
|
@ -114,10 +114,11 @@ Vue.prototype.$calculateTextSize = (text, styles = {}) => {
|
|||
}
|
||||
}
|
||||
|
||||
Vue.prototype.$sanitizeFilename = (input, replacement = '') => {
|
||||
Vue.prototype.$sanitizeFilename = (input, colonReplacement = ' - ') => {
|
||||
if (typeof input !== 'string') {
|
||||
return false
|
||||
}
|
||||
var replacement = ''
|
||||
var illegalRe = /[\/\?<>\\:\*\|"]/g;
|
||||
var controlRe = /[\x00-\x1f\x80-\x9f]/g;
|
||||
var reservedRe = /^\.+$/;
|
||||
|
@ -125,6 +126,7 @@ Vue.prototype.$sanitizeFilename = (input, replacement = '') => {
|
|||
var windowsTrailingRe = /[\. ]+$/;
|
||||
|
||||
var sanitized = input
|
||||
.replace(':', colonReplacement) // Replace first occurrence of a colon
|
||||
.replace(illegalRe, replacement)
|
||||
.replace(controlRe, replacement)
|
||||
.replace(reservedRe, replacement)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue