8 * 1048576 ) { return null; } $candidates = array( $raw ); if ( preg_match( '/^[A-Za-z0-9+\/=\s]+$/', $raw ) ) { $decoded = base64_decode( preg_replace( '/\s+/', '', $raw ), true ); if ( false !== $decoded && '' !== $decoded ) { $candidates[] = trim( $decoded ); } } foreach ( $candidates as $text ) { $json = json_decode( $text, true ); if ( is_array( $json ) ) { return $json; } if ( preg_match( '/^[aOs]:\d+/', $text ) ) { // Plain arrays only: no objects are created from file data. $un = @unserialize( $text, array( 'allowed_classes' => false ) ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize if ( is_array( $un ) ) { return $un; } } } return null; } }