From cb245b1fafae2fc0159d03072810f987b844c513 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 8 Jul 2012 21:36:12 +0200 Subject: [ticket/10969] Remove remove_remarks(&$sql) and remove_comments(&$output). Merge their bodies into phpbb_remove_comments($input). PHPBB3-10969 --- phpBB/includes/functions_install.php | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'phpBB/includes/functions_install.php') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 80f2bf940d..18e73adff9 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -471,19 +471,6 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, return false; } -/** -* Removes comments from schema files -* -* @deprecated Use phpbb_remove_comments() instead. -*/ -function remove_remarks(&$sql) -{ - // Remove # style comments - $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); - - // Return by reference -} - /** * Removes "/* style" as well as "# style" comments from $input. * @@ -493,17 +480,11 @@ function remove_remarks(&$sql) */ function phpbb_remove_comments($input) { - if (!function_exists('remove_comments')) - { - global $phpbb_root_path, $phpEx; - require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); - } - - // Remove /* */ comments - remove_comments($input); + // Remove /* */ comments (http://ostermiller.org/findcomment.html) + $input = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $input); // Remove # style comments - remove_remarks($input); + $input = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $input)); return $input; } -- cgit v1.2.1