fixed url_encode when raw is false and URL is an array

alternative for #1388