summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-02-16 21:29:28 +0100
committerDaniel Friesel <derf@finalrewind.org>2022-02-16 21:29:28 +0100
commit6e95180a3c692f9de10a8e21dcc02544f2ff9027 (patch)
tree24854c59829d3ebc9ebde5d18eb1db51984d9f8b /lib/Travelynx.pm
parent167b01fa4264a8193ff3cbd9d3f1741f5702235a (diff)
handle missing 'base_url' in travelynx.conf
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 40ca0a5..7cbfebd 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -276,10 +276,18 @@ sub startup {
}
);
+ if ( not $self->app->config->{base_url} ) {
+ $self->app->log->error(
+"travelynx.conf: 'base_url' is missing. Links in maintenance/work/worker-generated E-Mails will be incorrect. This variable was introduced in travelynx 1.22; see examples/travelynx.conf for documentation."
+ );
+ }
+
$self->helper(
base_url_for => sub {
my ( $self, $path ) = @_;
- if ( ( my $url = $self->url_for($path) )->base ne q{} ) {
+ if ( ( my $url = $self->url_for($path) )->base ne q{}
+ or not $self->app->config->{base_url_for} )
+ {
return $url;
}
return $self->url_for($path)