Fileupload not working when namespace contains invalid characters

Steps to reproduce:

  1. Create a page (page structure) with “invalid” characters like brackets:
    System Administration/System_Administration/Server_(

  2. Try to upload files in this context (e.g. drag’n’drop a file to the page)
    e.g. “install erpnext_gpt-help.pdf”

  3. Experience the unknown error
    BlueSpice will show an error dialog, but won’t display any error message.
    There were no errors logged anywhere (at least I was unable to find any)
    The server-response to the file-upload gives some indications:

“upload”: {
“result”: “Warning”,
“warnings”: {
“badfilename”: “”,
“filekey”: “1apjsn9x81lc.80gjwu.1.pdf”,
“sessionkey”: “1apjsn9x81lc.80gjwu.1.pdf”

Root cause:
It seems the namespace is used to create a new filename for storing the file. The brackets in the namespace are causing the resulting name to be an invalid filename and the upload to fail. Renaming the namespace (removing the brackets) solves the problem. Meaning fileuploads to “System Administration/System_Administration/” do work.

Expected behavior:
Based on the mediawiki descriptions I would expect the system to create a filename based on the hash of the whole path (namespace+filename). E.g. any other algorithm would do fine as well, as long as no characters from the namespace or filename are reused.

What was the error message/error log?
Did not find any. The screen-popup shows “WARNING”, but not further text.

If applicable, add screenshots to help explain your problem.

System info:

  • OS: Fedora 38
Product Version
MediaWiki 1.39.4
PHP 8.2.10 (fpm-fcgi)
MariaDB 10.4.20-MariaDB
ICU 72.1
Pygments 2.11.2
BlueSpice (Credits) 4.3.2 (build:20230907155405)

Thanks for reporting this. I was able to reproduce this in our current test system.
Bug ticket (#36012) now exists and should be considered in one of our upcoming patches.

Have a great day!

1 Like