File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -883,9 +883,10 @@ function display_rich_snippet( $content ) {
883883 $ datetime = new DateTime ( $ video_date , new DateTimeZone ( $ timezone ) ); // Set the timezone to the server's timezone.
884884 $ uploadDate = $ datetime ->format ( 'd-m-Y\TH:i:sP ' ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
885885 } catch ( Exception $ e ) {
886- // Translators: %s is the error message from the exception.
887- echo esc_html ( sprintf ( __ ( 'Error creating DateTime object: %s ' , 'rich-snippets ' ), esc_html ( $ e ->getMessage () ) ) );
888- return ;
886+ // Log the error instead of displaying it to frontend visitors.
887+ // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
888+ error_log ( 'AIOSRS: Error creating DateTime object: ' . $ e ->getMessage () );
889+ return $ content ;
889890 }
890891 }
891892 }
Original file line number Diff line number Diff line change @@ -669,7 +669,7 @@ function bsf_oembed_ajax_results() {
669669 $ fallback = $ wp_embed ->maybe_make_link ( $ oembed_url );
670670 if ( $ check_embed && $ check_embed != $ fallback ) {
671671 // Embed data.
672- $ return = '<div class="embed_status"> ' . $ check_embed . '<a href="#" class="bsf_remove_file_button" rel=" ' . esc_attr ( $ _REQUEST ['field_id ' ] ) . '"> ' . __ ( 'Remove Embed ' , 'rich-snippets ' ) . '</a></div> ' ;
672+ $ return = '<div class="embed_status"> ' . $ check_embed . '<a href="#" class="bsf_remove_file_button" rel=" ' . esc_attr ( sanitize_text_field ( wp_unslash ( $ _REQUEST ['field_id ' ] ) ) ) . '"> ' . __ ( 'Remove Embed ' , 'rich-snippets ' ) . '</a></div> ' ;
673673 // set our response id.
674674 $ found = 'found ' ;
675675 } else {
You can’t perform that action at this time.
0 commit comments