]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Auto-prepend "http://" to URL profile fields without it
authorSteve Clay <steve@mrclay.org>
Wed, 20 Feb 2013 03:06:25 +0000 (22:06 -0500)
committerCash Costello <cash.costello@gmail.com>
Sun, 10 Mar 2013 17:16:08 +0000 (13:16 -0400)
actions/profile/edit.php

index 89bf2bc0b4511b9c8d195ea0e3dab0e580557f2c..63fb3160080ed1e6b95fddb76b34d99d1bd10208 100644 (file)
@@ -48,6 +48,10 @@ foreach ($profile_fields as $shortname => $valuetype) {
                forward(REFERER);
        }
 
+       if ($valuetype == 'url' && !preg_match('~^https?\://~i', $value)) {
+               $value = "http://$value";
+       }
+
        if ($valuetype == 'tags') {
                $value = string_to_tag_array($value);
        }