Give an error if event is supposed to end before it starts. Closes friendica/red#534

This commit is contained in:
Stefan Parviainen 2014-10-19 08:33:18 +02:00
parent 7c4f55af9f
commit d9817779fb

View File

@ -67,8 +67,10 @@ function events_post(&$a) {
// and we'll waste a bunch of time responding to it. Time that
// could've been spent doing something else.
if(strcmp($finish,$start) < 0)
$finish = $start;
if(strcmp($finish,$start) < 0) {
notice( t('Event can not end before it has started.') . EOL);
goaway($a->get_baseurl() . '/events/new');
}
$summary = escape_tags(trim($_POST['summary']));
$desc = escape_tags(trim($_POST['desc']));