aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/views
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-03-10 13:22:43 -0400
committerCash Costello <cash.costello@gmail.com>2013-03-10 13:22:43 -0400
commite9f710c18089489c402cae23fbac71c0b7283824 (patch)
tree2c1e54fc231e6ce79c635c2bf554634631d6c7fd /mod/profile/views
parented7210a35f3367bf6325ec805fcc7cad01f94c4c (diff)
downloadelgg-e9f710c18089489c402cae23fbac71c0b7283824.tar.gz
elgg-e9f710c18089489c402cae23fbac71c0b7283824.tar.bz2
validate url on profile display
Diffstat (limited to 'mod/profile/views')
-rw-r--r--mod/profile/views/default/profile/details.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/mod/profile/views/default/profile/details.php b/mod/profile/views/default/profile/details.php
index 7b05b0e15..167f995ae 100644
--- a/mod/profile/views/default/profile/details.php
+++ b/mod/profile/views/default/profile/details.php
@@ -21,6 +21,12 @@ if (is_array($profile_fields) && sizeof($profile_fields) > 0) {
continue;
}
$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
$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';