]> git.mxchange.org Git - friendica.git/commitdiff
limit event queries to one month even if no finish date is specified
authorZach Prezkuta <fermion@gmx.com>
Tue, 5 Feb 2013 03:45:14 +0000 (20:45 -0700)
committerZach Prezkuta <fermion@gmx.com>
Tue, 5 Feb 2013 03:45:14 +0000 (20:45 -0700)
mod/events.php

index be8b843177f6276cfc466bc265e57987708756fc..c13f31c9884d975ded711cefb70196397030dba2 100755 (executable)
@@ -260,13 +260,15 @@ function events_content(&$a) {
                        $r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
                                `item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` 
                                WHERE `event`.`uid` = %d and event.ignore = %d
-                               AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' ) 
-                               OR  (  `adjust` = 1 AND ( `finish` >= '%s' or nofinish ) AND `start` <= '%s' )) ",
+                               AND (( `adjust` = 0 AND ( `finish` >= '%s' OR ( nofinish AND start >= '%s' ) ) AND `start` <= '%s' ) 
+                               OR  (  `adjust` = 1 AND ( `finish` >= '%s' OR ( nofinish AND start >= '%s' ) ) AND `start` <= '%s' )) ",
                                intval(local_user()),
                                intval($ignored),
                                dbesc($start),
+                               dbesc($start),
                                dbesc($finish),
                                dbesc($adjust_start),
+                               dbesc($adjust_start),
                                dbesc($adjust_finish)
                        );
                }