Fix PHP Warning when "contributor" is NULL
This commit is contained in:
parent
66f74305f7
commit
0c13153d8e
1 changed files with 10 additions and 8 deletions
18
action.php
18
action.php
|
@ -99,14 +99,16 @@ class action_plugin_semantic extends DokuWiki_Action_Plugin {
|
|||
'email' => $user_data['mail']
|
||||
);
|
||||
|
||||
foreach ($meta['contributor'] as $uid => $fullname) {
|
||||
$contributor_data = $auth->getUserData($uid);
|
||||
$json_ld['contributor'][] = array(
|
||||
'@context' => 'http://schema.org',
|
||||
'@type' => 'Person',
|
||||
'name' => $fullname,
|
||||
'email' => $contributor_data['mail']
|
||||
);
|
||||
if (isset($meta['contributor'])) {
|
||||
foreach ($meta['contributor'] as $uid => $fullname) {
|
||||
$contributor_data = $auth->getUserData($uid);
|
||||
$json_ld['contributor'][] = array(
|
||||
'@context' => 'http://schema.org',
|
||||
'@type' => 'Person',
|
||||
'name' => $fullname,
|
||||
'email' => $contributor_data['mail']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue