From 73ad38388be4b8f6c9b9623ad542d081701e02da Mon Sep 17 00:00:00 2001
From: Chuck Scott
Date: Thu, 16 Nov 2017 09:36:14 -0500
Subject: [PATCH] Fixes for Data Abstract crypt password when no password
supplied, source code spacing in front.php, and layout in hooks.help
---
controllers/front.php | 19 ++++++++-----------
lib/GlmDataAbstract/DataAbstract.php | 2 +-
views/admin/management/hooks.html | 4 ++--
3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/controllers/front.php b/controllers/front.php
index 73575238..50a46173 100644
--- a/controllers/front.php
+++ b/controllers/front.php
@@ -639,20 +639,17 @@ class glmMembersFront extends GlmPluginSupport
date_default_timezone_set($defaultTimeZone);
-// If we have a cache code, then this is a top-level caching request
-if ($cache_code) {
-
- // Cache this request page content
- $sql = $this->wpdb->prepare("INSERT INTO ".GLM_MEMBERS_PLUGIN_DB_PREFIX."cache (shortcode, cache_code, created, html) VALUES (%s, %s, now(), %s);", $shortcode, $cache_code, $out);
- $this->wpdb->query($sql);
-
- // Mark cache control as complete
- $GLOBALS['cache_control']['complete'] = true;
-
-}
+ // If we have a cache code, then this is a top-level caching request
+ if ($cache_code) {
+ // Cache this request page content
+ $sql = $this->wpdb->prepare("INSERT INTO ".GLM_MEMBERS_PLUGIN_DB_PREFIX."cache (shortcode, cache_code, created, html) VALUES (%s, %s, now(), %s);", $shortcode, $cache_code, $out);
+ $this->wpdb->query($sql);
+ // Mark cache control as complete
+ $GLOBALS['cache_control']['complete'] = true;
+ }
return $out;
diff --git a/lib/GlmDataAbstract/DataAbstract.php b/lib/GlmDataAbstract/DataAbstract.php
index ebde834c..a7a0e86a 100644
--- a/lib/GlmDataAbstract/DataAbstract.php
+++ b/lib/GlmDataAbstract/DataAbstract.php
@@ -1385,7 +1385,7 @@ $forEdit = true;
// Don't try to crypt a blank password
$c = '';
if ($in != '') {
- $c = crypt($in);
+ $c = password_hash($in, PASSWORD_DEFAULT);
}
return $c;
diff --git a/views/admin/management/hooks.html b/views/admin/management/hooks.html
index 3b06a58e..d05b96d6 100644
--- a/views/admin/management/hooks.html
+++ b/views/admin/management/hooks.html
@@ -9,8 +9,8 @@
content on this page.
-
- Hook | Type | Added Parameters | Description |
+
+ Hook | Type | Added Parameters | Description |
{apply_filters('glm-member-db-admin-management-hooksHelp', '')}
--
2.17.1