diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-07-08 21:36:12 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-07-08 21:38:53 +0200 |
commit | cb245b1fafae2fc0159d03072810f987b844c513 (patch) | |
tree | 100c454784186caac62269c29e25e21584724dec /phpBB/includes/functions_install.php | |
parent | 576cd6dd1e45171e998d6aa13ab74b73939ce084 (diff) | |
download | forums-cb245b1fafae2fc0159d03072810f987b844c513.tar forums-cb245b1fafae2fc0159d03072810f987b844c513.tar.gz forums-cb245b1fafae2fc0159d03072810f987b844c513.tar.bz2 forums-cb245b1fafae2fc0159d03072810f987b844c513.tar.xz forums-cb245b1fafae2fc0159d03072810f987b844c513.zip |
[ticket/10969] Remove remove_remarks(&$sql) and remove_comments(&$output).
Merge their bodies into phpbb_remove_comments($input).
PHPBB3-10969
Diffstat (limited to 'phpBB/includes/functions_install.php')
-rw-r--r-- | phpBB/includes/functions_install.php | 25 |
1 files changed, 3 insertions, 22 deletions
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 @@ -472,19 +472,6 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, } /** -* 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. * * @param string $input Input string @@ -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; } |