diff options
Diffstat (limited to 'mod/profile')
-rw-r--r-- | mod/profile/icondirect.php | 6 | ||||
-rw-r--r-- | mod/profile/views/default/profile/details.php | 16 |
2 files changed, 18 insertions, 4 deletions
diff --git a/mod/profile/icondirect.php b/mod/profile/icondirect.php index dbab5d31f..5f1599e0d 100644 --- a/mod/profile/icondirect.php +++ b/mod/profile/icondirect.php @@ -55,13 +55,13 @@ if ($mysql_dblink) { $user_path = date('Y/m/d/', $join_date) . $guid; $filename = "$data_root$user_path/profile/{$guid}{$size}.jpg"; - $size = @filesize($filename); - if ($size) { + $filesize = @filesize($filename); + if ($filesize) { header("Content-type: image/jpeg"); header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', strtotime("+6 months")), true); header("Pragma: public"); header("Cache-Control: public"); - header("Content-Length: $size"); + header("Content-Length: $filesize"); header("ETag: \"$etag\""); readfile($filename); exit; diff --git a/mod/profile/views/default/profile/details.php b/mod/profile/views/default/profile/details.php index 7b05b0e15..da4e95690 100644 --- a/mod/profile/views/default/profile/details.php +++ b/mod/profile/views/default/profile/details.php @@ -21,8 +21,22 @@ if (is_array($profile_fields) && sizeof($profile_fields) > 0) { continue; } $value = $user->$shortname; + if (!empty($value)) { - //This function controls the alternating class + + // fix profile URLs populated by https://github.com/Elgg/Elgg/issues/5232 + // @todo Replace with upgrade script, only need to alter users with last_update after 1.8.13 + if ($valtype == 'url' && $value == 'http://') { + $user->$shortname = ''; + continue; + } + + // 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; ?>"> |