Better handling of user-entered URLs (add http:// if missing)

This commit is contained in:
martin
2002-09-04 05:07:17 +00:00
parent 5e391d346d
commit ef9955b081
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ if (isadmin()) {
</tr>
<tr valign=top>
<td><P><? print_string("webpage") ?>:</td>
<td><input type="text" name="url" size=30 value="<? p($user->url) ?>">
<td><input type="text" name="url" size=50 value="<? p($user->url) ?>">
<? formerr($err["url"]) ?>
</td>
</tr>
+3
View File
@@ -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", "");