Sanitize filename before renaming Fixes #3982
| @@ -36,7 +36,7 @@ import { | ||
| 36 | 36 | textgenerationwebui_presets, |
| 37 | 37 | textgenerationwebui_settings as textgen_settings, |
| 38 | 38 | } from './textgen-settings.js'; |
| 39 | 39 | import { download, equalsIgnoreCaseAndAccents, getSanitizedFilename, parseJsonFile, waitUntilCondition } from './utils.js'; |
| 40 | 40 | import { t } from './i18n.js'; |
| 41 | 41 | import { reasoning_templates } from './reasoning.js'; |
| 42 | 42 | |
| @@ -891,7 +891,7 @@ export async function initPresetManager() { | ||
| 891 | 891 | |
| 892 | 892 | const popupHeader = !presetManager.isAdvancedFormatting() ? t`Rename preset` : t`Rename template`; |
| 893 | 893 | const oldName = presetManager.getSelectedPresetName(); |
| 894 | 894 | const newName = await getSanitizedFilename(await Popup.show.input(popupHeader, t`Enter a new name:`, oldName) || ''); |
| 895 | 895 | if (!newName || oldName === newName) { |
| 896 | 896 | console.debug(!presetManager.isAdvancedFormatting() ? 'Preset rename cancelled' : 'Template rename cancelled'); |
| 897 | 897 | return; |