| @@ -116,9 +116,9 @@ | ||
| 116 | 116 | global $wpdb; |
| 117 | 117 | $post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'rank_math_robots'" ); |
| 118 | 118 | foreach ( $post_metas as $post_meta ) { |
| 119 | 119 | // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- Reason: We can't control the form in which Rankmath sends the data. |
| 120 | - $robots_values = unserialize( $post_meta->meta_value ); | |
| 120 | + $robots_values = unserialize( $post_meta->meta_value, [ 'allowed_classes' => false ] ); | |
| 121 | 121 | foreach ( [ 'noindex', 'nofollow' ] as $directive ) { |
| 122 | 122 | $directive_key = array_search( $directive, $robots_values, true ); |
| 123 | 123 | if ( $directive_key !== false ) { |
| 124 | 124 | update_post_meta( $post_meta->post_id, '_yoast_wpseo_meta-robots-' . $directive, 1 ); |