hhuijser/liferay-portal — pull request #1968 by jonathanmccann (2014-06-24 20:48:34+00:00)
Title: LPS-43773

Hey Hugo,

The logic may seem a bit wonky, but it has to be in order to handle Sergio's use case. With this code, it will work properly for:

test.txt
test.test.txt
test--tempRandomSuffix.txt

Let me know if you have any questions.