Skip to content

Commit

Permalink
Check if the image exists in the folder
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Nov 15, 2024
1 parent 1ac9cae commit 8bbaf52
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions inc/server/class-dynamic-content-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public function get( $request ) {

$fallback = sanitize_text_field( $fallback );
$feedback_full_path = realpath( $fallback );
$feedback_full_path = str_contains( $feedback_full_path, WP_CONTENT_DIR );

if ( false !== $feedback_full_path && @getimagesize( $fallback ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
$path = $feedback_full_path;
Expand Down

0 comments on commit 8bbaf52

Please sign in to comment.