I just tried to replicate it on 2 sites, on different VPS servers I host. I can’t. The filenames and media upload process just works as intended.
Have you tried temporarily disabling all plugins on your site to see if any plugin is interfering?
Okay, I will try on more sites and different providers/hoster – could be some after-effects on php2shell issue :O
I can’t figure it out either. Take a look at the Playground, for example: https://playground.wordpress.net- that’s a completely bare-bones WordPress installation, and it works just fine there.
I also think that something in your project is causing this issue. Deactivate all plugins to rule them out as the cause. If that’s not enough, try switching to a default theme.
As for php2shell, I can only see one possible connection: if your hosting provider has changed settings related to file uploads. However, only your hosting provider’s support team can answer that for you.
Source of the error found, all clear – it was a plugin conflict.
The update_attached_file function had been registered as an action, even though it’s a filter – that was the problem :O