diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-10-20 20:20:03 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-10-20 20:20:03 -0400 |
| commit | 8e34a5c7d2e5969d72a2a469e8c97ad7fc7de712 (patch) | |
| tree | 4d5687194e9f31eaf9d1d3c2c5a4a7b2d9fef213 /www/js | |
| parent | 89211bbbd526bbc587361085b119a19d296f6a7f (diff) | |
#724 and general, filter out cake error leaks
Diffstat (limited to 'www/js')
| -rwxr-xr-x | www/js/app.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/www/js/app.js b/www/js/app.js index 8a8cfd55..4e146384 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -714,6 +714,14 @@ angular.module('zmApp', [ } //console.log ("HTTP response"); + + + if (response.data && typeof(response.data) == 'string' && response.data.indexOf("<pre class=\"cake-error\">") != -1) { + console.log ("cake error detected, attempting fix..."); + response.data = JSON.parse(response.data.replace(/<pre class=\"cake-error\">[\s\S]*<\/pre>/,'')); + //console.log ("FIXED="+response.data); + } + //"data":"<pre class=\"cake-error\"> return response; } @@ -2340,6 +2348,13 @@ angular.module('zmApp', [ }); return d.promise; } else { + + // work around for cake-error leak + if (succ.data.indexOf("<pre class=\"cake-error\">") != -1) { + logger.debug ("**** Native: cake-error in message, trying fix..."); + succ.data = JSON.parse(succ.data.replace(/<pre class=\"cake-error\">[\s\S]*<\/pre>/,'')); + } + try { d.resolve({ "data": JSON.parse(succ.data) |
