The search within folder will escape a single " character, but folders allow for using more than one in the name and the rest are not escaped being injected into the search syntax and breaking the ability to return any results
Here is an example where I can inject another search query by naming a folder like this, now I get all results in the entire repository with the letter a in the name if I only run a search within this folder. Not that it is a security issue since you still need to rights to see what you search for.
"New Folder "} | {LF:name="*a*", Type="DFS