aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php2
-rw-r--r--phpBB/install/database_update.php20
-rw-r--r--phpBB/install/install_convert.php2
-rw-r--r--phpBB/install/install_install.php4
4 files changed, 22 insertions, 6 deletions
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index b80c7673e3..78224dd5da 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -1239,9 +1239,9 @@ function phpbb_prepare_message($message)
// Already the new user id ;)
$user_id = $convert->row['poster_id'];
+ $message = str_replace('<br />', "\n", $message);
$message = str_replace('<', '&lt;', $message);
$message = str_replace('>', '&gt;', $message);
- $message = str_replace('<br />', "\n", $message);
// make the post UTF-8
$message = phpbb_set_encoding($message);
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index fec09f89db..019469b061 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -880,7 +880,7 @@ function database_update_info()
'pm_id' => array('pm_id'),
),
POSTS_TABLE => array(
- 'post_username' => array('post_username'),
+ 'post_username' => array('post_username:255'),
),
),
),
@@ -2141,7 +2141,7 @@ class updater_db_tools
* drop_columns: Removing/Dropping columns
* add_primary_keys: adding primary keys
* add_unique_index: adding an unique index
- * add_index: adding an index
+ * add_index: adding an index (can be column:index_size if you need to provide size)
*
* The values are in this format:
* {TABLE NAME} => array(
@@ -3520,6 +3520,12 @@ class updater_db_tools
{
$statements = array();
+ // remove index length unless MySQL4
+ if ('mysql_40' != $this->sql_layer)
+ {
+ $column = preg_replace('#:.*$#', '', $column);
+ }
+
switch ($this->sql_layer)
{
case 'firebird':
@@ -3530,6 +3536,16 @@ class updater_db_tools
break;
case 'mysql_40':
+ // add index size to definition as required by MySQL4
+ foreach ($column as $i => $col)
+ {
+ if (false !== strpos($col, ':'))
+ {
+ list($col, $index_size) = explode(':', $col);
+ $column[$i] = "$col($index_size)";
+ }
+ }
+ // no break
case 'mysql_41':
$statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
break;
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 8c3ffd61a8..814b50cf68 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -835,7 +835,7 @@ class install_convert extends module
$this->p_master->error($user->lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__);
}
- if (!$local_path || !@is_writable($phpbb_root_path . $local_path))
+ if (!$local_path || !phpbb_is_writable($phpbb_root_path . $local_path))
{
if (!$local_path)
{
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 4c22db07b2..6c23460de9 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -486,7 +486,7 @@ class install_install extends module
$write = $exists = true;
if (file_exists($phpbb_root_path . $dir))
{
- if (!@is_writable($phpbb_root_path . $dir))
+ if (!phpbb_is_writable($phpbb_root_path . $dir))
{
$write = false;
}
@@ -906,7 +906,7 @@ class install_install extends module
$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
- if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx)) || is_writable($phpbb_root_path))
+ if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path))
{
// Assume it will work ... if nothing goes wrong below
$written = true;