From bd02c5bd085e957aa4341e7fc2df2199081ab069 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 6 Oct 2019 12:07:35 +0200 Subject: [ticket/16051] Remove mysql driver as it's no longer supported in PHP >= 7.0 PHPBB3-16051 --- phpBB/develop/add_permissions.php | 9 +- phpBB/develop/create_schema_files.php | 1 - phpBB/develop/mysql_upgrader.php | 212 ---------------------------------- 3 files changed, 2 insertions(+), 220 deletions(-) delete mode 100644 phpBB/develop/mysql_upgrader.php (limited to 'phpBB/develop') diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index d7308a1acc..d2c8bffd90 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -210,7 +210,7 @@ foreach ($prefixes as $prefix) ); $db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - + echo "

Adding $auth_option...

\n"; mass_auth('group', 0, 'guests', $auth_option, ACL_NEVER); @@ -231,7 +231,7 @@ $db->sql_query($sql); $cache->destroy('_acl_options'); echo "

Done

\n"; - + /* $ug_type = user|group $forum_id = forum ids (array|int|0) -> 0 == all forums @@ -374,11 +374,6 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting) case 'insert': switch ($db->get_sql_layer()) { - case 'mysql': - case 'mysql4': - $sql = 'VALUES ' . implode(', ', preg_replace('#^(.*?)$#', '(\1)', $sql_subary)); - break; - case 'sqlite3': $sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary)); break; diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 6e0a082045..fdaa285f99 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -21,7 +21,6 @@ $schema_path = dirname(__FILE__) . '/../install/schemas/'; $supported_dbms = array( 'mssql', - 'mysql_40', 'mysql_41', 'oracle', 'postgres', diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php deleted file mode 100644 index 276c010e84..0000000000 --- a/phpBB/develop/mysql_upgrader.php +++ /dev/null @@ -1,212 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -/** -* This file creates SQL statements to upgrade phpBB on MySQL 3.x/4.0.x to 4.1.x/5.x -*/ - -// -// Security message: -// -// This script is potentially dangerous. -// Remove or comment the next line (die(".... ) to enable this script. -// Do NOT FORGET to either remove this script or disable it after you have used it. -// -die("Please read the first lines of this script for instructions on how to enable it"); - -define('IN_PHPBB', true); -$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.' . $phpEx); - -$prefix = $table_prefix; - -$newline = "\n"; - -if (PHP_SAPI !== 'cli') -{ - $newline = '
'; -} - -$sql = 'DESCRIBE ' . POSTS_TABLE . ' post_text'; -$result = $db->sql_query($sql); - -$row = $db->sql_fetchrow($result); - -$db->sql_freeresult($result); - -$mysql_indexer = $drop_index = false; - -if (strtolower($row['Type']) === 'mediumtext') -{ - $mysql_indexer = true; -} - -if (strtolower($row['Key']) === 'mul') -{ - $drop_index = true; -} - -echo "USE $dbname;$newline$newline"; - - -@set_time_limit(0); - -$finder = new \phpbb\finder(new \phpbb\filesystem\filesystem(), $phpbb_root_path); -$classes = $finder->core_path('phpbb/') - ->directory('/db/migration/data') - ->get_classes(); - -$factory = new \phpbb\db\tools\factory(); -$db_tools = $factory->get($db, true); - -$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix); -$schema_data = $schema_generator->get_schema(); -$dbms_type_map = \phpbb\db\tools\tools::get_dbms_type_map(); - -foreach ($schema_data as $table_name => $table_data) -{ - $table_name = str_replace('phpbb_', $prefix, $table_name); - // Write comment about table - echo "# Table: '{$table_name}'$newline"; - - // Create Table statement - $generator = $textimage = false; - - // Do we need to DROP a fulltext index before we alter the table? - if ($table_name == ($prefix . 'posts') && $drop_index) - { - echo "ALTER TABLE {$table_name}{$newline}"; - echo "DROP INDEX post_text,{$newline}DROP INDEX post_subject,{$newline}DROP INDEX post_content;{$newline}{$newline}"; - } - - $line = "ALTER TABLE {$table_name} $newline"; - - // Table specific so we don't get overlap - $modded_array = array(); - - // Write columns one by one... - foreach ($table_data['COLUMNS'] as $column_name => $column_data) - { - // Get type - if (strpos($column_data[0], ':') !== false) - { - list($orig_column_type, $column_length) = explode(':', $column_data[0]); - $column_type = sprintf($dbms_type_map['mysql_41'][$orig_column_type . ':'], $column_length); - - if (isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit']) && - isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0])) - { - switch ($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0]) - { - case 'mult': - if (($column_length * $dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][1]) > $dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][2]) - { - $modded_array[$column_name] = $column_type; - } - break; - } - } - - $orig_column_type .= ':'; - } - else - { - $orig_column_type = $column_data[0]; - $other_column_type = $dbms_type_map['mysql_40'][$column_data[0]]; - if ($other_column_type == 'text' || $other_column_type == 'blob') - { - $modded_array[$column_name] = $column_type; - } - $column_type = $dbms_type_map['mysql_41'][$column_data[0]]; - } - - // Adjust default value if db-dependent specified - if (is_array($column_data[1])) - { - $column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default']; - } - - $line .= "\tMODIFY {$column_name} {$column_type} "; - - // For hexadecimal values do not use single quotes - if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text' && substr($column_type, -4) !== 'blob') - { - $line .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' "; - } - $line .= 'NOT NULL'; - - if (isset($column_data[2])) - { - if ($column_data[2] == 'auto_increment') - { - $line .= ' auto_increment'; - } - else if ($column_data[2] == 'true_sort') - { - $line .= ' COLLATE utf8_unicode_ci'; - } - else if ($column_data[2] == 'no_sort') - { - $line .= ' COLLATE utf8_bin'; - } - } - else if (preg_match('/(?:var)?char|(?:medium)?text/i', $column_type)) - { - $line .= ' COLLATE utf8_bin'; - } - - $line .= ",$newline"; - } - - // Write Keys - if (isset($table_data['KEYS'])) - { - foreach ($table_data['KEYS'] as $key_name => $key_data) - { - $temp = ''; - if (!is_array($key_data[1])) - { - $key_data[1] = array($key_data[1]); - } - - $temp .= ($key_data[0] == 'INDEX') ? "\tADD KEY" : ''; - $temp .= ($key_data[0] == 'UNIQUE') ? "\tADD UNIQUE" : ''; - $repair = false; - foreach ($key_data[1] as $key => $col_name) - { - if (isset($modded_array[$col_name])) - { - $repair = true; - } - } - if ($repair) - { - $line .= "\tDROP INDEX " . $key_name . ",$newline"; - $line .= $temp; - $line .= ' ' . $key_name . ' (' . implode(', ', $key_data[1]) . "),$newline"; - } - } - } - - //$line .= "\tCONVERT TO CHARACTER SET `utf8`$newline"; - $line .= "\tDEFAULT CHARSET=utf8 COLLATE=utf8_bin;$newline$newline"; - - echo $line . "$newline"; - - // Do we now need to re-add the fulltext index? ;) - if ($table_name == ($prefix . 'posts') && $drop_index) - { - echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text);{$newline}"; - } -} -- cgit v1.2.1 From b6a99e7dcad10836cd2277ba2bd9a6c19afe90f1 Mon Sep 17 00:00:00 2001 From: rubencm Date: Thu, 24 Oct 2019 20:03:32 +0000 Subject: [ticket/16188] Remove some legacy code and fix bug PHPBB3-16189 --- phpBB/develop/regex.php | 40 ---------------------------------------- phpBB/develop/regex_idn.php | 41 +---------------------------------------- 2 files changed, 1 insertion(+), 80 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 46b6fff701..77c6d5c0e6 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -8,46 +8,6 @@ // die("Please read the first lines of this script for instructions on how to enable it"); - -// IP regular expressions - -$dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])'; -$h16 = '[\dA-F]{1,4}'; -$ipv4 = "(?:$dec_octet\.){3}$dec_octet"; -$ls32 = "(?:$h16:$h16|$ipv4)"; - -$ipv6_construct = array( - array(false, '', '{6}', $ls32), - array(false, '::', '{0,5}', "(?:$h16(?::$h16)?|$ipv4)"), - array('', ':', '{4}', $ls32), - array('{1,2}', ':', '{3}', $ls32), - array('{1,3}', ':', '{2}', $ls32), - array('{1,4}', ':', '', $ls32), - array('{1,5}', ':', false, $ls32), - array('{1,6}', ':', false, $h16), - array('{1,7}', ':', false, ''), - array(false, '::', false, '') -); - -$ipv6 = '(?:'; -foreach ($ipv6_construct as $ip_type) -{ - $ipv6 .= '(?:'; - if ($ip_type[0] !== false) - { - $ipv6 .= "(?:$h16:)" . $ip_type[0]; - } - $ipv6 .= $ip_type[1]; - if ($ip_type[2] !== false) - { - $ipv6 .= "(?:$h16:)" . $ip_type[2]; - } - $ipv6 .= $ip_type[3] . ')|'; -} -$ipv6 = substr($ipv6, 0, -1) . ')'; - -echo 'IPv4: ' . $ipv4 . "
\nIPv6: " . $ipv6 . "
\n"; - // URL regular expressions $pct_encoded = "%[\dA-F]{2}"; diff --git a/phpBB/develop/regex_idn.php b/phpBB/develop/regex_idn.php index 30373f8de3..24d1eb9196 100644 --- a/phpBB/develop/regex_idn.php +++ b/phpBB/develop/regex_idn.php @@ -8,45 +8,6 @@ // die("Please read the first lines of this script for instructions on how to enable it"); -// IP regular expressions - -$dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])'; -$h16 = '[\dA-F]{1,4}'; -$ipv4 = "(?:$dec_octet\.){3}$dec_octet"; -$ls32 = "(?:$h16:$h16|$ipv4)"; - -$ipv6_construct = array( - array(false, '', '{6}', $ls32), - array(false, '::', '{0,5}', "(?:$h16(?::$h16)?|$ipv4)"), - array('', ':', '{4}', $ls32), - array('{1,2}', ':', '{3}', $ls32), - array('{1,3}', ':', '{2}', $ls32), - array('{1,4}', ':', '', $ls32), - array('{1,5}', ':', false, $ls32), - array('{1,6}', ':', false, $h16), - array('{1,7}', ':', false, ''), - array(false, '::', false, '') -); - -$ipv6 = '(?:'; -foreach ($ipv6_construct as $ip_type) -{ - $ipv6 .= '(?:'; - if ($ip_type[0] !== false) - { - $ipv6 .= "(?:$h16:)" . $ip_type[0]; - } - $ipv6 .= $ip_type[1]; - if ($ip_type[2] !== false) - { - $ipv6 .= "(?:$h16:)" . $ip_type[2]; - } - $ipv6 .= $ip_type[3] . ')|'; -} -$ipv6 = substr($ipv6, 0, -1) . ')'; - -echo 'IPv4: ' . $ipv4 . "

\n\nIPv6: " . $ipv6 . "

\n\n"; - // URL regular expressions /* IDN2008 characters derivation @@ -72,7 +33,7 @@ $no_hangul = '\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C */ $no_cdm = '\x{20D0}-\x{20FF}'; // \p{block=Combining_Diacritical_Marks_For_Symbols} $no_musical = '\x{1D100}-\x{1D1FF}'; // \p{block=Musical_Symbols} -$no_ancient_greek_musical = '\x{1D200}-\x{1D24F}'; // \p{block=Ancient_Greek_Musical_Notation} +$no_ancient_greek_musical = '\x{1D200}-\x{1D24F}'; // \p{block=Ancient_Greek_Musical_Notation} /* Remove certain exceptions: ** U+0640 ARABIC TATWEEL ** U+07FA NKO LAJANYALAN -- cgit v1.2.1 From 9872316cac4df4987fdabc9512ca6ebeb7e5e04f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 18 Nov 2019 21:06:00 +0100 Subject: [ticket/16167] Remove uses of user_email_hash PHPBB3-16167 --- phpBB/develop/calc_email_hash.php | 74 ------------------------------------- phpBB/develop/update_email_hash.php | 56 ---------------------------- 2 files changed, 130 deletions(-) delete mode 100644 phpBB/develop/calc_email_hash.php delete mode 100644 phpBB/develop/update_email_hash.php (limited to 'phpBB/develop') diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php deleted file mode 100644 index 740f9158cf..0000000000 --- a/phpBB/develop/calc_email_hash.php +++ /dev/null @@ -1,74 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -// -// Security message: -// -// This script is potentially dangerous. -// Remove or comment the next line (die(".... ) to enable this script. -// Do NOT FORGET to either remove this script or disable it after you have used it. -// -die("Please read the first lines of this script for instructions on how to enable it"); -@set_time_limit(300); - -$db = $dbhost = $dbuser = $dbpasswd = $dbport = $dbname = ''; - -define('IN_PHPBB', 1); -define('ANONYMOUS', 1); -$phpEx = substr(strrchr(__FILE__, '.'), 1); -$phpbb_root_path='./../'; -include($phpbb_root_path . 'config.'.$phpEx); -require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx); -require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx); -include($phpbb_root_path . 'includes/functions.'.$phpEx); - -$cache = new acm(); -$db = new sql_db(); - -// Connect to DB -$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); - -$start = 0; -do -{ - // Batch query for group members, call group_user_del - $sql = "SELECT user_id, user_email - FROM {$table_prefix}users - LIMIT $start, 100"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - do - { - $sql = "UPDATE {$table_prefix}users - SET user_email_hash = " . (crc32(strtolower($row['user_email'])) . strlen($row['user_email'])) . ' - WHERE user_id = ' . $row['user_id']; - $db->sql_query($sql); - - $start++; - } - while ($row = $db->sql_fetchrow($result)); - - echo "
Batch -> $start\n"; - flush(); - } - else - { - $start = 0; - } - $db->sql_freeresult($result); -} -while ($start); - -echo "

Done

\n"; diff --git a/phpBB/develop/update_email_hash.php b/phpBB/develop/update_email_hash.php deleted file mode 100644 index c149900d64..0000000000 --- a/phpBB/develop/update_email_hash.php +++ /dev/null @@ -1,56 +0,0 @@ -session_begin(); -$auth->acl($user->data); -$user->setup(); - -$start = $request->variable('start', 0); -$num_items = 1000; - -echo '
Updating user email hashes' . "\n"; - -$sql = 'SELECT user_id, user_email - FROM ' . USERS_TABLE . ' - ORDER BY user_id ASC'; -$result = $db->sql_query($sql); - -$echos = 0; -while ($row = $db->sql_fetchrow($result)) -{ - $echos++; - - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_email_hash = '" . $db->sql_escape(phpbb_email_hash($row['user_email'])) . "' - WHERE user_id = " . (int) $row['user_id']; - $db->sql_query($sql); - - if ($echos == 200) - { - echo '
'; - $echos = 0; - } - - echo '.'; - flush(); -} -$db->sql_freeresult($result); - -echo 'FINISHED'; - -// Done -$db->sql_close(); -- cgit v1.2.1 From 364461b58fd40af8fe8c7513fe9424de483055b9 Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Mon, 30 Dec 2019 02:25:26 +0100 Subject: [ticket/16279] Add permission for Emoji in topic title PHPBB3-16279 --- phpBB/develop/add_permissions.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index d7308a1acc..ee5e116d91 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -156,6 +156,7 @@ $u_permissions = array( 'u_download' => array(0, 1), 'u_attach' => array(0, 1), 'u_sig' => array(0, 1), + 'u_emoji' => array(0, 1), 'u_pm_attach' => array(0, 1), 'u_pm_bbcode' => array(0, 1), 'u_pm_smilies' => array(0, 1), -- cgit v1.2.1