From e1d580cb922e7a764d977732264e3a00671c116b Mon Sep 17 00:00:00 2001 From: Torben Dannhauer Date: Thu, 25 Jun 2026 08:53:20 +0200 Subject: [PATCH] fix(nag): add missing Nag::isTaskViewFilter() helper Task::process() calls Nag::isTaskViewFilter() when building the complete-link return URL, but the method was never implemented. Add a validator for Nag::VIEW_* filter values so smart-search tab names are not mistaken for VIEW_INCOMPLETE. --- lib/Nag.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/Nag.php b/lib/Nag.php index b696f46..9e1c446 100644 --- a/lib/Nag.php +++ b/lib/Nag.php @@ -109,6 +109,24 @@ class Nag */ public const VIEW_FUTURE_INCOMPLETE = 4; + /** + * Returns whether a value is a Nag::VIEW_* task list filter. + * + * @param mixed $filter Tab name or show_completed value. + * + * @return bool + */ + public static function isTaskViewFilter($filter): bool + { + if (!is_int($filter) && !(is_string($filter) && $filter !== '' && ctype_digit($filter))) { + return false; + } + + $filter = (int) $filter; + + return $filter >= self::VIEW_INCOMPLETE && $filter <= self::VIEW_FUTURE_INCOMPLETE; + } + /** * WebDAV task list. */