From 91b735c576e6200b0723e0c1adb7888a25881491 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 11 Mar 2025 06:30:31 +0100 Subject: [PATCH] Compile: Support \r\n line ends --- compile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compile.php b/compile.php index bc09252c..082a5597 100755 --- a/compile.php +++ b/compile.php @@ -41,7 +41,7 @@ function put_file($match) { return $match[0]; // processed later } $return = file_get_contents(__DIR__ . "/$project/$match[2]"); - $return = str_replace("namespace Adminer;\n", "", $return); + $return = preg_replace('~namespace Adminer;\s*~', '', $return); if (basename($match[2]) == "file.inc.php") { $return = str_replace("\n// caching headers added in compile.php", (preg_match('~-dev$~', $VERSION) ? '' : ' if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) { @@ -297,7 +297,7 @@ function php_shrink($input) { $doc_comment = true; $token[1] = substr_replace($token[1], "* @version $VERSION\n", -2, 0); } - if ($token[0] == T_VAR || $token[0] == T_PUBLIC || $token[0] == T_PROTECTED || $token[0] == T_PRIVATE) { + if ($token[0] == T_VAR) { $shortening = false; } elseif (!$shortening) { if ($token[1] == ';') {