mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
@@ -31,6 +31,7 @@ use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
|
||||
/**
|
||||
@@ -106,6 +107,7 @@ class ForgotPasswordController extends Controller
|
||||
}
|
||||
$host = request()->host();
|
||||
if ($configuredHost !== $host) {
|
||||
Log::error(sprintf('Host header is "%s", APP_URL is "%s".', $host, $configuredHost));
|
||||
throw new FireflyException('The Host-header does not match the host in the APP_URL environment variable. Please make sure these match. See also: https://bit.ly/FF3-host-header');
|
||||
}
|
||||
}
|
||||
|
@@ -49,6 +49,7 @@ class Translation extends AbstractExtension
|
||||
{
|
||||
return [
|
||||
$this->journalLinkTranslation(),
|
||||
$this->laravelTranslation(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -68,4 +69,19 @@ class Translation extends AbstractExtension
|
||||
['is_safe' => ['html']]
|
||||
);
|
||||
}
|
||||
|
||||
public function laravelTranslation(): TwigFunction
|
||||
{
|
||||
return new TwigFunction(
|
||||
'__',
|
||||
static function (string $key) {
|
||||
$translation = trans($key);
|
||||
if ($key === $translation) {
|
||||
return $key;
|
||||
}
|
||||
|
||||
return $translation;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user