X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fevents.php;h=5bc9807ed7b60e9f33c69f8ab351f8c9a0dcf697;hb=8bf6a29d4e05af5d461da3f01999785dc12ee7da;hp=27ca698307852a941b93eae88c2affe1766c29d4;hpb=ac6945eed1644e7a9e58c5f74dae696ff0f09d72;p=friendica.git diff --git a/mod/events.php b/mod/events.php index 27ca698307..5bc9807ed7 100644 --- a/mod/events.php +++ b/mod/events.php @@ -45,13 +45,20 @@ function events_post(&$a) { $finish = datetime_convert('UTC','UTC',$finish); } + // Don't allow the event to finish before it begins. + // It won't hurt anything, but somebody will file a bug report + // 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; $desc = escape_tags(trim($_POST['desc'])); $location = escape_tags(trim($_POST['location'])); $type = 'event'; if((! $desc) || (! $start)) { - notice('Event description and start time are required.'); + notice( t('Event description and start time are required.') . EOL); goaway($a->get_baseurl() . '/events/new'); }