jwong-d2l / sessionweb

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

Percent sign (%) breaks in sessionweb #118

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Type a % sign into the Notes section. (probably also in the charter section)
2. Save the session.
3. Go back to the list of sessions.
4. Re-enter the session.

What is the expected output? What do you see instead?
Specifically, this is the affected line, pre-saving and re-entering:

where recorded_on like '2012-08%'

And what I see afterward is:
where recorded_on like '2012-0839;

I noticed the percent sign also breaks the [strong][/strong] HTML tag, so that 
if you type a % sign inside something that's bold, everything that follows what 
used to be the % sign is then made bold.

What version of the product are you using? On what operating system?
Sessionweb ver 21

Please provide any additional information below.

Original issue reported on code.google.com by ben.fari...@vmturbo.com on 24 Sep 2012 at 1:31

GoogleCodeExporter commented 8 years ago
Bug reproduced.
Will look into it.

Original comment by mcyr...@gmail.com on 24 Sep 2012 at 1:36

GoogleCodeExporter commented 8 years ago
Reason for this behavior is that we do a urlDecode in sessionwebjquery-20.js.

To have temporary workaround replace the URLDecode function in the 
js/sessionwebjquery-20.js. file with  
URLDecode:function (s) {

/*
        var o = s;
        var binVal, t;
        var r = /(%[^%]{2})/;

        while ((m = r.exec(o)) != null && m.length > 1 && m[1] != '') {
            b = parseInt(m[1].substr(1), 16);
            t = String.fromCharCode(b);
            o = o.replace(m[1], t);
        }
        return o;
*/

    }

This will however break the possibility to use XML syntax in the notes since 
they need to be escaped due to chkeditor limitations...

Original comment by mcyr...@gmail.com on 24 Sep 2012 at 3:26

GoogleCodeExporter commented 8 years ago
This will be fixed in the next version of edit session page.

Original comment by mcyr...@gmail.com on 24 Sep 2012 at 8:29

GoogleCodeExporter commented 8 years ago
Excellent. Thanks for the quick fix, and for the temporary work-around!

Original comment by ben.fari...@vmturbo.com on 24 Sep 2012 at 8:32

GoogleCodeExporter commented 8 years ago
Quick question though. For the temporary fix, should the end comment (*/) be 
placed BEFORE the return 0; line? Or is the output of URLDecode() never 
actually used so it doesn't matter?

Original comment by ben.fari...@vmturbo.com on 24 Sep 2012 at 8:35

GoogleCodeExporter commented 8 years ago
Correct version..

URLDecode:function (s) {

/*
        var o = s;
        var binVal, t;
        var r = /(%[^%]{2})/;

        while ((m = r.exec(o)) != null && m.length > 1 && m[1] != '') {
            b = parseInt(m[1].substr(1), 16);
            t = String.fromCharCode(b);
            o = o.replace(m[1], t);
        }
        return o;
*/
        return s;

    }

Original comment by mcyr...@gmail.com on 25 Sep 2012 at 7:13

GoogleCodeExporter commented 8 years ago
This bug is corrected in the new editor page.

Original comment by mcyr...@gmail.com on 22 Apr 2013 at 7:04