Edgewall Software

Changes between Initial Version and Version 1 of Ticket #10877


Ignore:
Timestamp:
Sep 30, 2012, 10:10:21 AM (9 years ago)
Author:
Christian Boos
Comment:

Damn, you're right, we've made a blunder here.

  • trac/util/text.py

     
    114114    (conform to the JSON spec)
    115115    """
    116116    if not text:
    117         return ''
     117        return '""'
    118118    def replace(match):
    119119        return _js_quote[match.group(0)]
    120120    return '"%s"' % _js_string_re.sub(replace, text)
  • trac/util/tests/text.py

     
    7777                         to_js_string('\x02\x1e'))
    7878        self.assertEqual(r'"\u0026\u003c\u003e"',
    7979                         to_js_string('&<>'))
     80        self.assertEqual('""',
     81                         to_js_string(''))
     82        self.assertEqual('""',
     83                         to_js_string(None))
    8084
    8185
    8286class UnicodeQuoteTestCase(unittest.TestCase):

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10877

    • Property Keywords javascript to_js_string added
    • Property Owner set to Christian Boos
    • Property Severity normalmajor
  • Ticket #10877 – Description

    initial v1  
    1313I wonder if this bug is related to the version of python (2.4.3) I am running, and is similar in scope to #10771.
    1414
     15{{{#!diff
     16--- 2.6/json.txt   Sun Sep 30 09:46:14 2012
     17+++ 2.4/json.txt Sun Sep 30 09:46:04 2012
     18@@ -1 +1 @@
     19-var modes={"id":[{"name":"is","value":""},{"name":"is not","value":"!"}],"select":[{"name":"is","value":""},{"name":"is not","value":"!"}],"text":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"},{"name":"begins with","value":"^"},{"name":"ends with","value":"$"},{"name":"is","value":""},{"name":"is not","value":"!"}],"textarea":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"}]};
     20+var modes={"id":[{"name":"is","value":},{"name":"is not","value":"!"}],"select":[{"name":"is","value":},{"name":"is not","value":"!"}],"text":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"},{"name":"begins with","value":"^"},{"name":"ends with","value":"$"},{"name":"is","value":},{"name":"is not","value":"!"}],"textarea":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"}]};
     21}}}