Fix renaming using parenthesis using the same logic that in js ref #1917

try to upload twice a file with a (...) in the name and oc will fail :) ( ref #1917 )

this tries to fix it... i tried to use the same logic than on the client...

what do you think?