Fixes #5064

Check for $params['url'] to be set before assigning
Add test case for #5064

Refs #5069
Merge branch 'router-fix' into 1.3

Closes #5069