From f6dee426b69cf8225c2a2511bb73a8977866137c Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 17 Nov 2009 14:56:39 +0000 Subject: Added start/end marker and cut off prepended and appended stuff (Swisslife) --- itjs/boot.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'itjs') 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; -- cgit v1.2.3