Trimming url
Added empty() and strlen check to validation