mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix vulnerabilities reported by Stefan Schiller from Sonar. Thanks!
This commit is contained in:
parent
bf5a15077d
commit
28021aa711
@ -25,6 +25,7 @@ namespace FireflyIII\Services\Internal\Update;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Carbon\Exceptions\InvalidDateException;
|
use Carbon\Exceptions\InvalidDateException;
|
||||||
|
use Carbon\Exceptions\InvalidFormatException;
|
||||||
use FireflyIII\Events\TriggeredAuditLog;
|
use FireflyIII\Events\TriggeredAuditLog;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Factory\TagFactory;
|
use FireflyIII\Factory\TagFactory;
|
||||||
@ -662,7 +663,7 @@ class JournalUpdateService
|
|||||||
if ($this->hasFields([$field])) {
|
if ($this->hasFields([$field])) {
|
||||||
try {
|
try {
|
||||||
$value = '' === (string)$this->data[$field] ? null : new Carbon($this->data[$field]);
|
$value = '' === (string)$this->data[$field] ? null : new Carbon($this->data[$field]);
|
||||||
} catch (InvalidDateException $e) { // @phpstan-ignore-line
|
} catch (InvalidDateException|InvalidFormatException $e) { // @phpstan-ignore-line
|
||||||
app('log')->debug(sprintf('%s is not a valid date value: %s', $this->data[$field], $e->getMessage()));
|
app('log')->debug(sprintf('%s is not a valid date value: %s', $this->data[$field], $e->getMessage()));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -25,6 +25,7 @@ namespace FireflyIII\Support\Binder;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Carbon\Exceptions\InvalidDateException;
|
use Carbon\Exceptions\InvalidDateException;
|
||||||
|
use Carbon\Exceptions\InvalidFormatException;
|
||||||
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
|
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
|
||||||
use Illuminate\Routing\Route;
|
use Illuminate\Routing\Route;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
@ -71,10 +72,10 @@ class Date implements BinderInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$result = new Carbon($value);
|
$result = new Carbon($value);
|
||||||
} catch (InvalidDateException $e) { // @phpstan-ignore-line
|
} catch (InvalidDateException|InvalidFormatException $e) { // @phpstan-ignore-line
|
||||||
$message = sprintf('Could not parse date "%s" for user #%d: %s', $value, auth()->user()->id, $e->getMessage());
|
$message = sprintf('Could not parse date "%s" for user #%d: %s', $value, auth()->user()->id, $e->getMessage());
|
||||||
app('log')->error($message);
|
app('log')->error($message);
|
||||||
throw new NotFoundHttpException($message, $e);
|
throw new NotFoundHttpException('Could not parse value', $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -119,7 +119,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getWebhook: function () {
|
getWebhook: function () {
|
||||||
const page = window.location.href.split('/');
|
const page = window.location.href.split('/');
|
||||||
const webhookId = page[page.length - 1];
|
const webhookId = parseInt(page[page.length - 1]);
|
||||||
this.downloadWebhook(webhookId);
|
this.downloadWebhook(webhookId);
|
||||||
},
|
},
|
||||||
downloadWebhook: function (id) {
|
downloadWebhook: function (id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user