Update BaseController.php

urlencode expects a string; not an object ... 
this is the good fix