Iโm running UBB.threads 8.0.0 on PHP 8.2 (Debian / nginx) and noticed the same problem with file downloads that I had already been fixed in an earlier 7.7.5 release.
๐ Problem File downloads containing spaces or non-ASCII characters (for example รberblick 2025.pdf or My File Name.docx) fail or produce malformed headers.
โ๏ธ Root Cause The current code uses a single variable $file for both filesystem and URL purposes, and directly applies rawurlencode() to it. When the physical file on disk contains spaces or UTF-8 characters, the encoded name no longer matches the actual file, resulting in 0-bytes downloads (!).
โ Solution (working patch) I re-applied and updated my original fix for PHP 8. Key changes: - Separate filesystem vs. URL filenames โ $file_fs (actual file on disk) โ $file_url = rawurlencode($file_fs) - Path-traversal protection using basename() - Encoding fallbacks for legacy uploads (UTF-8 โ ISO-8859-1 transliteration) - RFC 6266-compliant headers (filename*= for correct UTF-8 display) - Improved caching logic (Last-Modified / 304 Not Modified) even without apache_request_headers() - Accurate MIME types for inline images (image/jpeg, etc.) - Safe filesystem checks (is_file(), filesize(), filemtime()) to avoid PHP 8 fatals - The result restores correct downloads and inline display for all tested cases.
๐ Suggestion Please consider re-integrating this logic into a future maintenance release. It restores correct handling of UTF-8 filenames and spaces in attachments and ensures full PHP 8 compatibility. I have attached the updated download.inc.php (with detailed English comments) if helpful. Thanks for keeping UBB.threads modern and PHP 8-ready!