josegonzalez/cakephp-upload — pull request #181 by Maff- (2013-12-20 17:03:26+00:00)
Title: Properly escape dir field

I had some trouble using this plugin on my Windows dev machine, when having the pathMethod set to random or randomCombined. It basically uploads the files properly, and are placed in the right spot, but the 'dir' fields would not be saved correctly (missing slashes and/or zeros).

As is turns out the dir field isn't properly escaped in `UploadBehavior::afterSave`. Previous code would only wrap the field with `'`, not escape backslashes (used as DS on windows).

I'm just starting to use unit tests :sweat_smile:, so hopefully this addition update is okay.