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;