-
Notifications
You must be signed in to change notification settings - Fork 98
Description
Steps to reproduce
- Create a Group Folder (Team folder)
- Inside the Group Folder:
- Create a directory or a file without extension (e.g.
README)
- Create a directory or a file without extension (e.g.
- Delete the directory / file
- Open the Trashbin via web UI or via WebDAV (PROPFIND on
/remote.php/dav/trashbin/*)
Expected behaviour
Group Folder trashbin should open normally and list all deleted items,
including directories and files without extensions.
Actual behaviour
The Group Folder trashbin fails to load and returns a PHP fatal error
when the trash contains directories or files without an extension.
Server configuration
Operating system: Linux
Web server: Apache
Database: PostgreSQL
PHP version: PHP 8.3
Nextcloud version: 32.0.5
Team folders version: groupfolders (shipped / custom_apps)
Updated from an older Nextcloud/ownCloud or fresh install: fresh install
Where did you install Nextcloud from: official Nextcloud package
Are you using external storage, if yes which one: local
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: any (also reproducible via WebDAV)
Operating system: Linux
Logs
Web server error log
Web server error log
PHP Notice: Undefined array key "extension" in custom_apps/groupfolders/lib/Trash/TrashBackend.php on line ~451PHP Fatal error: Uncaught TypeError:
substr(): Argument #1 ($string) must be of type string, null given
Nextcloud log (data/nextcloud.log)
Nextcloud log
Error during WebDAV PROPFIND /remote.php/dav/trashbin/*
Undefined array key "extension"
substr(): Argument #1 ($string) must be of type string, null given
Stack trace points to:
custom_apps/groupfolders/lib/Trash/TrashBackend.php:~451
Browser log
Browser log
PROPFIND /remote.php/dav/trashbin/* β 500 Internal Server Error
Additional information
- The issue only occurs when the Group Folder trash contains:
- directories (mimetype = httpd/unix-directory), or
- files without a file extension
- Database integrity is OK (no NULL values in name, original_location, or file_id)
- Removing folder entries from
oc_group_folders_trashimmediately resolves the issue - Root cause appears to be assuming
pathinfo()['extension']always exists pathinfo()does not return anextensionkey for directories or filenames without a dot- This leads to a PHP 8 fatal error when the value is later passed to
substr()
A small defensive fix using $pathInfo['extension'] ?? '' and
$pathInfo['filename'] prevents the crash without changing behavior
for files that do have extensions.