mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 05:48:51 +00:00
better regex
git-svn-id: file:///svn/phpbb/trunk@6694 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ae58794cbb
commit
d417d53c0a
1 changed files with 2 additions and 5 deletions
|
@ -50,11 +50,8 @@ class diff
|
|||
{
|
||||
$diff_engine = &new diff_engine();
|
||||
|
||||
$match = array('#\r\n?#', "#([\n]+){2,}#u");
|
||||
$replace = array("\n", "\n");
|
||||
|
||||
$from_content = preg_replace($match, $replace, $from_content);
|
||||
$to_content = preg_replace($match, $replace, $to_content);
|
||||
$from_content = preg_replace('#[\n\r]+#', "\n", $from_content);
|
||||
$to_content = preg_replace('#[\n\r]+#', "\n", $to_content);
|
||||
|
||||
$this->_edits = call_user_func_array(array($diff_engine, 'diff'), array(explode("\n", $from_content), explode("\n", $to_content)));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue