]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Auto-fixes profile URLs broken by #5232
authorSteve Clay <steve@mrclay.org>
Thu, 21 Mar 2013 14:48:20 +0000 (10:48 -0400)
committerSteve Clay <steve@mrclay.org>
Thu, 21 Mar 2013 14:48:20 +0000 (10:48 -0400)
mod/profile/views/default/profile/details.php

index 15df6c2fd2aa10892660930fe1867177a4022e1a..da4e95690f865a252520ecf50af0240a1455b0ba 100644 (file)
@@ -23,6 +23,14 @@ if (is_array($profile_fields) && sizeof($profile_fields) > 0) {
                $value = $user->$shortname;
 
                if (!empty($value)) {
+
+                       // 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";