redirect_uris can end up with trailing \r or blank entries
The html textarea can be submitted with \r\n and not just \n. So when it is split by \n, the redirect_uris other than first can end up with a trailing \r in the database which makes them invalid.
Additionally, if the textarea is submitted trailing newlines, additional empty redirect_uris can be added to the database.