sunhater / kcfinder

KCFinder web file manager
http://kcfinder.sunhater.com
403 stars 207 forks source link

symbolic links #77

Open jgpATs2w opened 9 years ago

jgpATs2w commented 9 years ago

this issue is the continuation of https://github.com/sunhater/kcfinder/issues/30

Scenario

In uploader->checkFilePath realpath resolves the symbolic link to its linked folder and returns false, producing an 'Unknow error'.

Solution

Changing the initial declaration of $this->typeDir on the uploader's constructor, to set the 'real path' does the trick for me. In my code I've changed lines 224, 232 and 243 of core/class/uploader.php from $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; to $this->typeDir = realpath("{$this->config['uploadDir']}/{$this->type}");

It's working, but could this have any undesired effect??

lfglopes commented 9 years ago

Same issue over here. Thanks for the workaround. If problems arise i'll let you know :-)