@@ -100,11 +100,10 @@ public static function get_rel_mapper() {
100100 * generate the comment data from the microformatted content
101101 *
102102 * @param WP_Comment $commentdata the comment object
103- * @param string $target the target url
104103 *
105104 * @return array
106105 */
107- public static function generate_commentdata ( $ commentdata, $ target ) {
106+ public static function generate_commentdata ( $ commentdata ) {
108107 global $ wpdb ;
109108
110109 // add source
@@ -122,7 +121,7 @@ public static function generate_commentdata( $commentdata, $target ) {
122121 }
123122
124123 // get the entry of interest
125- $ entry = self ::get_representative_entry ( $ entries , $ target );
124+ $ entry = self ::get_representative_entry ( $ entries , $ commentdata [ ' target ' ] );
126125
127126 if ( empty ( $ entry ) ) {
128127 return array ();
@@ -191,7 +190,7 @@ public static function generate_commentdata( $commentdata, $target ) {
191190 $ commentdata ['comment_meta ' ]['semantic_linkbacks_type ' ] = wp_slash ( 'rsvp: ' . $ properties ['rsvp ' ][0 ] );
192191 } else {
193192 // get post type
194- $ commentdata ['comment_meta ' ]['semantic_linkbacks_type ' ] = wp_slash ( self ::get_entry_type ( $ target , $ entry , $ mf_array ) );
193+ $ commentdata ['comment_meta ' ]['semantic_linkbacks_type ' ] = wp_slash ( self ::get_entry_type ( $ commentdata [ ' target ' ] , $ entry , $ mf_array ) );
195194 }
196195
197196 return $ commentdata ;
@@ -406,6 +405,9 @@ public static function check_mf_attr( $key, $node ) {
406405 * @return boolean
407406 */
408407 public static function compare_urls ( $ needle , $ haystack , $ schemeless = true ) {
408+ if ( ! is_string ( $ needle ) || ! is_array ( $ haystack ) ) {
409+ return false ;
410+ }
409411 if ( true === $ schemeless ) {
410412 // remove url-scheme
411413 $ schemeless_target = preg_replace ( '/^https?:\/\//i ' , '' , $ needle );
0 commit comments