some missing merges...

git-svn-id: file:///svn/phpbb/trunk@8545 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2008-05-04 14:47:49 +00:00
parent 771fd3696d
commit eb664ddafb
7 changed files with 60 additions and 20 deletions

View file

@ -173,6 +173,7 @@ class acp_database
default:
include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
$tables = get_tables($db);
asort($tables);
foreach ($tables as $table_name)
{
if (strlen($table_prefix) === 0 || stripos($table_name, $table_prefix) === 0)
@ -346,7 +347,25 @@ class acp_database
while (($sql = $fgetd($fp, $delim, $read, $seek, $eof)) !== false)
{
$query = trim($sql);
if (substr($query, 0, 13) == 'CREATE DOMAIN')
{
list(, , $domain) = explode(' ', $query);
$sql = "SELECT domain_name
FROM information_schema.domains
WHERE domain_name = '$domain';";
$result = $db->sql_query($sql);
if (!$db->sql_fetchrow($result))
{
$db->sql_query($query);
}
$db->sql_freeresult($result);
}
else
{
$db->sql_query($query);
}
if (substr($query, 0, 4) == 'COPY')
{
while (($sub = $fgetd($fp, "\n", $read, $seek, $eof)) !== '\.')
@ -971,7 +990,7 @@ class postgres_extractor extends base_extractor
}
$sql_data = '-- Table: ' . $table_name . "\n";
//$sql_data .= "DROP TABLE $table_name;\n";
$sql_data .= "DROP TABLE $table_name;\n";
// PGSQL does not "tightly" bind sequences and tables, we must guess...
$sql = "SELECT relname
FROM pg_class
@ -1040,7 +1059,7 @@ class postgres_extractor extends base_extractor
$line .= ')';
}
if (!empty($row['rowdefault']))
if (isset($row['rowdefault']))
{
$line .= ' DEFAULT ' . $row['rowdefault'];
}

View file

@ -1536,7 +1536,8 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$sql = 'SELECT SUM(t.topic_replies + 1) AS forum_posts
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
AND t.topic_approved = 1';
AND t.topic_approved = 1
AND t.topic_status <> ' . ITEM_MOVED;
}
else
{
@ -1544,6 +1545,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
AND t.topic_approved = 1
AND t.topic_status <> ' . ITEM_MOVED . '
GROUP BY t.forum_id';
}

View file

@ -231,7 +231,7 @@ class compress_zip extends compress
}
else
{
// Some archivers are punks, they don't don't include folders in their archives!
// Some archivers are punks, they don't include folders in their archives!
$str = '';
$folders = explode('/', pathinfo($target_filename, PATHINFO_DIRNAME));
@ -507,12 +507,14 @@ class compress_tar extends compress
$tmp = unpack('A12size', substr($buffer, 124, 12));
$filesize = octdec((int) trim($tmp['size']));
$target_filename = "$dst$filename";
if ($filetype == 5)
{
if (!is_dir("$dst$filename"))
if (!is_dir($target_filename))
{
$str = '';
$folders = explode('/', "$dst$filename");
$folders = explode('/', $target_filename);
// Create and folders and subfolders if they do not exist
foreach ($folders as $folder)
@ -529,17 +531,35 @@ class compress_tar extends compress
}
}
}
else if ($filesize != 0 && ($filetype == 0 || $filetype == "\0"))
else if ($filesize >= 0 && ($filetype == 0 || $filetype == "\0"))
{
// Some archivers are punks, they don't properly order the folders in their archives!
$str = '';
$folders = explode('/', pathinfo($target_filename, PATHINFO_DIRNAME));
// Create and folders and subfolders if they do not exist
foreach ($folders as $folder)
{
$str = (!empty($str)) ? $str . '/' . $folder : $folder;
if (!is_dir($str))
{
if (!@mkdir($str, 0777))
{
trigger_error("Could not create directory $folder");
}
@chmod($str, 0777);
}
}
// Write out the files
if (!($fp = fopen("$dst$filename", 'wb')))
if (!($fp = fopen($target_filename, 'wb')))
{
trigger_error("Couldn't create file $filename");
}
@chmod("$dst$filename", 0777);
@chmod($target_filename, 0777);
// Grab the file contents
fwrite($fp, $fzread($this->fp, ($filesize + 511) &~ 511), $filesize);
fwrite($fp, ($filesize) ? $fzread($this->fp, ($filesize + 511) &~ 511) : '', $filesize);
fclose($fp);
}
}

View file

@ -311,7 +311,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
{
case 'mysql':
case 'mysqli':
if (strpos($table_prefix, '-') !== false || strpos($table_prefix, '.') !== false)
if (strspn($table_prefix, '-./\\') !== 0)
{
$error[] = $lang['INST_ERR_PREFIX_INVALID'];
return false;

View file

@ -68,7 +68,7 @@ class session
foreach ($args as $key => $argument)
{
if (strpos($argument, 'sid=') === 0 || strpos($argument, '_f_=') === 0)
if (strpos($argument, 'sid=') === 0)
{
continue;
}
@ -219,9 +219,9 @@ class session
// Load limit check (if applicable)
if ($config['limit_load'] || $config['limit_search_load'])
{
if ($load = @file_get_contents('/proc/loadavg'))
if ((function_exists('sys_getloadavg') && $load = sys_getloadavg()) || ($load = explode(' ', @file_get_contents('/proc/loadavg'))))
{
$this->load = array_slice(explode(' ', $load), 0, 1);
$this->load = array_slice($load, 0, 1);
$this->load = floatval($this->load[0]);
}
else

View file

@ -1440,7 +1440,7 @@ function utf8_clean_string($text)
/**
* A wrapper for htmlspecialchars($value, ENT_COMPAT, 'UTF-8')
*/
function utf8_htmlspecialchars(&$value)
function utf8_htmlspecialchars($value)
{
return htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
}

View file

@ -253,9 +253,8 @@
}
.rtl ul.topiclist li.row dt a.subforum {
padding: 0 0 0 12px;
background-position: 100% 100%;
position: static;
padding-right: 12px;
background-position: right;
}
.rtl .forum-image {