[6.0] Media Manager - File can not be uploaded
Steps to reproduce the issue
- Prepare a local image filename (jpg) with a filename like
name_20250516_1788636401.jpg - Open the media manager in the Joomla backend
- Make sure, you are in the
local - imagesfilesystem adapter - Upload the image file
Expected result
The file gets created.
Actual result
Nothing happens.
System information (as much as possible)
- Joomla v6.0.0-alpha1-dev
- Wampserver on Windows v3.3.0
- PHP v8.1.13
- MySQL 8.0.31
Additional comments
The error happens in https://github.com/joomla/joomla-cms/blob/045b2bcc863164da664301d0d644575a493ce22e/plugins/filesystem/local/src/Adapter/LocalAdapter.php#L258
The error that is thrown is Prohibited input U+0000005F
Confirmed - works in 5.3 and 5.4-dev
it must be something todo with it having two underscore in the name
I believe that I have identified that the problem occurs within this step
// Transform filename to punycode
$name = PunycodeHelper::toPunycode($name);
Which is probably due to the major upgrade in algo26-matthias/idna-convert from 3.2 to 4.0
From my point of view, underscores in filenames should not be a problem.
From my point of view, underscores in filenames should not be a problem.
agreed - itsa bug. I was just pointing out to developers where to look to resolve this
Hi guys,
While most file systems support _ (underscores) as it is safe for filenames and widely accepted by most operations systems and applications, Google and Bing have been recommending for years for SEO purposes that you use hyphens (-) in URLs AND filenames that will be indexed by search engines (images, documents, web pages etc etc) and not to use _ (underscores) as Google and Bing treat hyphens (-) as word separators and do not do so for _ (underscores).
Since SEO is more important than ever, as Joomla, we should do everything we can to fix things like this that help with SEO.
Where is your evidence for that statement?
Even if true it is still a bug
Where is your evidence for that statement?
Even if true it is still a bug
Among many other sources:
From Google SEO Starter Guide: https://developers.google.com/search/docs/fundamentals/seo-starter-guide ---> specifically: https://developers.google.com/search/docs/crawling-indexing/url-structure
https://developers.google.com/style/filenames
https://www.youtube.com/watch?v=Tvd_5Is4F80 and https://www.safaridigital.com.au/blog/dash-vs-underscore-url-seo-best-practices/ and there are a plethora of sources that have discussed this topic over the last 10 years...
BUT the common thought is IF you have already written a file or URL with a _, you shouldn't just rewrite it to - to improve SEO (without doing a redirect).
No doubt that it is still a bug - you know better than I.
Interesting but ultimately irrelevant to the reported bug
We will not change underscores to hyphens and we will just fix the bug
Closing as having a pull request. Please test #45627 . Thanks in advance.