mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-24 04:41:01 +00:00
Replace methods with safe variants. Let's see how this works out.
This commit is contained in:
@@ -240,8 +240,8 @@ class General extends AbstractExtension
|
||||
return new TwigFilter(
|
||||
'phphost',
|
||||
static function (string $string): string {
|
||||
$proto = (string) parse_url($string, PHP_URL_SCHEME);
|
||||
$host = (string) parse_url($string, PHP_URL_HOST);
|
||||
$proto = (string) \Safe\parse_url($string, PHP_URL_SCHEME);
|
||||
$host = (string) \Safe\parse_url($string, PHP_URL_HOST);
|
||||
|
||||
return e(sprintf('%s://%s', $proto, $host));
|
||||
}
|
||||
@@ -272,7 +272,7 @@ class General extends AbstractExtension
|
||||
return new TwigFunction(
|
||||
'phpdate',
|
||||
static function (string $str): string {
|
||||
return date($str);
|
||||
return \Safe\date($str);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ class TransactionGroupTwig extends AbstractExtension
|
||||
return today(config('app.timezone'));
|
||||
}
|
||||
|
||||
return new Carbon(json_decode($entry->data, false));
|
||||
return new Carbon(\Safe\json_decode($entry->data, false));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -275,7 +275,7 @@ class TransactionGroupTwig extends AbstractExtension
|
||||
return '';
|
||||
}
|
||||
|
||||
return json_decode($entry->data, true);
|
||||
return \Safe\json_decode($entry->data, true);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user