From d9817779fbeaebf4b75c0670da7013bf4482b72b Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Sun, 19 Oct 2014 08:33:18 +0200 Subject: Give an error if event is supposed to end before it starts. Closes friendica/red#534 --- mod/events.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mod/events.php') diff --git a/mod/events.php b/mod/events.php index 337852170..e5ae7c662 100755 --- a/mod/events.php +++ b/mod/events.php @@ -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'])); -- cgit v1.2.3