Opened 6 years ago

#15618 new defect

jabber_x_data_ok_cb does not treat \r as a newline in a multiline text field

Reported by: xnyhps Owned by: deryni
Milestone: Component: XMPP
Version: 2.10.7 Keywords: dataforms xep-0004
Cc: darkrain



Data provided for fields of type "text-multi" SHOULD NOT contain any newlines (the \n and \r characters). Instead, the application SHOULD split the data into multiple strings (based on the newlines inserted by the platform), then specify each string as the XML character data of a distinct <value/> element

However, jabber_x_data_ok_cb splits on "\n" and completely ignores \r. In my opinion, it should split on \r\n, \r and \n (the last two only if they don't occur in the first, of course).

Attached is a patch which replaces "\r\n" with "\n" and '\r' with '\n' (in that order) before splitting.

Attachments (1)

striplineendings.patch (1.3 KB) - added by xnyhps 6 years ago.

Download all attachments as: .zip

Change History (1)

Changed 6 years ago by xnyhps

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!