Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.1

Bug #4879 Text_Diff_Renderer_inline hangs on numbers in input string
Submitted: 2005-07-22 01:04 UTC Modified: 2006-12-17 11:10 UTC
From: alex-spam at rdc dot ru Assigned: chagenbu
Status: Closed Package: Text_Diff
PHP Version: 4.3.10 OS: Windows, Linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-07-22 01:04 UTC] alex-spam at rdc dot ru
Description: ------------ It seems to me that I've found a bug in Text_Diff_Renderer_inline of Text_Diff version 0.0.5. The renderer seems to choke on numbers, hanging script execution. Test script: --------------- <h2>Text_Diff_Renderer_inline bug demonstration</h2> <? # uncomment this line to see script hanging $want_bug = TRUE; include_once 'Text/Diff.php'; include_once 'Text/Diff/Renderer.php'; include_once 'Text/Diff/Renderer/inline.php'; include_once 'Text/Diff/Renderer/unified.php'; $oldtext = <<<EOT Common text Bob had 1 apple, Alice had 2. Bon appetit! EOT; $newtext = <<< EOT Common text Bob had 10 apples, Alice had 1. Bon appetit! EOT; $oldpieces = explode ("\n", $oldtext); $newpieces = explode ("\n", $newtext); $diff =& new Text_Diff ($oldpieces, $newpieces); # up to this line script execution goes fine if (@$want_bug) { # this block hangs $renderer =& new Text_Diff_Renderer_inline (); $out = $renderer->render ($diff); } else { # this block works normally $renderer =& new Text_Diff_Renderer_unified (); $out = $renderer->render ($diff); } echo "<b>out:</b><br>\n". nl2br ($out); ?> Expected result: ---------------- Inline renderer should produce output, but it hangs. Actual result: -------------- Inline renderer hangs, so it's no output.

Comments

 [2005-07-22 14:45 UTC] chagenbu
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.