From 0ceec7a50f5c8fcbbe27039618de29b829cbf77d Mon Sep 17 00:00:00 2001 From: azett Date: Sun, 28 Feb 2021 12:11:01 +0100 Subject: [PATCH] Fix for #76: Check date array for expected format. Also: Fixed autocompletion mess-up in plugin.prettyurls.php -_- --- fp-plugins/commentcenter/plugin.commentcenter.php | 4 ++++ fp-plugins/prettyurls/plugin.prettyurls.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fp-plugins/commentcenter/plugin.commentcenter.php b/fp-plugins/commentcenter/plugin.commentcenter.php index 626d0a4..45b5e56 100644 --- a/fp-plugins/commentcenter/plugin.commentcenter.php +++ b/fp-plugins/commentcenter/plugin.commentcenter.php @@ -333,6 +333,10 @@ class plugin_commentcenter { */ function behavoirFromPolicies($entry, $cats = array()) { $date = date_from_id($entry); + // check if $date is in expected format + if (!array_key_exists('time', $date)) { + return -1; + } $time = $date ['time']; $return = 1; $pols = &$this->policies; diff --git a/fp-plugins/prettyurls/plugin.prettyurls.php b/fp-plugins/prettyurls/plugin.prettyurls.php index f363ae6..3890a51 100644 --- a/fp-plugins/prettyurls/plugin.prettyurls.php +++ b/fp-plugins/prettyurls/plugin.prettyurls.php @@ -190,7 +190,7 @@ class Plugin_PrettyURLs { } // data is not as expected - if (!array_karray_key_exists('y', $this->fp_params) || !array_karray_key_exists('m', $this->fp_params) || !array_karray_key_exists('d', $this->fp_params)) { + if (!array_key_exists('y', $this->fp_params) || !array_key_exists('m', $this->fp_params) || !array_key_exists('d', $this->fp_params)) { // a bit hackish: we make up a fake url when there is no match, // so that at the higher level the system will 404... $this->fp_params ['entry'] = 'a';