error msg added and 1 regex secured

s/^http/https/ could possibly change a "https:" to "httpss:". Since you probably don't want that, take the ":" into the match. The other direction should be ok though.