Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    IMAP backend search not working (filter becomes before 1970-01-01 and after 1970-01-01)

    Z-Push when using other backends
    2
    3
    755
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • freescape
      freescape last edited by

      I found email search not working from Android today. Tracked it down to the search filter giving after and before dates of 1970.

      In the code in BackendIMAP::getSearchRestrictions:
      $searchGreater = strftime("%Y-%m-%d", strtotime($cpo->GetSearchValueGreater()));
      $searchLess = strftime("%Y-%m-%d", strtotime($cpo->GetSearchValueLess()));

      $cpo search values are empty, and strtotime is returning false, which strftime is happily converting to a time string like 1970-01-01 for both.

      I replaced with
      $searchGreater = ‘’;
      $searchLess = ‘’;
      if ($t = strtotime($cpo->GetSearchValueGreater())) {
      $searchGreater = strftime("%Y-%m-%d", $t);
      }
      if ($t = strtotime($cpo->GetSearchValueLess())) {
      $searchLess = strftime("%Y-%m-%d", $t);
      }

      and search is working fine for me now.

      Seems like a new problem as I’ve seen posts from others with debug showing proper dates in the filter string?

      1 Reply Last reply Reply Quote 0
      • Manfred
        Manfred Kopano last edited by

        Hi freescape,

        would you like to contribute the fix to the Z-Push community? See https://wiki.z-hub.io/display/ZP/Development+guidelines for more information.

        Manfred

        1 Reply Last reply Reply Quote 0
        • freescape
          freescape last edited by

          Hrrm, I know about as much about PHP as I do about playing the Antagonistic Undecagonstring two-handed… so sure, why not! :-)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post