Add check for http in url
authorSteve Sutton <ssutton@gmail.com>
Sat, 10 Mar 2018 14:17:06 +0000 (09:17 -0500)
committerSteve Sutton <ssutton@gmail.com>
Sat, 10 Mar 2018 14:17:06 +0000 (09:17 -0500)
When updating or outputting the invoice_url make sure there's http in
front.

classes/data/dataSettings.php

index 803472c..5c97ed0 100644 (file)
@@ -229,6 +229,10 @@ class GlmDataBillingSettings extends GlmDataAbstract
      */
     public function entryPostProcessing($r, $a)
     {
+        // Check that URLs have http:// in front of them.
+        if (isset($r['company_url']) && strlen(trim($r['company_url'])) > 0  && strtolower(substr($r['company_url'],0,4)) != 'http') {
+            $r['company_url'] = 'http://'.$r['company_url'];
+        }
         return $r;
     }