Prevent PHP warnings triggered by trying to fetch unset array entries
This commit is contained in:
parent
77a903816c
commit
047a5be134
1 changed files with 5 additions and 2 deletions
|
@ -93,10 +93,13 @@ class action_plugin_childrenpages extends DokuWiki_Action_Plugin {
|
|||
$language = $translation_plugin->getLangPart($INFO['id']);
|
||||
}
|
||||
// Skip top-level language namespace if one is in use
|
||||
$namespace = explode(':', $INFO['namespace']);
|
||||
if ( $language !== null && preg_match("/^$language:/", $INFO['id']) ) {
|
||||
return explode(':', $INFO['namespace'])[1];
|
||||
// FIXME: $namespace is sometimes shorter than expected,
|
||||
// this might be the symptom of some bug.
|
||||
return ( count($namespace) > 1 ) ? $namespace[1] : null;
|
||||
} else {
|
||||
return explode(':', $INFO['namespace'])[0];
|
||||
return $namespace[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue