Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 20d387a

Browse files
author
Matthias Pfefferle
committed
fixed some warnings
1 parent bc36a3c commit 20d387a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

includes/class-linkbacks-mf2-handler.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public static function generate_commentdata( $commentdata ) {
264264
// Check for person tagging
265265
if ( isset( $properties['category'] ) ) {
266266
if ( in_array( $commentdata['target'], $properties['category'], true ) ) {
267-
$commentdata['category'] = array( $commentdata['target'] );
267+
$commentdata['category'] = array( $commentdata['target'] );
268268
}
269269
}
270270

@@ -370,7 +370,8 @@ public static function flatten_microformats( $item ) {
370370
$properties = $item['properties'];
371371
foreach ( $properties as $key => $value ) {
372372
$flat[ $key ] = self::get_property( $key, $properties );
373-
if ( 1 < count( $flat[ $key ] ) ) {
373+
374+
if ( ! is_string( $flat[ $key ] ) && 1 < count( $flat[ $key ] ) ) {
374375
$flat[ $key ] = self::flatten_microformats( $flat[ $key ] );
375376
}
376377
}
@@ -603,6 +604,9 @@ public static function compare_urls( $needle, $haystack, $schemeless = true ) {
603604
if ( ! self::is_url( $needle ) ) {
604605
return false;
605606
}
607+
if ( is_array( reset( $haystack ) ) ) {
608+
return false;
609+
}
606610
if ( true === $schemeless ) {
607611
// remove url-scheme
608612
$schemeless_target = preg_replace( '/^https?:\/\//i', '', $needle );

0 commit comments

Comments
 (0)