1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fix invoice getPDFString

This commit is contained in:
Hillel Coren 2017-11-07 20:31:20 +02:00
parent 50b51534ad
commit b462701b18
2 changed files with 3 additions and 3 deletions

View File

@ -1213,6 +1213,7 @@ class Invoice extends EntityModel implements BalanceAffecting
// we see occasional 408 errors // we see occasional 408 errors
for ($i=1; $i<=5; $i++) { for ($i=1; $i<=5; $i++) {
$pdfString = CurlUtils::phantom('GET', $phantomjsLink); $pdfString = CurlUtils::phantom('GET', $phantomjsLink);
$pdfString = strip_tags($pdfString);
if (strpos($pdfString, 'data') === 0) { if (strpos($pdfString, 'data') === 0) {
break; break;
} else { } else {
@ -1224,9 +1225,8 @@ class Invoice extends EntityModel implements BalanceAffecting
if (! $pdfString && ($key = env('PHANTOMJS_CLOUD_KEY'))) { if (! $pdfString && ($key = env('PHANTOMJS_CLOUD_KEY'))) {
$url = "http://api.phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$link}?phantomjs=true%26phantomjs_secret={$phantomjsSecret}%22,renderType:%22html%22%7D"; $url = "http://api.phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$link}?phantomjs=true%26phantomjs_secret={$phantomjsSecret}%22,renderType:%22html%22%7D";
$pdfString = CurlUtils::get($url); $pdfString = CurlUtils::get($url);
$pdfString = strip_tags($pdfString);
} }
$pdfString = strip_tags($pdfString);
} catch (\Exception $exception) { } catch (\Exception $exception) {
Utils::logError("PhantomJS - Failed to load {$phantomjsLink}: {$exception->getMessage()}"); Utils::logError("PhantomJS - Failed to load {$phantomjsLink}: {$exception->getMessage()}");
return false; return false;

View File

@ -305,7 +305,7 @@ $LANG = array(
'specify_colors' => 'Specify colors', 'specify_colors' => 'Specify colors',
'specify_colors_label' => 'Select the colors used in the invoice', 'specify_colors_label' => 'Select the colors used in the invoice',
'chart_builder' => 'Chart Builder', 'chart_builder' => 'Chart Builder',
'ninja_email_footer' => 'Created by :site. Create. Send. Get Paid.', 'ninja_email_footer' => 'Created by :site | Create. Send. Get Paid.',
'go_pro' => 'Go Pro', 'go_pro' => 'Go Pro',
'quote' => 'Quote', 'quote' => 'Quote',
'quotes' => 'Quotes', 'quotes' => 'Quotes',