added function isCleanForName() which is needed for checking image- and file-aliases for invalid characters. allowed are a-zA-Z0-9.-_space. the former used function isClean() is a bit restrictive for that, on the other hand umlauts etc. lead to problems.
This commit is contained in:
parent
6e2e859d28
commit
6b4665cf38
1 changed files with 12 additions and 0 deletions
|
@ -54,6 +54,18 @@ function isCleanForURL(str) {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function checks if the string passed contains any characters that
|
||||
* are forbidden in image- or filenames
|
||||
*/
|
||||
|
||||
function isCleanForName(str) {
|
||||
var invalidChar = new RegExp("[^a-zA-Z0-9\\.\\-_ ]");
|
||||
if (invalidChar.exec(str))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function checks if there is a site-object in path
|
||||
* if true, it returns it
|
||||
|
|
Loading…
Add table
Reference in a new issue