Heyvaert / wiquery

Automatically exported from code.google.com/p/wiquery
0 stars 0 forks source link

If title contains \n dialog wont open #263

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set a dialogs title to a string that contains \n (maybe other 
illegal/non-printable characters too)
2. Try to open it
3. The dialog doesnt open, nothing happens.

What is the expected output?
The dialog should open.

What version of the product are you using? On what operating system?
version 1.2.5 . The bug is OS independent as far as I can tell

FYI https://en.wikipedia.org/wiki/Control_character

I previously reported a similar bug that was aimed at HTML-reserved characters 
such as ' (see issue 240 https://code.google.com/p/wiquery/issues/detail?id=240)

That bug was fixed quickly, which was much appreciated! Keep up the great work.

Original issue reported on code.google.com by fre.and....@gmail.com on 27 Nov 2012 at 5:07

GoogleCodeExporter commented 9 years ago
The reason this happens is because in the javascript the \n is printed as a 
rowbreak inside a string, thus breaking the javascript.

Original comment by saik...@gmail.com on 17 Dec 2012 at 11:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
For anyone else who has this problem and is looking for a solution, we made a 
utility class with a method that cleans strings from characters which causes 
problems in AJAX contexts.

    public static String cleanString(String string){
        if (string==null || string.equals(null) || string.isEmpty()){
            return "";
        } else {
            String clean = string;
            clean = clean.replaceAll("\\p{C}|\\p{Cf}|\n|\t|\f|\n", "?");
            return clean;
        }
    }

Original comment by fre.and....@gmail.com on 15 Jan 2013 at 1:43

GoogleCodeExporter commented 9 years ago
The issue was either
-not reproducable
-there is a newer version available
-reported in a version which is no longer supported

if the issue is still present in the latest version (6.9+) then please reopen 
the issue with the required information to reproduce the issue.

Original comment by hielke.hoeve on 26 Nov 2013 at 8:37