[wp-trac] [WordPress Trac] #48973: wp_text_diff() out of memory with 10GB memory limit on certain revisions

WordPress Trac noreply at wordpress.org
Sat Dec 14 16:33:35 UTC 2019


#48973: wp_text_diff() out of memory with 10GB memory limit on certain revisions
----------------------------+-----------------------------
 Reporter:  justjack1       |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Revisions       |    Version:  5.3.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 Hi,

 I have identified a bug with wp_text_diff on a blank WP install on PHP
 7.2.8 and 7.3.12
 The bug causes the system to run out of memory no matter how much is
 available. I found it while trying to edit some revisions. The texts are
 large (50KB), maybe it has something to do with it.

 To replicate the bug you need to use this code. I will provide the files.
         {{{#!php
 <?php
         $content_from = file_get_contents( ABSPATH . '/content_from.txt'
 );
         $content_to = file_get_contents( ABSPATH . '/content_to.txt' );
         $diff = wp_text_diff( $content_from, $content_to, [] );
 }}}


 }}}

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


More information about the wp-trac mailing list