Verify whether the URL is valid
Verify whether the URL is valid

Required for https://github.com/owncloud/mail/pull/100#issuecomment-50266017

@karlitschek Backport for stable6 and stable7 requested.
lrytz/core,xx621998xx/server,jbicha/server,jbicha/server,michaelletzgus/nextcloud-server,owncloud/core,owncloud/core,endsguy/server,jbicha/server,bluelml/core,IljaN/core,lrytz/core,pollopolea/core,xx621998xx/server,whitekiba/server,andreas-p/nextcloud-server,lrytz/core,sharidas/core,Ardinis/server,andreas-p/nextcloud-server,whitekiba/server,pollopolea/core,IljaN/core,lrytz/core,whitekiba/server,cernbox/core,pixelipo/server,whitekiba/server,owncloud/core,pixelipo/server,pixelipo/server,jbicha/server,Ardinis/server,cernbox/core,endsguy/server,Ardinis/server,andreas-p/nextcloud-server,xx621998xx/server,bluelml/core,bluelml/core,IljaN/core,sharidas/core,pmattern/server,cernbox/core,andreas-p/nextcloud-server,nextcloud/server,pmattern/server,pmattern/server,michaelletzgus/nextcloud-server,andreas-p/nextcloud-server,jbicha/server,sharidas/core,IljaN/core,owncloud/core,bluelml/core,pmattern/server,pollopolea/core,pmattern/server,lrytz/core,nextcloud/server,cernbox/core,xx621998xx/server,endsguy/server,michaelletzgus/nextcloud-server,Ardinis/server,endsguy/server,Ardinis/server,owncloud/core,pixelipo/server,phil-davis/core,michaelletzgus/nextcloud-server,pixelipo/server,IljaN/core,nextcloud/server,nextcloud/server,endsguy/server,bluelml/core,sharidas/core,cernbox/core,whitekiba/server,sharidas/core,xx621998xx/server,pollopolea/core,pollopolea/core