[wp-trac] [WordPress Trac] #62341: A bug in widgets.php - function wp_widget_rss_process

WordPress Trac noreply at wordpress.org
Mon Nov 4 08:27:44 UTC 2024


#62341: A bug in widgets.php - function wp_widget_rss_process
--------------------------+-----------------------------
 Reporter:  korric        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Using a misconfigured Elementor plugin (most probably), we have
 experienced many "Execution time exceeded" errors. Finally, I was able to
 track the the function

 {{{#!php
 function wp_widget_rss_process( $widget_rss, $check_feed = true ) {}
 }}}

 The function retrieves a $link
 (https://core.trac.wordpress.org/browser/tags/6.6.2/src/wp-
 includes/widgets.php#L1800)

 {{{#!php
 $link = esc_url( strip_tags( $rss->get_permalink() ) );
 }}}

 And then it attempts to clean the link
 (https://core.trac.wordpress.org/browser/tags/6.6.2/src/wp-
 includes/widgets.php#L1801):

 {{{#!php
 while ( stristr( $link, 'http' ) !== $link ) {
   $link = substr( $link, 1 );
 }
 }}}

 When the $link does not contain the 'http' string, it ends in an endless
 loop. I do not know yet why the link did not contain the `http` string,
 but it happened. However the endless while loop is an obvious bug in the
 core of wordpress.

 Proposed solution:

 {{{#!php
 while ( strlen($link) > 0 && stristr( $link, 'http' ) !== $link ) {
   $link = substr( $link, 1 );
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62341>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list