wiremod / advdupe2

Advanced Duplicator 2
http://wiremod.com
Apache License 2.0
90 stars 60 forks source link

Dupe names cut off everything after the first space #379

Closed legokidlogan closed 2 years ago

legokidlogan commented 3 years ago

When the server receives a dupe file as it's uploaded, the first space and everything after it will be stripped out from the dupe's name, so a file called some dupe becomes some. This causes the name to get truncated in undo history, AdvDupe2NotifyPaste, any AdvDupe2 logging systems the server may have, and anything else which might use the name serverside.

To fix this, the pattern would simply need to be changed to ([%w%s_]+) or ([%w_ ]+). Even though the player can't save files with spaces at the start or end of the name, a simple string.Trim() before running the pattern would clear out any spaces at the start and end, if this was originally intended to just remove excess whitespace.

https://github.com/wiremod/advdupe2/blob/c1195c7f61b271f477f2ec68d50aae73f2f45e02/lua/advdupe2/sv_file.lua#L116-L122