Merge pull request #6746 from nupplaphil/issue/6338-notices

Fixing notices
This commit is contained in:
Michael Vogel 2019-02-24 15:44:54 +01:00 committed by GitHub
commit efe358c617
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 15 deletions

View file

@ -505,8 +505,15 @@ class PortableContact
$last_updated = "";
foreach ($entries as $entry) {
$published = DateTimeFormat::utc($xpath->query('atom:published/text()', $entry)->item(0)->nodeValue);
$updated = DateTimeFormat::utc($xpath->query('atom:updated/text()' , $entry)->item(0)->nodeValue);
$published_item = $xpath->query('atom:published/text()', $entry)->item(0);
$updated_item = $xpath->query('atom:updated/text()' , $entry)->item(0);
$published = isset($published_item->nodeValue) ? DateTimeFormat::utc($published_item->nodeValue) : null;
$updated = isset($updated_item->nodeValue) ? DateTimeFormat::utc($updated_item->nodeValue) : null;
if (!isset($published) || !isset($updated)) {
Logger::notice('Invalid entry for XPath.', ['entry' => $entry, 'profile' => $profile]);
continue;
}
if ($last_updated < $published) {
$last_updated = $published;