               alert("Could not get modal info")
 
       $(document).on 'click', '.silence-submit-event', ->
-        misc = $(this).attr("misc")
+        misc = escapeString($(this).attr("misc"))
         if $('#text_input_' + misc).val().length < $('#text_input_' + misc).data("min")
           alert('Comment must be at least ' + $('#text_input_' + misc).data("min") + ' characters long')
           return false

              alert(data)

      $(document).on 'click', '.unsilence-submit-event', ->
        misc = $(this).attr("misc")
        $.post $(this).attr("rel"),
          (data) ->
            if data

  $('div.modal').attr("tabindex", "-1")

  if $('#primary_events_table').length > 0

    escapeString = (str)->
      str.replace(/([ #;?&,.+*~\':"!^$[\]()=>|\/@])/g,'\\$1')

    updateEventTable = ()->
      $('#updating_event_list').show()
      $('#primary_events_table').dataTable().fnReloadAjax()
