diff --git a/jsm.inc.php b/jsm.inc.php index 125349f..6de4cb9 100644 --- a/jsm.inc.php +++ b/jsm.inc.php @@ -254,9 +254,8 @@ class JSM { if(strpos($txt, '/*') === false) return $txt; - $regex = '~/\*.*?\*/~s'; $txt = preg_replace_callback( - $regex, + '~/\*.*?\*/~s', //preserve the new lines for better error reporting function($m) { return str_repeat("\n", substr_count($m[0], "\n")); }, $txt); @@ -266,7 +265,11 @@ class JSM private static function _removeLineComments(string $txt) : string { //TODO: it's not robust enough, note a hack for URL addresses - $txt = preg_replace("~\s*(?