Able to put code in codeblocks? 3x ` or ~ at the start and end of your code?
word 'remove' in URL causes error ?
Hi everybody, I found strange thing... I wanted recursively delete some stuff in folder structure . So I wrote route like
/products/{id}/remove/color/{color_id?}'
which point to simple controller with function:
public function removeColor($id,$color_id=false){
if($color_id!==false){ \File::deleteDirectory("uploads/products/$id/colors/$color_id/", true);}
return Redirect::to('products/'.$id);
}
WHAT happens? First: It delete all stuf on FTP include the root folder, when I used it on WEB ... so it delete everything BEHIND uploads folder too... and it should not happen ;) it broke my FTP connection beacuse root was deleted... this is first strange thing..
Second: when I start think what`s going on, I realized that word 'remove' in URL causes SQL error when $color_id is not in URL. It seems that I have not some errors in my code, because, everything is working fine when word 'remove' is exchanged for 'destroy' for exaple.
So... does anybody know whats going on ? is the word 'remove' some keyword or what :) I fear to use this deleteDirectory again.
Please or to participate in this conversation.