Project

General

Profile

Bug #5698

WSlider under some locales sends invalid JavaScript to client

Added by Jan Lindemann over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
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
#1

Updated by Roel Standaert over 5 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.

#2

Updated by Roel Standaert over 5 years ago

  • Assignee changed from Michiel Derhaeg to Roel Standaert
#3

Updated by Roel Standaert over 5 years ago

  • Status changed from InProgress to Implemented @Emweb
#4

Updated by Roel Standaert over 5 years ago

  • Status changed from Implemented @Emweb to Resolved
#5

Updated by Roel Standaert about 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF