Ensuring Base url validaty in general settings

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2011-03-18 13:27:23 -07:00
parent 18a31ad194
commit 8bf4be6921

View File

@@ -77,7 +77,7 @@ namespace Orchard.Core.Settings.Drivers {
// ensure the base url is absolute if provided
if (!String.IsNullOrWhiteSpace(model.Site.BaseUrl)) {
if (!model.Site.BaseUrl.ToLower().StartsWith("http")) {
if (!Uri.IsWellFormedUriString(model.Site.BaseUrl, UriKind.Absolute)) {
updater.AddModelError("BaseUrl", T("The base url must be absolute."));
}
// if the base url has been modified, try to ping it