Add a test for invalid characters in Path for Ffmpeg monitors
This commit is contained in:
parent
4f4a1a4565
commit
24d9bfa257
|
@ -178,6 +178,7 @@ $SLANG = array(
|
|||
'BadColours' => 'Target colour must be set to a valid value',
|
||||
'BadPassthrough' => 'Passthrough only works with ffmpeg type monitors.',
|
||||
'BadPath' => 'Path must be set to a valid value',
|
||||
'BadPathNotEncoded' => 'Path must be set to a valid value. We have detected invalid characters that may need to be url encoded.',
|
||||
'BadPort' => 'Port must be set to a valid number',
|
||||
'BadPostEventCount' => 'Post event image count must be an integer of zero or more',
|
||||
'BadPreEventCount' => 'Pre event image count must be at least zero, and less than image buffer size',
|
||||
|
|
|
@ -72,9 +72,13 @@ function validateForm( form ) {
|
|||
if ( form.elements['newMonitor[VideoWriter]'].value == 2 /* Passthrough */ )
|
||||
errors[errors.length] = "<?php echo translate('BadPassthrough') ?>";
|
||||
} else if ( form.elements['newMonitor[Type]'].value == 'Ffmpeg' ) {
|
||||
if ( !form.elements['newMonitor[Path]'].value )
|
||||
//|| !form.elements['newMonitor[Path]'].value.match( /^\d+$/ ) ) // valid url
|
||||
if ( !form.elements['newMonitor[Path]'].value ) {
|
||||
errors[errors.length] = "<?php echo translate('BadPath') ?>";
|
||||
} else if ( form.elements['newMonitor[Path]'].value.match( /[\!\*'\(\)\$ ,#\[\]]/) ) {
|
||||
errors[errors.length] = "<?php echo translate('BadPathNotEncoded') ?>";
|
||||
} else {
|
||||
console.log("valid" + form.elements['newMonitor[Path]'].value);
|
||||
}
|
||||
|
||||
} else if ( form.elements['newMonitor[Type]'].value == 'File' ) {
|
||||
if ( !form.elements['newMonitor[Path]'].value )
|
||||
|
|
Loading…
Reference in New Issue