Improved input validation.
This commit is contained in:
parent
47f94c54d6
commit
5e0ae554f9
3 changed files with 17 additions and 5 deletions
|
@ -271,8 +271,12 @@ class _taskManagerSingleton extends App.Controller
|
||||||
)
|
)
|
||||||
@allTasks = allTasks || []
|
@allTasks = allTasks || []
|
||||||
|
|
||||||
|
try
|
||||||
$('#content_permanent_' + key ).html('')
|
$('#content_permanent_' + key ).html('')
|
||||||
$('#content_permanent_' + key ).remove()
|
$('#content_permanent_' + key ).remove()
|
||||||
|
catch
|
||||||
|
@log 'notice', "invalid key '#{key}'"
|
||||||
|
|
||||||
|
|
||||||
delete @workersStarted[ key ]
|
delete @workersStarted[ key ]
|
||||||
delete @workers[ key ]
|
delete @workers[ key ]
|
||||||
|
@ -304,8 +308,11 @@ class _taskManagerSingleton extends App.Controller
|
||||||
|
|
||||||
# release tasks
|
# release tasks
|
||||||
for task in @allTasks
|
for task in @allTasks
|
||||||
|
try
|
||||||
$('#content_permanent_' + task.key ).html('')
|
$('#content_permanent_' + task.key ).html('')
|
||||||
$('#content_permanent_' + task.key ).remove()
|
$('#content_permanent_' + task.key ).remove()
|
||||||
|
catch
|
||||||
|
@log 'notice', "invalid key '#{key}'"
|
||||||
|
|
||||||
delete @workersStarted[ task.key ]
|
delete @workersStarted[ task.key ]
|
||||||
delete @workers[ task.key ]
|
delete @workers[ task.key ]
|
||||||
|
|
|
@ -193,4 +193,4 @@ class App.Utils
|
||||||
|
|
||||||
# cleanString = App.Utils.htmlAttributeCleanup( string )
|
# cleanString = App.Utils.htmlAttributeCleanup( string )
|
||||||
@htmlAttributeCleanup: (string) ->
|
@htmlAttributeCleanup: (string) ->
|
||||||
string.replace(/(\!|\s|\r|\t|,|\.|\?|"|'|\^|#)/g, '')
|
string.replace(/(\!|\s|\r|\t|,|\.|\?|"|'|\^|#|=|\(|\)|\$)/g, '')
|
||||||
|
|
|
@ -592,6 +592,11 @@ test( "check attibute validation", function() {
|
||||||
verify = App.Utils.htmlAttributeCleanup( string )
|
verify = App.Utils.htmlAttributeCleanup( string )
|
||||||
equal( verify, result, string )
|
equal( verify, result, string )
|
||||||
|
|
||||||
|
string = 'abc()=$'
|
||||||
|
result = 'abc'
|
||||||
|
verify = App.Utils.htmlAttributeCleanup( string )
|
||||||
|
equal( verify, result, string )
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue