From: martin Date: Wed, 4 Sep 2002 05:07:17 +0000 (+0000) Subject: Better handling of user-entered URLs (add http:// if missing) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ef9955b08184e51d95beb3be3c4ef65559318bfe;p=moodle.git Better handling of user-entered URLs (add http:// if missing) --- diff --git a/user/edit.html b/user/edit.html index e21de03775..290527ff59 100644 --- a/user/edit.html +++ b/user/edit.html @@ -80,7 +80,7 @@ if (isadmin()) {

: - + diff --git a/user/edit.php b/user/edit.php index 106a0b5409..85f2d98fe8 100644 --- a/user/edit.php +++ b/user/edit.php @@ -122,6 +122,9 @@ error("You can not change the password like that"); } } + if ($usernew->url and !(substr($usernew->url, 0, 4) == "http")) { + $usernew->url = "http://".$usernew->url; + } if (update_record("user", $usernew)) { add_to_log($course->id, "user", "update", "view.php?id=$user->id&course=$course->id", "");