svn: /web/doc-editor/trunk/php/ File.php
[email protected] (Yannick Torres)
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <[email protected]> |
yannick Wed, 30 Dec 2009 18:18:47 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292821
Log:
Fix the regex for the diff. Thanks to gwynne and ackana@freenode#regex
Changed paths:
U web/doc-editor/trunk/php/File.php
Modified: web/doc-editor/trunk/php/File.php
===================================================================
--- web/doc-editor/trunk/php/File.php 2009-12-30 18:00:15 UTC (rev 292820)
+++ web/doc-editor/trunk/php/File.php 2009-12-30 18:18:47 UTC (rev 292821)
@@ -309,7 +309,7 @@
);
$output = htmlentities(join("\n", $output));
$match = array();
- preg_match_all('/@@(.*?)@@(.*(?!@@).*)/s', $output, $match);
+ preg_match_all('/@@([^@]+)@@(.*?)(?=@@|\z)/si', $output, $match);
$diff = array();
for ($i = 0; $i < count($match[1]); $i++) {