mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-15 21:44:56 +01:00
- show complete sql error message + path to administrators only (idea from post to bugtraq about SMF)
git-svn-id: file:///svn/phpbb/trunk@5338 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
7657767590
commit
d160126086
@ -192,14 +192,26 @@ class dbal
|
||||
*/
|
||||
function sql_error($sql = '')
|
||||
{
|
||||
global $auth, $user;
|
||||
|
||||
$error = $this->_sql_error();
|
||||
|
||||
if (!$this->return_on_error)
|
||||
{
|
||||
$this_page = (isset($_SERVER['PHP_SELF']) && !empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||
$this_page .= '&' . ((isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : (isset($_ENV['QUERY_STRING']) ? $_ENV['QUERY_STRING'] : ''));
|
||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . $error['message'] . ' [' . $error['code'] . '];
|
||||
|
||||
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . $error['message'] . ' [' . $error['code'] . ']<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||
// Show complete SQL error and path to administrators only
|
||||
if ($auth->acl_get('a_'))
|
||||
{
|
||||
$this_page = (isset($_SERVER['PHP_SELF']) && !empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
|
||||
$this_page .= '&' . ((isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : (isset($_ENV['QUERY_STRING']) ? $_ENV['QUERY_STRING'] : ''));
|
||||
|
||||
$message .= '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang['SQL_ERROR_OCCURRED'];
|
||||
}
|
||||
|
||||
if ($this->transaction)
|
||||
{
|
||||
|
@ -362,6 +362,7 @@ $lang = array_merge($lang, array(
|
||||
'SORT_TOPIC_TITLE' => 'Topic Title',
|
||||
'SORT_USERNAME' => 'Username',
|
||||
'SPLIT_TOPIC' => 'Split Topic',
|
||||
'SQL_ERROR_OCCURRED' => 'An sql error occurred while fetching this page. Please contact an administrator if this problem persist.',
|
||||
'STATISTICS' => 'Statistics',
|
||||
'START_WATCHING_FORUM' => 'Subscribe Forum',
|
||||
'START_WATCHING_TOPIC' => 'Subscribe Topic',
|
||||
|
Loading…
x
Reference in New Issue
Block a user