Project

General

Profile

Actions

Bug #5698

closed

WSlider under some locales sends invalid JavaScript to client

Added by Jan Lindemann over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
Target version:
-
Start date:
05/07/2017
Due date:
% Done:

0%

Estimated time:

Description

sprintf(buf, "%g", 1.234) will put a comma into buf if the locale it runs under dictates that. If buf subsequently ends up on the client as JavaScript code, that code will throw a syntax error, as does the code generated by WSlider.C. See the attached patch for a possible fix.


Files

fix-locale-breaks-javascript.patch (485 Bytes) fix-locale-breaks-javascript.patch Jan Lindemann, 05/07/2017 03:10 PM
Actions #1

Updated by Roel Standaert over 7 years ago

  • Status changed from New to InProgress
  • Assignee set to Michiel Derhaeg

WSlider.C should actually use Utils::round_js_str() (see WPointF::jsValue() for an example). Caution: don't use multiple calls to Utils::round_js_str() using the same buffer in one statement. End the statement after every call to Utils::round_js_str() instead.

Actions #2

Updated by Roel Standaert over 7 years ago

  • Assignee changed from Michiel Derhaeg to Roel Standaert
Actions #3

Updated by Roel Standaert over 7 years ago

  • Status changed from InProgress to Implemented @Emweb
Actions #4

Updated by Roel Standaert over 7 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #5

Updated by Roel Standaert over 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF