Exploit databaseDownload repository ZIP
GH-6619317e0cd9902e082b21d2f8f16c38
daniel616/cve-2022-21661-demo
Sources for CVE-2022-21661
10 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files93
daniel616/cve-2022-21661-demoRevision 5478a08b2d12
- ↑..Parent directory
- archives/
- audio/
- block/
- button/
- buttons/
- calendar/
- categories/
- code/
- column/
- columns/
- cover/
- embed/
- file/
- freeform/
- gallery/
- group/
- heading/
- html/
- image/
- latest-comments/
- latest-posts/
- legacy-widget/
- list/
- loginout/
- media-text/
- missing/
- more/
- nextpage/
- page-list/
- paragraph/
- post-content/
- post-date/
- post-excerpt/
- post-featured-image/
- post-template/
- post-terms/
- post-title/
- preformatted/
- pullquote/
- query/
- query-pagination/
- query-pagination-next/
- query-pagination-numbers/
- query-pagination-previous/
- query-title/
- quote/
- rss/
- search/
- separator/
- shortcode/
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/wp-includes/blocks/post-content.php
PHP · 1,885 bytes<?php
/**
* Server-side rendering of the `core/post-content` block.
*
* @package WordPress
*/
/**
* Renders the `core/post-content` block on the server.
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
* @return string Returns the filtered post content of the current post.
*/
function render_block_core_post_content( $attributes, $content, $block ) {
static $seen_ids = array();
if ( ! isset( $block->context['postId'] ) ) {
return '';
}
$post_id = $block->context['postId'];
if ( isset( $seen_ids[ $post_id ] ) ) {
// WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
// is set in `wp_debug_mode()`.
$is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG &&
defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY;
return $is_debug ?
// translators: Visible only in the front end, this warning takes the place of a faulty block.
__( '[block rendering halted]' ) :
'';
}
$seen_ids[ $post_id ] = true;
if ( ! in_the_loop() && have_posts() ) {
the_post();
}
$content = get_the_content( null, false, $post_id );
/** This filter is documented in wp-includes/post-template.php */
$content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
unset( $seen_ids[ $post_id ] );
if ( empty( $content ) ) {
return '';
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) );
return (
'<div ' . $wrapper_attributes . '>' .
$content .
'</div>'
);
}
/**
* Registers the `core/post-content` block on the server.
*/
function register_block_core_post_content() {
register_block_type_from_metadata(
__DIR__ . '/post-content',
array(
'render_callback' => 'render_block_core_post_content',
)
);
}
add_action( 'init', 'register_block_core_post_content' );