@@ -1047,7 +1047,9 @@ public function parseH(\DOMElement $e, $is_backcompat = false, $has_nested_mf =
1047
1047
1048
1048
// Do we need to imply a name property?
1049
1049
// if no explicit "name" property, and no other p-* or e-* properties, and no nested microformats,
1050
- if (!array_key_exists ('name ' , $ return ) && !in_array ('p- ' , $ prefixes ) && !in_array ('e- ' , $ prefixes ) && !$ has_nested_mf && !$ is_backcompat ) {
1050
+ if (!array_key_exists ('name ' , $ return ) && !in_array ('p- ' , $ prefixes )
1051
+ && !in_array ('e- ' , $ prefixes ) && !$ has_nested_mf
1052
+ && !$ is_backcompat && empty ($ this ->upgraded [$ e ])) {
1051
1053
$ name = false ;
1052
1054
// img.h-x[alt] or area.h-x[alt]
1053
1055
if (($ e ->tagName === 'img ' || $ e ->tagName === 'area ' ) && $ e ->hasAttribute ('alt ' )) {
@@ -1384,7 +1386,7 @@ public function parse_recursive(DOMElement $context = null, $depth = 0) {
1384
1386
$ recurse = $ this ->parse_recursive ($ node , $ depth + 1 );
1385
1387
1386
1388
// set bool flag for nested mf
1387
- $ has_nested_mf = ($ recurse) ;
1389
+ $ has_nested_mf = (bool ) $ recurse ;
1388
1390
1389
1391
// parse for root mf
1390
1392
$ result = $ this ->parseH ($ node , $ is_backcompat , $ has_nested_mf );
@@ -1800,7 +1802,8 @@ public function query($expression, $context = null) {
1800
1802
'replace ' => 'p-label '
1801
1803
),
1802
1804
'geo ' => array (
1803
- 'replace ' => 'p-geo h-geo '
1805
+ 'replace ' => 'p-geo h-geo ' ,
1806
+ 'context ' => 'geo '
1804
1807
),
1805
1808
'latitude ' => array (
1806
1809
'replace ' => 'p-latitude '
0 commit comments