joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[6.0] Media Manager - File can not be uploaded

Open Elfangor93 opened this issue 7 months ago • 10 comments

Steps to reproduce the issue

  1. Prepare a local image filename (jpg) with a filename like name_20250516_1788636401.jpg
  2. Open the media manager in the Joomla backend
  3. Make sure, you are in the local - images filesystem adapter
  4. 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

Elfangor93 avatar May 16 '25 05:05 Elfangor93

Confirmed - works in 5.3 and 5.4-dev

MacJoom avatar May 16 '25 11:05 MacJoom

it must be something todo with it having two underscore in the name

brianteeman avatar May 16 '25 11:05 brianteeman

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

brianteeman avatar May 16 '25 11:05 brianteeman

From my point of view, underscores in filenames should not be a problem.

Elfangor93 avatar May 16 '25 11:05 Elfangor93

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

brianteeman avatar May 16 '25 12:05 brianteeman

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.

exlemor avatar Jun 16 '25 18:06 exlemor

Where is your evidence for that statement?

Even if true it is still a bug

brianteeman avatar Jun 16 '25 19:06 brianteeman

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.

exlemor avatar Jun 16 '25 19:06 exlemor

Interesting but ultimately irrelevant to the reported bug

brianteeman avatar Jun 16 '25 20:06 brianteeman

We will not change underscores to hyphens and we will just fix the bug

MacJoom avatar Jun 18 '25 17:06 MacJoom

Closing as having a pull request. Please test #45627 . Thanks in advance.

richard67 avatar Jun 19 '25 14:06 richard67