aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-14 23:09:09 -0700
committerFriendika <info@friendika.com>2011-09-14 23:09:09 -0700
commit46b220518c0a95d394398998711088ac1268c343 (patch)
tree0ae402e80d18520600c20d817fc5a13aacb6cfcc /mod
parentcdf2fe859f439a9d3689ea946e23d9aef1fb6cac (diff)
downloadvolse-hubzilla-46b220518c0a95d394398998711088ac1268c343.tar.gz
volse-hubzilla-46b220518c0a95d394398998711088ac1268c343.tar.bz2
volse-hubzilla-46b220518c0a95d394398998711088ac1268c343.zip
don't allow events to finish before they begin
Diffstat (limited to 'mod')
-rw-r--r--mod/events.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/mod/events.php b/mod/events.php
index 27ca69830..5bc9807ed 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');
}