1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Fixes for str_replace deprecations

This commit is contained in:
David Bomba 2023-11-13 09:00:23 +11:00
parent ba7019d737
commit 4691ca29c1
2 changed files with 3 additions and 4 deletions

View File

@ -69,7 +69,7 @@ class PayFastPaymentDriver extends BaseDriver
public function init()
{
try {
$this->payfast = new \PayFast\PayFastPayment(
$this->payfast = new \Payfast\PayFastPayment(
[
'merchantId' => $this->company_gateway->getConfigField('merchantId'),
'merchantKey' => $this->company_gateway->getConfigField('merchantKey'),

View File

@ -1166,8 +1166,7 @@ class PdfBuilder
} elseif (Str::startsWith($variable, '$custom_surcharge')) {
$_variable = ltrim($variable, '$'); // $custom_surcharge1 -> custom_surcharge1
// $visible = intval($this->service->config->entity->{$_variable}) != 0;
$visible = intval(str_replace(['0','.'], '', $this->service->config->entity->{$_variable})) != 0;
$visible = intval(str_replace(['0','.'], '', ($this->service->config->entity->{$_variable} ?? ''))) != 0;
$elements[1]['elements'][] = ['element' => 'div', 'elements' => [
['element' => 'span', 'content' => $variable . '_label', 'properties' => ['hidden' => !$visible, 'data-ref' => 'totals_table-' . substr($variable, 1) . '-label']],
@ -1679,7 +1678,7 @@ class PdfBuilder
if ($child['element'] !== 'script') {
if ($this->service->company->markdown_enabled && array_key_exists('content', $child)) {
$child['content'] = str_replace('<br>', "\r", $child['content']);
$child['content'] = str_replace('<br>', "\r", ($child['content'] ?? ''));
$child['content'] = $this->commonmark->convert($child['content'] ?? '');
}
}