From f2cec61165cc099a0e6b57af19c575f005ffcb45 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 8 Mar 2018 13:59:03 -0500 Subject: [PATCH] Make sure social url's have http If not empty make sure the url's at least start with http:// --- classes/data/dataSocialUrls.php | 6 ++++++ index.php | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/classes/data/dataSocialUrls.php b/classes/data/dataSocialUrls.php index 937fe9c..ae38fc0 100644 --- a/classes/data/dataSocialUrls.php +++ b/classes/data/dataSocialUrls.php @@ -231,6 +231,12 @@ class GlmDataSocialUrls extends GlmDataAbstract */ public function entryPostProcessing($r, $a) { + + // Check that URLs have http:// in front of them. + if (isset($r['url']) && strlen(trim($r['url'])) > 0 && strtolower(substr($r['url'],0,4)) != 'http') { + $r['url'] = 'http://'.$r['url']; + } + return $r; } diff --git a/index.php b/index.php index 059df85..968abfa 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Social * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.1.0 + * Version: 1.1.1 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -35,7 +35,7 @@ * @package glmMembersDatabaseSocialAddOn * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.1.0 + * @version 1.1.1 */ /* @@ -53,7 +53,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_SOCIAL_PLUGIN_VERSION', '1.1.0'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_VERSION', '1.1.1'); define('GLM_MEMBERS_SOCIAL_PLUGIN_DB_VERSION', '0.0.3'); // This is the minimum version of the GLM Members DB plugin require for this plugin. -- 2.17.1