mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:04:30 -04:00
Fix for PhantomJS PDF when using iframe_url
This commit is contained in:
parent
b6fa4620b9
commit
c3e9380c75
@ -29,7 +29,9 @@ class Invitation extends EntityModel
|
|||||||
return $this->belongsTo('App\Models\Account');
|
return $this->belongsTo('App\Models\Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLink($type = 'view')
|
// If we're getting the link for PhantomJS to generate the PDF
|
||||||
|
// we need to make sure it's served from our site
|
||||||
|
public function getLink($type = 'view', $forceOnsite = false)
|
||||||
{
|
{
|
||||||
if (!$this->account) {
|
if (!$this->account) {
|
||||||
$this->load('account');
|
$this->load('account');
|
||||||
@ -39,7 +41,7 @@ class Invitation extends EntityModel
|
|||||||
$iframe_url = $this->account->iframe_url;
|
$iframe_url = $this->account->iframe_url;
|
||||||
|
|
||||||
if ($this->account->isPro()) {
|
if ($this->account->isPro()) {
|
||||||
if ($iframe_url) {
|
if ($iframe_url && !$forceOnsite) {
|
||||||
return "{$iframe_url}?{$this->invitation_key}";
|
return "{$iframe_url}?{$this->invitation_key}";
|
||||||
} elseif ($this->account->subdomain) {
|
} elseif ($this->account->subdomain) {
|
||||||
$url = Utils::replaceSubdomain($url, $this->account->subdomain);
|
$url = Utils::replaceSubdomain($url, $this->account->subdomain);
|
||||||
|
@ -789,7 +789,7 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
}
|
}
|
||||||
|
|
||||||
$invitation = $this->invitations[0];
|
$invitation = $this->invitations[0];
|
||||||
$link = $invitation->getLink();
|
$link = $invitation->getLink('view', true);
|
||||||
$key = env('PHANTOMJS_CLOUD_KEY');
|
$key = env('PHANTOMJS_CLOUD_KEY');
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user