From 2acb02cda92ce3134eac6e6e8db6c04e4f87fa77 Mon Sep 17 00:00:00 2001 From: David Simon Date: Tue, 21 May 2013 16:29:25 -0400 Subject: [PATCH] Fixed bug parsing multiline strings with 'escaped' newlines --- src/Composer/Autoload/ClassMapGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index cb8a548f2..c291f4eef 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -115,7 +115,7 @@ class ClassMapGenerator // strip heredocs/nowdocs $contents = preg_replace('{<<<\'?(\w+)\'?(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)\\1(?=\r\n|\n|\r|;)}s', 'null', $contents); // strip strings - $contents = preg_replace('{"[^"\\\\]*(\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(\\\\.[^\'\\\\]*)*\'}', 'null', $contents); + $contents = preg_replace('{"[^"\\\\]*(\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(\\\\.[^\'\\\\]*)*\'}s', 'null', $contents); // strip leading non-php code if needed if (substr($contents, 0, 2) !== '