mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-04-04 19:58:49 +02:00
Allowing only alphanumerical characters, dash and underscore when autogenerating a folder name
This commit is contained in:
@@ -27,7 +27,7 @@ $(function(){
|
||||
})
|
||||
$('input[name="title"]').on('input', function(e){
|
||||
if (!$('input[name="folder"]').data('user-custom-folder')) {
|
||||
folder = $(this).val().toLowerCase().replace(/\s/g, '-');
|
||||
folder = $(this).val().toLowerCase().replace(/\s/g, '-').replace(/[^a-z0-9_\-]/g, '');
|
||||
$('input[name="folder"]').val(folder);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user