1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-11 01:55:24 +02:00

Fixing a few things for postgres. Thanks to wagnerch for researching the issue and providing a patch.

#12587


git-svn-id: file:///svn/phpbb/trunk@7787 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2007-06-22 16:47:23 +00:00
parent 409749f857
commit 1e2db705ca
5 changed files with 17 additions and 9 deletions

View File

@ -293,6 +293,8 @@ p a {
<li>[Fix] Oracle sequences during conversions are now corrected (Bug #12555)</li> <li>[Fix] Oracle sequences during conversions are now corrected (Bug #12555)</li>
<li>[Fix] Allow users to continue after selecting "No" in the merge quickmod confirmation (Bug #12577)</li> <li>[Fix] Allow users to continue after selecting "No" in the merge quickmod confirmation (Bug #12577)</li>
<li>[Fix] Correctly check permissions on the UCP subscription/bookmark pages (Bug #12595)</li> <li>[Fix] Correctly check permissions on the UCP subscription/bookmark pages (Bug #12595)</li>
<li>[Fix] Only convert non-orphaned PMs</li>
<li>[Fix] Fixed a few Postgres related errors (Bug #12587)</li>
</ul> </ul>

View File

@ -1831,7 +1831,7 @@ class acp_users
// Select auth options // Select auth options
$sql = 'SELECT auth_option, is_local, is_global $sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . " FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option LIKE '%\_'"; WHERE auth_option LIKE '%" . $db->sql_escape('\_') . "'";
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{ {
@ -1843,6 +1843,7 @@ class acp_users
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$hold_ary = array(); $hold_ary = array();
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NEVER); $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NEVER);
@ -1856,7 +1857,7 @@ class acp_users
{ {
$sql = 'SELECT auth_option, is_local, is_global $sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . " FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option LIKE '%\_'"; WHERE auth_option LIKE '%" . $db->sql_escape('\_') . "'";
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{ {

View File

@ -3878,7 +3878,7 @@ function page_header($page_title = '', $display_online_list = true)
$f = request_var('f', 0); $f = request_var('f', 0);
// Do not change this (it is defined as _f_={forum_id}x within session.php) // Do not change this (it is defined as _f_={forum_id}x within session.php)
$reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'"; $reading_sql = " AND s.session_page LIKE '%" . $db->sql_escape("\_f\_={$f}x") . "%'";
// Specify escape character for MSSQL // Specify escape character for MSSQL
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')

View File

@ -2206,7 +2206,7 @@ function cache_moderators()
AND a.group_id = ug.group_id AND a.group_id = ug.group_id
AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . " AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . "
AND ug.user_pending = 0 AND ug.user_pending = 0
AND o.auth_option LIKE 'm\_%'" . AND o.auth_option LIKE '" . $db->sql_escape('m\_') . "%'" .
(($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''), (($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''),
)); ));
$result = $db->sql_query($sql); $result = $db->sql_query($sql);

View File

@ -706,7 +706,8 @@ if (!$get_info)
array('pm_forwarded', 0, ''), array('pm_forwarded', 0, ''),
array('folder_id', PRIVMSGS_INBOX, ''), array('folder_id', PRIVMSGS_INBOX, ''),
'where' => 'privmsgs.privmsgs_type = 0 OR privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5', 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
AND (privmsgs.privmsgs_type = 0 OR privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)',
), ),
// Outbox // Outbox
@ -725,7 +726,8 @@ if (!$get_info)
array('pm_forwarded', 0, ''), array('pm_forwarded', 0, ''),
array('folder_id', PRIVMSGS_OUTBOX, ''), array('folder_id', PRIVMSGS_OUTBOX, ''),
'where' => 'privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5', 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
AND (privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)',
), ),
// Sentbox // Sentbox
@ -744,7 +746,8 @@ if (!$get_info)
array('pm_forwarded', 0, ''), array('pm_forwarded', 0, ''),
array('folder_id', PRIVMSGS_SENTBOX, ''), array('folder_id', PRIVMSGS_SENTBOX, ''),
'where' => 'privmsgs.privmsgs_type = 2', 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
AND privmsgs.privmsgs_type = 2',
), ),
// Savebox (SAVED IN) // Savebox (SAVED IN)
@ -763,7 +766,8 @@ if (!$get_info)
array('pm_forwarded', 0, ''), array('pm_forwarded', 0, ''),
array('folder_id', 'privmsgs.privmsgs_to_userid', 'phpbb_get_savebox_id'), array('folder_id', 'privmsgs.privmsgs_to_userid', 'phpbb_get_savebox_id'),
'where' => 'privmsgs.privmsgs_type = 3', 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
AND privmsgs.privmsgs_type = 3',
), ),
// Savebox (SAVED OUT) // Savebox (SAVED OUT)
@ -782,7 +786,8 @@ if (!$get_info)
array('pm_forwarded', 0, ''), array('pm_forwarded', 0, ''),
array('folder_id', 'privmsgs.privmsgs_from_userid', 'phpbb_get_savebox_id'), array('folder_id', 'privmsgs.privmsgs_from_userid', 'phpbb_get_savebox_id'),
'where' => 'privmsgs.privmsgs_type = 4', 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id
AND privmsgs.privmsgs_type = 4',
), ),
array( array(