Fix for #76: Check date array for expected format.
Also: Fixed autocompletion mess-up in plugin.prettyurls.php -_-
This commit is contained in:
parent
1030f1605d
commit
0ceec7a50f
@ -333,6 +333,10 @@ class plugin_commentcenter {
|
|||||||
*/
|
*/
|
||||||
function behavoirFromPolicies($entry, $cats = array()) {
|
function behavoirFromPolicies($entry, $cats = array()) {
|
||||||
$date = date_from_id($entry);
|
$date = date_from_id($entry);
|
||||||
|
// check if $date is in expected format
|
||||||
|
if (!array_key_exists('time', $date)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
$time = $date ['time'];
|
$time = $date ['time'];
|
||||||
$return = 1;
|
$return = 1;
|
||||||
$pols = &$this->policies;
|
$pols = &$this->policies;
|
||||||
|
@ -190,7 +190,7 @@ class Plugin_PrettyURLs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// data is not as expected
|
// 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,
|
// a bit hackish: we make up a fake url when there is no match,
|
||||||
// so that at the higher level the system will 404...
|
// so that at the higher level the system will 404...
|
||||||
$this->fp_params ['entry'] = 'a';
|
$this->fp_params ['entry'] = 'a';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user