From 8bbaf52fd9684aee59b19025a29933a25d399ece Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Fri, 15 Nov 2024 12:30:09 +0530 Subject: [PATCH] Check if the image exists in the folder --- inc/server/class-dynamic-content-server.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/server/class-dynamic-content-server.php b/inc/server/class-dynamic-content-server.php index eccc1758a..db8b8093c 100644 --- a/inc/server/class-dynamic-content-server.php +++ b/inc/server/class-dynamic-content-server.php @@ -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;