diff options
-rw-r--r-- | itjs.php | 2 | ||||
-rw-r--r-- | itjs/boot.js | 10 |
2 files changed, 6 insertions, 6 deletions
@@ -70,7 +70,7 @@ if ($checksum != $_SERVER['HTTP_IF_NONE_MATCH']) if ($_REQUEST['boot']) { $data .= "window.it_boot_init();\n"; - $data .= sprintf("/*sln:% 8d*/", strlen($data) + 16); + $data = sprintf("/*sln:%d*/\n%s/*eln:%d*/", strlen($data), $data, strlen($data)); } echo it_untaint($data); diff --git a/itjs/boot.js b/itjs/boot.js index 0d9a737..6ee8845 100644 --- a/itjs/boot.js +++ b/itjs/boot.js @@ -197,20 +197,20 @@ function it_boot(file, isretry) if (loader.status < 400) // Opera gives back 304 if from cache { // check length cookie - var ln = String(loader.responseText).substr(-16).match(/\*sln:\s*([0-9]+)\*/); - code = loader.responseText; - if (ln && ln[1]-0 == loader.responseText.length) + var ln = String(loader.responseText).match(/\*sln:([0-9]+)[^\n]*\n([\s\S]*\n)\/\*eln:\1/); + code = ln ? ln[2] : loader.responseText; + if (ln && ln[1]-0 == code.length) { it_boot.sequence += "e"; if (!window.env || !!window.env.is_live_server) - code = "try {" + loader.responseText + "} catch (e) { it_catcherr(e.message, it_boot.file, -1); }"; // Wrapped in try/catch as Konqueror does not support window.onerror + code = "try {" + code + "} catch (e) { it_catcherr(e.message, it_boot.file, -1); }"; // Wrapped in try/catch as Konqueror does not support window.onerror if (window.execScript) window.execScript(code, "javascript"); // IE work-around to get script executed in global scope else window.setTimeout(code, 0); // Standard compliant version } else - error = (ln ? "length mismatch: "+ln[1]+" != "+loader.responseText.length : "no length cookie"); + error = (ln ? "length mismatch: " + ln[1] + " != " + code.length : "no length cookie"); } else error = loader.statusText; |