aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/profile/edit.php2
-rw-r--r--mod/profile/views/default/profile/details.php12
2 files changed, 7 insertions, 7 deletions
diff --git a/actions/profile/edit.php b/actions/profile/edit.php
index 63fb31600..b817463ac 100644
--- a/actions/profile/edit.php
+++ b/actions/profile/edit.php
@@ -48,7 +48,7 @@ foreach ($profile_fields as $shortname => $valuetype) {
forward(REFERER);
}
- if ($valuetype == 'url' && !preg_match('~^https?\://~i', $value)) {
+ if ($value && $valuetype == 'url' && !preg_match('~^https?\://~i', $value)) {
$value = "http://$value";
}
diff --git a/mod/profile/views/default/profile/details.php b/mod/profile/views/default/profile/details.php
index 167f995ae..15df6c2fd 100644
--- a/mod/profile/views/default/profile/details.php
+++ b/mod/profile/views/default/profile/details.php
@@ -22,13 +22,13 @@ if (is_array($profile_fields) && sizeof($profile_fields) > 0) {
}
$value = $user->$shortname;
- // validate urls
- if ($valtype == 'url' && !preg_match('~^https?\://~i', $value)) {
- $value = "http://$value";
- }
-
if (!empty($value)) {
- //This function controls the alternating class
+ // validate urls
+ if ($valtype == 'url' && !preg_match('~^https?\://~i', $value)) {
+ $value = "http://$value";
+ }
+
+ // this controls the alternating class
$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
?>
<div class="<?php echo $even_odd; ?>">