mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-10 17:45:18 +02:00
Merge remote-tracking branch 'github-bantu/ticket/10969' into develop
* github-bantu/ticket/10969: [ticket/10969] Also remove COMMENTS key from data array in get_available_dbms() [ticket/10969] Remove remove_remarks(&$sql) and remove_comments(&$output).
This commit is contained in:
commit
2090ecfb8f
@ -2291,21 +2291,6 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* remove_comments will strip the sql comment lines out of an uploaded sql file
|
|
||||||
* specifically for mssql and postgres type files in the install....
|
|
||||||
*
|
|
||||||
* @deprecated Use phpbb_remove_comments() instead.
|
|
||||||
*/
|
|
||||||
function remove_comments(&$output)
|
|
||||||
{
|
|
||||||
// Remove /* */ comments (http://ostermiller.org/findcomment.html)
|
|
||||||
$output = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $output);
|
|
||||||
|
|
||||||
// Return by reference and value.
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username
|
* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username
|
||||||
* and group names must be carried through for the moderators table
|
* and group names must be carried through for the moderators table
|
||||||
|
@ -49,7 +49,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'firebird',
|
'SCHEMA' => 'firebird',
|
||||||
'MODULE' => 'interbase',
|
'MODULE' => 'interbase',
|
||||||
'DELIM' => ';;',
|
'DELIM' => ';;',
|
||||||
'COMMENTS' => 'remove_remarks',
|
|
||||||
'DRIVER' => 'firebird',
|
'DRIVER' => 'firebird',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => false,
|
'2.0.x' => false,
|
||||||
@ -59,7 +58,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'mysql_41',
|
'SCHEMA' => 'mysql_41',
|
||||||
'MODULE' => 'mysqli',
|
'MODULE' => 'mysqli',
|
||||||
'DELIM' => ';',
|
'DELIM' => ';',
|
||||||
'COMMENTS' => 'remove_remarks',
|
|
||||||
'DRIVER' => 'mysqli',
|
'DRIVER' => 'mysqli',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => true,
|
'2.0.x' => true,
|
||||||
@ -69,7 +67,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'mysql',
|
'SCHEMA' => 'mysql',
|
||||||
'MODULE' => 'mysql',
|
'MODULE' => 'mysql',
|
||||||
'DELIM' => ';',
|
'DELIM' => ';',
|
||||||
'COMMENTS' => 'remove_remarks',
|
|
||||||
'DRIVER' => 'mysql',
|
'DRIVER' => 'mysql',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => true,
|
'2.0.x' => true,
|
||||||
@ -79,7 +76,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'mssql',
|
'SCHEMA' => 'mssql',
|
||||||
'MODULE' => 'mssql',
|
'MODULE' => 'mssql',
|
||||||
'DELIM' => 'GO',
|
'DELIM' => 'GO',
|
||||||
'COMMENTS' => 'remove_comments',
|
|
||||||
'DRIVER' => 'mssql',
|
'DRIVER' => 'mssql',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => true,
|
'2.0.x' => true,
|
||||||
@ -89,7 +85,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'mssql',
|
'SCHEMA' => 'mssql',
|
||||||
'MODULE' => 'odbc',
|
'MODULE' => 'odbc',
|
||||||
'DELIM' => 'GO',
|
'DELIM' => 'GO',
|
||||||
'COMMENTS' => 'remove_comments',
|
|
||||||
'DRIVER' => 'mssql_odbc',
|
'DRIVER' => 'mssql_odbc',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => true,
|
'2.0.x' => true,
|
||||||
@ -99,7 +94,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'mssql',
|
'SCHEMA' => 'mssql',
|
||||||
'MODULE' => 'sqlsrv',
|
'MODULE' => 'sqlsrv',
|
||||||
'DELIM' => 'GO',
|
'DELIM' => 'GO',
|
||||||
'COMMENTS' => 'remove_comments',
|
|
||||||
'DRIVER' => 'mssqlnative',
|
'DRIVER' => 'mssqlnative',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => false,
|
'2.0.x' => false,
|
||||||
@ -109,7 +103,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'oracle',
|
'SCHEMA' => 'oracle',
|
||||||
'MODULE' => 'oci8',
|
'MODULE' => 'oci8',
|
||||||
'DELIM' => '/',
|
'DELIM' => '/',
|
||||||
'COMMENTS' => 'remove_comments',
|
|
||||||
'DRIVER' => 'oracle',
|
'DRIVER' => 'oracle',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => false,
|
'2.0.x' => false,
|
||||||
@ -119,7 +112,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'postgres',
|
'SCHEMA' => 'postgres',
|
||||||
'MODULE' => 'pgsql',
|
'MODULE' => 'pgsql',
|
||||||
'DELIM' => ';',
|
'DELIM' => ';',
|
||||||
'COMMENTS' => 'remove_comments',
|
|
||||||
'DRIVER' => 'postgres',
|
'DRIVER' => 'postgres',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => true,
|
'2.0.x' => true,
|
||||||
@ -129,7 +121,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||||||
'SCHEMA' => 'sqlite',
|
'SCHEMA' => 'sqlite',
|
||||||
'MODULE' => 'sqlite',
|
'MODULE' => 'sqlite',
|
||||||
'DELIM' => ';',
|
'DELIM' => ';',
|
||||||
'COMMENTS' => 'remove_remarks',
|
|
||||||
'DRIVER' => 'sqlite',
|
'DRIVER' => 'sqlite',
|
||||||
'AVAILABLE' => true,
|
'AVAILABLE' => true,
|
||||||
'2.0.x' => false,
|
'2.0.x' => false,
|
||||||
@ -471,19 +462,6 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||||||
return false;
|
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.
|
* Removes "/* style" as well as "# style" comments from $input.
|
||||||
*
|
*
|
||||||
@ -493,17 +471,11 @@ function remove_remarks(&$sql)
|
|||||||
*/
|
*/
|
||||||
function phpbb_remove_comments($input)
|
function phpbb_remove_comments($input)
|
||||||
{
|
{
|
||||||
if (!function_exists('remove_comments'))
|
// Remove /* */ comments (http://ostermiller.org/findcomment.html)
|
||||||
{
|
$input = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $input);
|
||||||
global $phpbb_root_path, $phpEx;
|
|
||||||
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove /* */ comments
|
|
||||||
remove_comments($input);
|
|
||||||
|
|
||||||
// Remove # style comments
|
// Remove # style comments
|
||||||
remove_remarks($input);
|
$input = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $input));
|
||||||
|
|
||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user