I've stumbled upon an edge-case in dealing with "Allow file replacement extensions for the same file type" https://www.drupal.org/node/2271229#comment-10385831
The comparison on the file extension is case-sensitive, therefore it fails when comparing, for example, .PNG with .png
I've noticed it is not so uncommon for users in my organisation to use all-uppercase extensions, so we ended up with an erratic (as seen by the user) behaviour of some files being replaced and some other not. Finally, I spotted the root cause and I think it could be solve by simply turning if (pathinfo($replacement->uri, PATHINFO_EXTENSION) == pathinfo($file->uri, PATHINFO_EXTENSION)) case- insensitive ( file_entity_edit_submit() in ../file_entity.pages.inc)
Of course there will be still the edge-case of jpeg != jpg etc ... but it seems an improvement to me, nonetheless.

Comments

pbattino created an issue.