1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Check for valid time tracker URL

This commit is contained in:
Hillel Coren 2018-03-12 22:15:42 +02:00
parent 45ab98c62e
commit e812234314
2 changed files with 4 additions and 2 deletions

View File

@ -2772,6 +2772,7 @@ $LANG = array(
'slack_incoming_webhooks' => 'Slack incoming webhooks',
'accept' => 'Accept',
'accepted_terms' => 'Successfully accepted the latest terms of service',
'invalid_url' => 'Invalid URL',
);

View File

@ -146,13 +146,14 @@
showCancelButton: true,
confirmButtonText: 'Save',
}).then(function (value) {
if (!value) {
if (! value || value.indexOf('http') !== 0) {
swal("{{ trans('texts.invalid_url') }}")
return;
}
value = value.replace(/\/+$/, '') + '/time_tracker';
localStorage.setItem('last:time_tracker:url', value);
location.reload();
})
}).catch(swal.noop);
}
@endif