From: Stéphane Jacob Date: Mon, 1 Sep 2008 09:38:53 +0000 (+0200) Subject: Helps users to give a proper url on .net (Closes #884). X-Git-Tag: xorg/0.10.0~104 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ffe73cf740db70f44ee64c9f34c59316c510746e;p=platal.git Helps users to give a proper url on .net (Closes #884). --- diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 37c93d2..afe992d 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -237,6 +237,15 @@ class XnetGrpModule extends PLModule if (Post::has('notif_unsub') && Post::i('notif_unsub') == 1) { $flags->addFlag('notif_unsub'); } + $site = trim(Post::v('site')); + if ($site && ($site != "http://")) { + $scheme = parse_url($site, PHP_URL_SCHEME); + if (!$scheme) { + $site = "http://" . $site; + } + } else { + $site = ""; + } if (S::has_perms()) { if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) { $page->trigError("le domaine doit être un FQDN (aucune modif effectuée) !!!"); @@ -252,7 +261,7 @@ class XnetGrpModule extends PLModule WHERE id={?}", Post::v('nom'), Post::v('diminutif'), Post::v('cat'), Post::i('dom'), - Post::v('descr'), Post::v('site'), + Post::v('descr'), $site, Post::v('mail'), Post::v('resp'), Post::v('forum'), Post::v('mail_domain'), Post::has('ax'), Post::v('pub'), @@ -269,7 +278,7 @@ class XnetGrpModule extends PLModule forum={?}, ax={?}, pub= {?}, sub_url={?}, unsub_url={?},flags={?} WHERE id={?}", - Post::v('descr'), Post::v('site'), + Post::v('descr'), $site, Post::v('mail'), Post::v('resp'), Post::v('forum'), Post::has('ax'), Post::v('pub'), diff --git a/templates/xnetgrp/edit.tpl b/templates/xnetgrp/edit.tpl index 470f688..ae9d761 100644 --- a/templates/xnetgrp/edit.tpl +++ b/templates/xnetgrp/edit.tpl @@ -94,7 +94,7 @@ Site web : - +