Better handling of user-entered URLs (add http:// if missing)
This commit is contained in:
+1
-1
@@ -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>
|
||||
|
||||
@@ -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", "");
|
||||
|
||||
Reference in New Issue
Block a user