Now not adding http:// to empty URLs.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 27 Feb 2018 19:21:18 +0000 (14:21 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 27 Feb 2018 19:21:18 +0000 (14:21 -0500)
classes/data/dataEvents.php

index 382ab5c..4aebbc4 100644 (file)
@@ -500,9 +500,15 @@ class GlmDataEvents extends GlmDataAbstract
     {
 
         // Check that URLs have http:// in front of them.
-        if (isset($r['url']) && strtolower(substr($r['url'],0,4)) != 'http') {
+        if (isset($r['url']) && strlen(trim($r['url'])) > 0  && strtolower(substr($r['url'],0,4)) != 'http') {
             $r['url'] = 'http://'.$r['url'];
         }
+        if (isset($r['ticket_url']) && strlen(trim($r['ticket_url'])) > 0  && strtolower(substr($r['ticket_url'],0,4)) != 'http') {
+            $r['ticket_url'] = 'http://'.$r['ticket_url'];
+        }
+        if (isset($r['registration_url']) && strlen(trim($r['registration_url'])) > 0  && strtolower(substr($r['registration_url'],0,4)) != 'http') {
+            $r['registration_url'] = 'http://'.$r['registration_url'];
+        }
         
         // Get Member Category data for this entry
         if ($this->postCategories) {