+ // Handle bad performance situations when the distance between top and bottom is too high
+ // See issue https://github.com/friendica/friendica/issues/8619
+ if (strtotime($top_limit) - strtotime($bottom_limit) > 86400) {
+ // Set the bottom limit to one day in the past at maximum
+ $bottom_limit = DateTimeFormat::utc(date('c', strtotime($top_limit) - 86400));
+ }
+