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:
Robert Gaggl 2003-02-04 12:18:20 +00:00
parent 6e2e859d28
commit 6b4665cf38

View file

@ -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