Fixes poll option issues
authorMatthias Schmidt <gravatronics@live.com>
Sun, 4 Aug 2013 12:47:19 +0000 (14:47 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 4 Aug 2013 12:47:19 +0000 (14:47 +0200)
com.woltlab.wcf/templates/__messageFormPoll.tpl
wcfsetup/install/files/js/WCF.Poll.js

index 8c808770d3cd0ec74201afca47eb971444e5f671..d012ddbbbeacba5672328641207b78b60a7b8620 100644 (file)
@@ -8,7 +8,7 @@
                                'wcf.poll.button.removeOption': '{lang}wcf.poll.button.removeOption{/lang}'
                        });
                        
-                       new WCF.Poll.Management('pollOptionContainer', [ {implode from=$pollOptions item=pollOption}{ optionID: {@$pollOption[optionID]}, optionValue: '{$pollOption[optionValue]}' }{/implode} ], {@POLL_MAX_OPTIONS});
+                       new WCF.Poll.Management('pollOptionContainer', [ {implode from=$pollOptions item=pollOption}{ optionID: {@$pollOption[optionID]}, optionValue: '{$pollOption[optionValue]|encodeJS}' }{/implode} ], {@POLL_MAX_OPTIONS});
                });
                //]]>
        </script>
index 14d2983ef3aee4d098f253d1046c6a53ecc46012..9ee763ae3a1c66ec7f89914cee9124c729cb9480 100644 (file)
@@ -226,7 +226,7 @@ WCF.Poll.Management = Class.extend({
                        
                        for (var $i = 0, $length = $options.length; $i < $length; $i++) {
                                var $option = $options[$i];
-                               $('<input type="hidden" name="pollOptions[' + $i + ']" value="' + $option.optionID + '_' + $option.optionValue + '" />').appendTo($formSubmit);
+                               $('<input type="hidden" name="pollOptions[' + $i + ']" />').val($option.optionID + '_' + $option.optionValue).appendTo($formSubmit);
                        }
                }
        }