Vika 2 years ago
committed by GitHub
parent
commit
5e815cda90
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      lib/XRay/Formats/Mf2.php

+ 10
- 0
lib/XRay/Formats/Mf2.php View File

@ -348,6 +348,16 @@ class Mf2 extends Format {
$hcard[$p] = $v;
}
}
// If we have a geo property, it overrides p-latitude and p-longitude
if(array_key_exists('geo', $mf2) &&
self::isMicroformat($mf2['geo'][0]) &&
in_array('h-geo', $mf2['geo'][0]['type']) &&
array_key_exists($mf2['geo'][0]['properties']) &&
$lat=self::getPlaintext($mf2['geo'][0], 'latitude') &&
$lon=self::getPlaintext($mf2['geo'][0], 'longitude')) {
$hcard['latitude'] = $lat;
$hcard['longitude'] = $lon;
}
return $hcard;
}
}

Loading…
Cancel
Save