}
}
+function sanitize_input( str )
+{
+ return str.replace( /\\/g, '\\\\').replace( /\'/g, '\\\'' ).replace( /\"/g, '\\\"' ).replace( /^/, '"' ).replace( /$/, '"' );
+}
+
function update_vlm_add_broadcast()
{
var cmd = document.getElementById( 'vlm_command' );
if( value( 'vlm_broadcast_input' ) )
{
- cmd.value += " input " + value( 'vlm_broadcast_input' );
+ cmd.value += " input " + sanitize_input( value( 'vlm_broadcast_input' ) );
}
if( value( 'vlm_broadcast_output' ) )
if( value( 'vlm_vod_input' ) )
{
- cmd.value += " input " + value( 'vlm_vod_input' );
+ cmd.value += " input " + sanitize_input( value( 'vlm_vod_input' ) );
}
if( value( 'vlm_vod_output' ) )
function vlm_add_input( name, input )
{
- document.getElementById( 'vlm_command' ).value = "setup "+name+" input "+input;
+ document.getElementById( 'vlm_command' ).value = "setup "+name+" input "+sanitize_input( input );
vlm_cmd( value( 'vlm_command' ) );
}