fesplugas/typus — pull request #390 by karolsarnacki (2012-09-18 16:51:19+00:00)
Title: Escape JavaScript on item label when dynamically adding new options to Select fields

This fixes a bug with item labels containing html-unsafe characters (like `&` or `<`) are dynamically added to existing Select Options from within Popup.

Without this fix, after adding new associated item using Popup, the newly added label would be html-escaped and displayed like `A & B => C`.

This fixes this so that new options are properly escaped in JavaScript and displayed like `A & B => C`. Also, we use `javascript_tag` here to enclose whole script in CDATA section to improve security.