mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Update some code, add security txt file.
This commit is contained in:
parent
720dcb0fe5
commit
be5c44af61
@ -435,11 +435,15 @@ class TransactionRequest extends Request
|
|||||||
$destinationAccount = $this->assetAccountExists($validator, $destinationId, $destinationName, $idField, $nameField);
|
$destinationAccount = $this->assetAccountExists($validator, $destinationId, $destinationName, $idField, $nameField);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new FireflyException(sprintf('The validator cannot handle transaction type "%s" in validateAccountInformation().', $data['type']));
|
// @codeCoverageIgnoreStart
|
||||||
|
throw new FireflyException(
|
||||||
|
sprintf('The validator cannot handle transaction type "%s" in validateAccountInformation().', $data['type'])
|
||||||
|
);
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
|
|
||||||
}
|
}
|
||||||
// add some errors in case of same account submitted:
|
// add some errors in case of same account submitted:
|
||||||
if (!is_null($sourceAccount) && !is_null($destinationAccount) && $sourceAccount->id === $destinationAccount->id) {
|
if (null !== $sourceAccount && null !== $destinationAccount && $sourceAccount->id === $destinationAccount->id) {
|
||||||
$validator->errors()->add($idField, trans('validation.source_equals_destination'));
|
$validator->errors()->add($idField, trans('validation.source_equals_destination'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -463,7 +467,7 @@ class TransactionRequest extends Request
|
|||||||
// the journal may exist in the request:
|
// the journal may exist in the request:
|
||||||
/** @var Transaction $transaction */
|
/** @var Transaction $transaction */
|
||||||
$transaction = $this->route()->parameter('transaction');
|
$transaction = $this->route()->parameter('transaction');
|
||||||
if (is_null($transaction)) {
|
if (null === $transaction) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$data['type'] = strtolower($transaction->transactionJournal->transactionType->type);
|
$data['type'] = strtolower($transaction->transactionJournal->transactionType->type);
|
||||||
|
@ -54,6 +54,8 @@ class EncryptFile extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Contracts\Encryption\EncryptException
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
@ -124,7 +124,7 @@ class ExpandedProcessor implements ProcessorInterface
|
|||||||
$currencyId = $ibans[$accountId]['currency_id'] ?? 0;
|
$currencyId = $ibans[$accountId]['currency_id'] ?? 0;
|
||||||
$opposingCurrencyId = $ibans[$opposingId]['currency_id'] ?? 0;
|
$opposingCurrencyId = $ibans[$opposingId]['currency_id'] ?? 0;
|
||||||
$transaction->notes = $notes[$journalId] ?? '';
|
$transaction->notes = $notes[$journalId] ?? '';
|
||||||
$transaction->tags = join(',', $tags[$journalId] ?? []);
|
$transaction->tags = implode(',', $tags[$journalId] ?? []);
|
||||||
$transaction->account_number = $ibans[$accountId]['accountNumber'] ?? '';
|
$transaction->account_number = $ibans[$accountId]['accountNumber'] ?? '';
|
||||||
$transaction->account_bic = $ibans[$accountId]['BIC'] ?? '';
|
$transaction->account_bic = $ibans[$accountId]['BIC'] ?? '';
|
||||||
$transaction->account_currency_code = $currencies[$currencyId] ?? '';
|
$transaction->account_currency_code = $currencies[$currencyId] ?? '';
|
||||||
@ -331,6 +331,7 @@ class ExpandedProcessor implements ProcessorInterface
|
|||||||
* @param array $array
|
* @param array $array
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||||
*/
|
*/
|
||||||
private function getTags(array $array): array
|
private function getTags(array $array): array
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ class AccountFactory
|
|||||||
}
|
}
|
||||||
|
|
||||||
$newAccount = Account::create($databaseData);
|
$newAccount = Account::create($databaseData);
|
||||||
$this->updateMetadata($newAccount, $data);
|
$this->updateMetaData($newAccount, $data);
|
||||||
|
|
||||||
if ($this->validIBData($data) && $type->type === AccountType::ASSET) {
|
if ($this->validIBData($data) && $type->type === AccountType::ASSET) {
|
||||||
$this->updateIB($newAccount, $data);
|
$this->updateIB($newAccount, $data);
|
||||||
@ -117,6 +117,8 @@ class AccountFactory
|
|||||||
* @param string $accountType
|
* @param string $accountType
|
||||||
*
|
*
|
||||||
* @return Account
|
* @return Account
|
||||||
|
* @throws \FireflyIII\Exceptions\FireflyException
|
||||||
|
* @throws \FireflyIII\Exceptions\FireflyException
|
||||||
*/
|
*/
|
||||||
public function findOrCreate(string $accountName, string $accountType): Account
|
public function findOrCreate(string $accountName, string $accountType): Account
|
||||||
{
|
{
|
||||||
|
@ -109,8 +109,6 @@ class VersionCheckEventHandler
|
|||||||
// flash info
|
// flash info
|
||||||
session()->flash('info', $string);
|
session()->flash('info', $string);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
|||||||
* @param Model $model
|
* @param Model $model
|
||||||
*
|
*
|
||||||
* @return Attachment
|
* @return Attachment
|
||||||
|
* @throws \Illuminate\Contracts\Encryption\EncryptException
|
||||||
*/
|
*/
|
||||||
protected function processFile(UploadedFile $file, Model $model): Attachment
|
protected function processFile(UploadedFile $file, Model $model): Attachment
|
||||||
{
|
{
|
||||||
@ -206,7 +207,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
|||||||
Log::debug('Now in validMime()');
|
Log::debug('Now in validMime()');
|
||||||
$mime = e($file->getMimeType());
|
$mime = e($file->getMimeType());
|
||||||
$name = e($file->getClientOriginalName());
|
$name = e($file->getClientOriginalName());
|
||||||
Log::debug(sprintf('Name is %, and mime is %s', $name, $mime));
|
Log::debug(sprintf('Name is %s, and mime is %s', $name, $mime));
|
||||||
Log::debug('Valid mimes are', $this->allowedMimes);
|
Log::debug('Valid mimes are', $this->allowedMimes);
|
||||||
|
|
||||||
if (!in_array($mime, $this->allowedMimes)) {
|
if (!in_array($mime, $this->allowedMimes)) {
|
||||||
|
@ -35,15 +35,15 @@ class BalanceLine
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const ROLE_DEFAULTROLE = 1;
|
public const ROLE_DEFAULTROLE = 1;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const ROLE_TAGROLE = 2;
|
public const ROLE_TAGROLE = 2;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const ROLE_DIFFROLE = 3;
|
public const ROLE_DIFFROLE = 3;
|
||||||
|
|
||||||
/** @var Collection */
|
/** @var Collection */
|
||||||
protected $balanceEntries;
|
protected $balanceEntries;
|
||||||
|
@ -834,6 +834,7 @@ class JournalCollector implements JournalCollectorInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
private function joinOpposingTables()
|
private function joinOpposingTables()
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ class Help implements HelpInterface
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const CACHEKEY = 'help_%s_%s';
|
public const CACHEKEY = 'help_%s_%s';
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36';
|
protected $userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36';
|
||||||
|
|
||||||
|
@ -57,11 +57,8 @@ class PopupReport implements PopupReportInterface
|
|||||||
return $journals->filter(
|
return $journals->filter(
|
||||||
function (Transaction $transaction) {
|
function (Transaction $transaction) {
|
||||||
$tags = $transaction->transactionJournal->tags()->where('tagMode', 'balancingAct')->count();
|
$tags = $transaction->transactionJournal->tags()->where('tagMode', 'balancingAct')->count();
|
||||||
if (0 === $tags) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return 0 === $tags;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,7 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function listOfMonths(Carbon $date): array
|
public function listOfMonths(Carbon $date): array
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ class ReconcileController extends Controller
|
|||||||
$preFilled = [
|
$preFilled = [
|
||||||
'date' => $this->repository->getJournalDate($journal, null),
|
'date' => $this->repository->getJournalDate($journal, null),
|
||||||
'category' => $this->repository->getJournalCategoryName($journal),
|
'category' => $this->repository->getJournalCategoryName($journal),
|
||||||
'tags' => join(',', $journal->tags->pluck('tag')->toArray()),
|
'tags' => implode(',', $journal->tags->pluck('tag')->toArray()),
|
||||||
'amount' => $pTransaction->amount,
|
'amount' => $pTransaction->amount,
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ class ReconcileController extends Controller
|
|||||||
'category_name' => null,
|
'category_name' => null,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'notes' => join(', ', $data['transactions']),
|
'notes' => implode(', ', $data['transactions']),
|
||||||
];
|
];
|
||||||
|
|
||||||
$journal = $repository->store($journalData);
|
$journal = $repository->store($journalData);
|
||||||
|
@ -76,6 +76,7 @@ class LinkController extends Controller
|
|||||||
* @param LinkType $linkType
|
* @param LinkType $linkType
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function delete(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
public function delete(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
||||||
{
|
{
|
||||||
@ -108,6 +109,7 @@ class LinkController extends Controller
|
|||||||
* @param LinkType $linkType
|
* @param LinkType $linkType
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function destroy(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
public function destroy(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
||||||
{
|
{
|
||||||
@ -126,6 +128,7 @@ class LinkController extends Controller
|
|||||||
* @param LinkType $linkType
|
* @param LinkType $linkType
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function edit(Request $request, LinkType $linkType)
|
public function edit(Request $request, LinkType $linkType)
|
||||||
{
|
{
|
||||||
@ -184,6 +187,7 @@ class LinkController extends Controller
|
|||||||
* @param LinkTypeRepositoryInterface $repository
|
* @param LinkTypeRepositoryInterface $repository
|
||||||
*
|
*
|
||||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function store(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository)
|
public function store(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
@ -212,6 +216,7 @@ class LinkController extends Controller
|
|||||||
* @param LinkType $linkType
|
* @param LinkType $linkType
|
||||||
*
|
*
|
||||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function update(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
public function update(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
|
||||||
{
|
{
|
||||||
|
@ -61,6 +61,8 @@ class UpdateController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
|
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||||
|
* @throws \Psr\Container\ContainerExceptionInterface
|
||||||
* @throws \Illuminate\Container\EntryNotFoundException
|
* @throws \Illuminate\Container\EntryNotFoundException
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
|
@ -65,6 +65,7 @@ class LoginController extends Controller
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||||
*
|
*
|
||||||
|
* @throws \RuntimeException
|
||||||
* @throws \Illuminate\Validation\ValidationException
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
*/
|
*/
|
||||||
public function login(Request $request)
|
public function login(Request $request)
|
||||||
@ -102,6 +103,7 @@ class LoginController extends Controller
|
|||||||
* @param CookieJar $cookieJar
|
* @param CookieJar $cookieJar
|
||||||
*
|
*
|
||||||
* @return $this|\Illuminate\Http\RedirectResponse
|
* @return $this|\Illuminate\Http\RedirectResponse
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function logout(Request $request, CookieJar $cookieJar)
|
public function logout(Request $request, CookieJar $cookieJar)
|
||||||
{
|
{
|
||||||
@ -119,6 +121,7 @@ class LoginController extends Controller
|
|||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function showLoginForm(Request $request)
|
public function showLoginForm(Request $request)
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,7 @@ class TwoFactorController extends Controller
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||||
*
|
*
|
||||||
|
* @throws \RuntimeException
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*
|
*
|
||||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||||
@ -91,6 +92,7 @@ class TwoFactorController extends Controller
|
|||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) // it's unused but the class does some validation.
|
* @SuppressWarnings(PHPMD.UnusedFormalParameter) // it's unused but the class does some validation.
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function postIndex(TokenFormRequest $request, CookieJar $cookieJar)
|
public function postIndex(TokenFormRequest $request, CookieJar $cookieJar)
|
||||||
{
|
{
|
||||||
|
@ -97,6 +97,7 @@ class ConfigurationController extends Controller
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
*
|
*
|
||||||
|
* @throws \RuntimeException
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
public function post(Request $request, ImportJob $job)
|
public function post(Request $request, ImportJob $job)
|
||||||
|
@ -71,7 +71,7 @@ class IndexController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function create(string $bank)
|
public function create(string $bank)
|
||||||
{
|
{
|
||||||
if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
|
if (true === !config(sprintf('import.enabled.%s', $bank))) {
|
||||||
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class PrerequisitesController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(string $bank)
|
public function index(string $bank)
|
||||||
{
|
{
|
||||||
if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
|
if (true === !config(sprintf('import.enabled.%s', $bank))) {
|
||||||
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$class = strval(config(sprintf('import.prerequisites.%s', $bank)));
|
$class = strval(config(sprintf('import.prerequisites.%s', $bank)));
|
||||||
@ -103,13 +103,14 @@ class PrerequisitesController extends Controller
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
*
|
*
|
||||||
|
* @throws \RuntimeException
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
public function post(Request $request, string $bank)
|
public function post(Request $request, string $bank)
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('Now in postPrerequisites for %s', $bank));
|
Log::debug(sprintf('Now in postPrerequisites for %s', $bank));
|
||||||
|
|
||||||
if (true === !(config(sprintf('import.enabled.%s', $bank)))) {
|
if (true === !config(sprintf('import.enabled.%s', $bank))) {
|
||||||
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,6 +244,15 @@ class BoxController extends Controller
|
|||||||
if ($currencyId !== 0) {
|
if ($currencyId !== 0) {
|
||||||
$accountCurrency = $currencyRepos->findNull($currencyId);
|
$accountCurrency = $currencyRepos->findNull($currencyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the account is a credit card, subtract the virtual balance from the balance,
|
||||||
|
// to better reflect that this is not money that is actually "yours".
|
||||||
|
$role = (string)$repository->getMetaValue($account, 'accountRole');
|
||||||
|
$virtualBalance = (string)$account->virtual_balance;
|
||||||
|
if ($role === 'ccAsset' && $virtualBalance !== '' && (float)$virtualBalance > 0) {
|
||||||
|
$balance = bcsub($balance, $virtualBalance);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($netWorth[$accountCurrency->id])) {
|
if (!isset($netWorth[$accountCurrency->id])) {
|
||||||
$netWorth[$accountCurrency->id]['currency'] = $accountCurrency;
|
$netWorth[$accountCurrency->id]['currency'] = $accountCurrency;
|
||||||
$netWorth[$accountCurrency->id]['sum'] = '0';
|
$netWorth[$accountCurrency->id]['sum'] = '0';
|
||||||
|
@ -35,6 +35,7 @@ use phpseclib\Crypt\RSA;
|
|||||||
*/
|
*/
|
||||||
class InstallController extends Controller
|
class InstallController extends Controller
|
||||||
{
|
{
|
||||||
|
/** @noinspection MagicMethodsValidityInspection */
|
||||||
/**
|
/**
|
||||||
* InstallController constructor.
|
* InstallController constructor.
|
||||||
*/
|
*/
|
||||||
@ -66,7 +67,7 @@ class InstallController extends Controller
|
|||||||
Passport::keyPath('oauth-private.key'),
|
Passport::keyPath('oauth-private.key'),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ((file_exists($publicKey) || file_exists($privateKey))) {
|
if (file_exists($publicKey) || file_exists($privateKey)) {
|
||||||
return response()->json(['OK']);
|
return response()->json(['OK']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,8 @@ class AuthenticateTwoFactor
|
|||||||
* @param array ...$guards
|
* @param array ...$guards
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|mixed
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|mixed
|
||||||
|
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||||
|
* @throws \Psr\Container\ContainerExceptionInterface
|
||||||
* @throws \Illuminate\Container\EntryNotFoundException
|
* @throws \Illuminate\Container\EntryNotFoundException
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next, ...$guards)
|
public function handle($request, Closure $next, ...$guards)
|
||||||
|
@ -63,6 +63,7 @@ class Binder
|
|||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*
|
*
|
||||||
|
* @throws \LogicException
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next, ...$guards)
|
public function handle($request, Closure $next, ...$guards)
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,7 @@ class IsDemoUser
|
|||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next)
|
public function handle(Request $request, Closure $next)
|
||||||
{
|
{
|
||||||
|
@ -68,9 +68,9 @@ class AccountFormRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
$accountRoles = join(',', config('firefly.accountRoles'));
|
$accountRoles = implode(',', config('firefly.accountRoles'));
|
||||||
$types = join(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
$types = implode(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
||||||
$ccPaymentTypes = join(',', array_keys(config('firefly.ccTypes')));
|
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
||||||
$rules = [
|
$rules = [
|
||||||
'name' => 'required|min:1|uniqueAccountForUser',
|
'name' => 'required|min:1|uniqueAccountForUser',
|
||||||
'openingBalance' => 'numeric|required_with:openingBalanceDate|nullable',
|
'openingBalance' => 'numeric|required_with:openingBalanceDate|nullable',
|
||||||
|
@ -40,13 +40,14 @@ class ExportFormRequest extends Request
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
$sessionFirst = clone session('first');
|
$sessionFirst = clone session('first');
|
||||||
$first = $sessionFirst->subDay()->format('Y-m-d');
|
$first = $sessionFirst->subDay()->format('Y-m-d');
|
||||||
$today = Carbon::create()->addDay()->format('Y-m-d');
|
$today = Carbon::create()->addDay()->format('Y-m-d');
|
||||||
$formats = join(',', array_keys(config('firefly.export_formats')));
|
$formats = implode(',', array_keys(config('firefly.export_formats')));
|
||||||
|
|
||||||
// fixed
|
// fixed
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class JournalLinkRequest extends Request
|
|||||||
$return = [];
|
$return = [];
|
||||||
$linkType = $this->get('link_type');
|
$linkType = $this->get('link_type');
|
||||||
$parts = explode('_', $linkType);
|
$parts = explode('_', $linkType);
|
||||||
$return['link_type_id'] = intval($parts[0]);
|
$return['link_type_id'] = (int)$parts[0];
|
||||||
$return['transaction_journal_id'] = $this->integer('link_journal_id');
|
$return['transaction_journal_id'] = $this->integer('link_journal_id');
|
||||||
$return['notes'] = strlen($this->string('notes')) > 0 ? $this->string('notes') : '';
|
$return['notes'] = strlen($this->string('notes')) > 0 ? $this->string('notes') : '';
|
||||||
$return['direction'] = $parts[1];
|
$return['direction'] = $parts[1];
|
||||||
@ -70,7 +70,7 @@ class JournalLinkRequest extends Request
|
|||||||
$combinations[] = sprintf('%d_inward', $type->id);
|
$combinations[] = sprintf('%d_inward', $type->id);
|
||||||
$combinations[] = sprintf('%d_outward', $type->id);
|
$combinations[] = sprintf('%d_outward', $type->id);
|
||||||
}
|
}
|
||||||
$string = join(',', $combinations);
|
$string = implode(',', $combinations);
|
||||||
|
|
||||||
// fixed
|
// fixed
|
||||||
return [
|
return [
|
||||||
|
@ -30,6 +30,7 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CategoryFormRequest.
|
* Class CategoryFormRequest.
|
||||||
@ -124,6 +125,7 @@ class ReportFormRequest extends Request
|
|||||||
$date = new Carbon($parts[1]);
|
$date = new Carbon($parts[1]);
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
Log::error(sprintf('"%s" is not a valid date range.', $range));
|
||||||
throw new FireflyException(sprintf('"%s" is not a valid date range.', $range));
|
throw new FireflyException(sprintf('"%s" is not a valid date range.', $range));
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
@ -170,6 +172,7 @@ class ReportFormRequest extends Request
|
|||||||
$date = new Carbon($parts[0]);
|
$date = new Carbon($parts[0]);
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
Log::error(sprintf('"%s" is not a valid date range.', $range));
|
||||||
throw new FireflyException(sprintf('"%s" is not a valid date range.', $range));
|
throw new FireflyException(sprintf('"%s" is not a valid date range.', $range));
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ class RuleFormRequest extends Request
|
|||||||
$validActions = array_keys(config('firefly.rule-actions'));
|
$validActions = array_keys(config('firefly.rule-actions'));
|
||||||
|
|
||||||
// some actions require text:
|
// some actions require text:
|
||||||
$contextActions = join(',', config('firefly.rule-actions-text'));
|
$contextActions = implode(',', config('firefly.rule-actions-text'));
|
||||||
|
|
||||||
$titleRule = 'required|between:1,100|uniqueObjectForUser:rules,title';
|
$titleRule = 'required|between:1,100|uniqueObjectForUser:rules,title';
|
||||||
if (null !== $repository->find(intval($this->get('id')))->id) {
|
if (null !== $repository->find(intval($this->get('id')))->id) {
|
||||||
@ -82,9 +82,9 @@ class RuleFormRequest extends Request
|
|||||||
'stop_processing' => 'boolean',
|
'stop_processing' => 'boolean',
|
||||||
'rule_group_id' => 'required|belongsToUser:rule_groups',
|
'rule_group_id' => 'required|belongsToUser:rule_groups',
|
||||||
'trigger' => 'required|in:store-journal,update-journal',
|
'trigger' => 'required|in:store-journal,update-journal',
|
||||||
'rule-trigger.*' => 'required|in:' . join(',', $validTriggers),
|
'rule-trigger.*' => 'required|in:' . implode(',', $validTriggers),
|
||||||
'rule-trigger-value.*' => 'required|min:1|ruleTriggerValue',
|
'rule-trigger-value.*' => 'required|min:1|ruleTriggerValue',
|
||||||
'rule-action.*' => 'required|in:' . join(',', $validActions),
|
'rule-action.*' => 'required|in:' . implode(',', $validActions),
|
||||||
];
|
];
|
||||||
// since Laravel does not support this stuff yet, here's a trick.
|
// since Laravel does not support this stuff yet, here's a trick.
|
||||||
for ($i = 0; $i < 10; ++$i) {
|
for ($i = 0; $i < 10; ++$i) {
|
||||||
|
@ -41,6 +41,7 @@ class SelectTransactionsRequest extends Request
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
|
@ -154,11 +154,9 @@ class SplitJournalFormRequest extends Request
|
|||||||
$transactions = $data['transactions'] ?? [];
|
$transactions = $data['transactions'] ?? [];
|
||||||
/** @var array $array */
|
/** @var array $array */
|
||||||
foreach ($transactions as $array) {
|
foreach ($transactions as $array) {
|
||||||
if ($array['destination_id'] !== null && $array['source_id'] !== null) {
|
if ($array['destination_id'] !== null && $array['source_id'] !== null && $array['destination_id'] === $array['source_id']) {
|
||||||
if ($array['destination_id'] === $array['source_id']) {
|
$validator->errors()->add('journal_source_account_id', trans('validation.source_equals_destination'));
|
||||||
$validator->errors()->add('journal_source_account_id', trans('validation.source_equals_destination'));
|
$validator->errors()->add('journal_destination_account_id', trans('validation.source_equals_destination'));
|
||||||
$validator->errors()->add('journal_destination_account_id', trans('validation.source_equals_destination'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class TestRuleFormRequest extends Request
|
|||||||
// fixed
|
// fixed
|
||||||
$validTriggers = array_keys(config('firefly.rule-triggers'));
|
$validTriggers = array_keys(config('firefly.rule-triggers'));
|
||||||
$rules = [
|
$rules = [
|
||||||
'rule-trigger.*' => 'required|min:1|in:' . join(',', $validTriggers),
|
'rule-trigger.*' => 'required|min:1|in:' . implode(',', $validTriggers),
|
||||||
'rule-trigger-value.*' => 'required|min:1|ruleTriggerValue',
|
'rule-trigger-value.*' => 'required|min:1|ruleTriggerValue',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -43,10 +43,8 @@ class TokenFormRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
// fixed
|
// fixed
|
||||||
$rules = [
|
return [
|
||||||
'code' => 'required|2faCode',
|
'code' => 'required|2faCode',
|
||||||
];
|
];
|
||||||
|
|
||||||
return $rules;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
security.txt
Normal file
4
security.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Contact: mailto:thegrumpydictator@gmail.com
|
||||||
|
Encryption: https://keybase.io/jc5/pgp_keys.asc?fingerprint=90f546f13b81b67a1baa5dddc16961e655e74b5e
|
||||||
|
Acknowledgements: https://github.com/firefly-iii/firefly-iii
|
||||||
|
Signature: https://firefly-iii.org/.well-known/security.txt.sig
|
Loading…
Reference in New Issue
Block a user