OpenLayers OpenLayers

Changeset 6801

Show
Ignore:
Timestamp:
04/07/08 00:22:35 (9 months ago)
Author:
crschmidt
Message:

Replace the regular expression used in Format.JSON with one which is longer,
but apparently more friendly to braindead browsers. This allows Safari 3.1
to parse long JSON strings (>26k), which was not possible with the previous
regex. r=euzuro (Pullup #1493)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Format/JSON.js

    r6430 r6801  
    9696         */ 
    9797        try { 
    98             if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/. 
    99                     test(json)) { 
     98            if (/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g, '@'). 
     99                                replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). 
     100                                replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { 
    100101 
    101102                /**