Fix for #76: Check date array for expected format.

Also: Fixed autocompletion mess-up in plugin.prettyurls.php -_-
This commit is contained in:
azett 2021-02-28 12:11:01 +01:00
parent 1030f1605d
commit 0ceec7a50f
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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';