From f82eecf2fbf80deeea982ee2441a3b947464c1fe Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 24 May 2017 20:40:43 +0300 Subject: [PATCH] Prevent PhantomJS error loop --- resources/views/invoices/pdf.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/invoices/pdf.blade.php b/resources/views/invoices/pdf.blade.php index 52185f45b7ce..fb3332047efe 100644 --- a/resources/views/invoices/pdf.blade.php +++ b/resources/views/invoices/pdf.blade.php @@ -117,8 +117,9 @@ try { return getPDFString(refreshPDFCB, force); } catch (exception) { - if (location.href.indexOf('/view/')) { - var url = location.href.replace('/view/', '/download/') + '?base64=true'; + var href = location.href; + if (href.indexOf('/view/') && href.indexOf('phantomjs') == -1) { + var url = href.replace('/view/', '/download/') + '?base64=true'; $.get(url, function(result) { refreshPDFCB(result); })