SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Special characters in preview causes no body

Open sicommnend opened this issue 10 years ago • 3 comments

Relevant topic http://www.simplemachines.org/community/index.php?topic=544332.0

Preview code // Handle the WYSIWYG editor. if (textFields[i] == 'message' && $("#message").data("sceditor") != undefined) x[x.length] = textFields[i] + '=' + $("#message").data("sceditor").getText().replace(/&#/g, '&#').php_to8bit().php_urlencode(); else x[x.length] = textFields[i] + '=' + document.forms.postmodify[textFields[i]].value.replace(/&#/g, '&#').php_to8bit().php_urlencode(); }

Some special characters cause the preview to quit working. I noticed this in 2.0.11, didn't think the same JS routine would be in 2.1.

Form data subject:Test message:(unable to decode value) icon:xx topic:0 topic:0

screenshot from 2016-05-16 16 43 10

sicommnend avatar May 16 '16 22:05 sicommnend

The editor in 2.1 is completely different (we're using SCEditor rather than our own), so this likely won't affect 2.1

Oldiesmann avatar May 18 '16 16:05 Oldiesmann

The Preview JavaScript calls are still the same in 2.1 as they where in 2.0. I have already tested this in 2.1 and it is affected. I wouldn't make a report if it wasn't. ;)

sicommnend avatar May 19 '16 00:05 sicommnend

I'll submit a commit tomorrow.

sicommnend avatar May 19 '16 04:05 sicommnend