Handling of missing array indices added
This commit is contained in:
parent
25eacf6ccc
commit
fe1d222742
@ -184,9 +184,18 @@ class Plugin_PrettyURLs {
|
||||
}
|
||||
|
||||
function handle_entry($matches) {
|
||||
if (PRETTYURLS_TITLES) {
|
||||
if (!PRETTYURLS_TITLES) {
|
||||
$this->fp_params ['entry'] = $matches [1];
|
||||
return;
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
// 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';
|
||||
}
|
||||
|
||||
// isset($this->index[
|
||||
if ($this->cache_get($this->fp_params ['y'], $this->fp_params ['m'], $this->fp_params ['d'], md5($matches [1]))) {
|
||||
$this->fp_params ['entry'] = $this->index [$this->fp_params ['y']] [$this->fp_params ['m']] [$this->fp_params ['d']] [md5($matches [1])];
|
||||
} else {
|
||||
@ -194,9 +203,6 @@ class Plugin_PrettyURLs {
|
||||
// so that at the higher level the system will 404...
|
||||
$this->fp_params ['entry'] = 'a';
|
||||
}
|
||||
} else {
|
||||
$this->fp_params ['entry'] = $matches [1];
|
||||
}
|
||||
}
|
||||
|
||||
function handle_page($matches) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user