|
From: Florin C B. <ory...@us...> - 2013-06-16 01:22:33
|
Update of /cvsroot/mxbb/core/includes/db In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29751/includes/db Modified Files: dbal.php mysqli.php Log Message: Index: mysqli.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/mysqli.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** mysqli.php 18 Oct 2009 04:15:32 -0000 1.23 --- mysqli.php 16 Jun 2013 01:22:30 -0000 1.24 *************** *** 58,68 **** if (defined('UTF_STATUS') && (UTF_STATUS === 'phpbb3')) { ! @mysqli_query($this->db_connect_id, "SET NAMES 'utf8'"); // enforce strict mode on databases that support it } if (mysqli_get_server_version($this->db_connect_id) >= 50002) { ! $result = @mysqli_query($this->db_connect_id, 'SELECT @@session.sql_mode AS sql_mode'); ! $row = @mysqli_fetch_assoc($result); ! @mysqli_free_result($result); $modes = array_map('trim', explode(',', $row['sql_mode'])); --- 58,68 ---- if (defined('UTF_STATUS') && (UTF_STATUS === 'phpbb3')) { ! mysqli_query($this->db_connect_id, "SET NAMES 'utf8'"); // enforce strict mode on databases that support it } if (mysqli_get_server_version($this->db_connect_id) >= 50002) { ! $result = mysqli_query($this->db_connect_id, 'SELECT @@session.sql_mode AS sql_mode'); ! $row = mysqli_fetch_assoc($result); ! mysqli_free_result($result); $modes = array_map('trim', explode(',', $row['sql_mode'])); Index: dbal.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/db/dbal.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dbal.php 4 Oct 2008 17:30:23 -0000 1.13 --- dbal.php 16 Jun 2013 01:22:30 -0000 1.14 *************** *** 415,435 **** function sql_error($sql = '') { ! global $mx_user; ! $error = $this->_sql_error(); if (!$this->return_on_error) { ! $message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . $error['message'] . ' [' . $error['code'] . ']'; // Show complete SQL error and path to administrators only ! if ($mx_user->is_admin) { ! // Print out a nice backtrace... ! //$backtrace = get_backtrace(); ! ! $message .= ($sql) ? '<br /><br /><u>SQL</u><br /><br />' . $sql : ''; ! //$message .= ($backtrace) ? '<br /><br /><u>BACKTRACE</u><br />' . $backtrace : ''; ! $message .= '<br />'; } else --- 415,437 ---- function sql_error($sql = '') { ! global $mx_user, $mx_root_path, $phpEx, $lang, $board_config; ! ! // Set var to retrieve errored status ! $this->sql_error_triggered = true; ! $this->sql_error_sql = $sql; ! ! $this->sql_error_returned = $this->_sql_error(); if (!$this->return_on_error) { ! $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]<br /><br />' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']'; // Show complete SQL error and path to administrators only ! // Additionally show complete error on installation or if extended debug mode is enabled ! // The DEBUG_EXTRA constant is for development only! ! if ((isset($phpbb_auth) && $phpbb_auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA')) { ! $message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : ''; } else *************** *** 437,447 **** // If error occurs in initiating the session we need to use a pre-defined language string // This could happen if the connection could not be established for example (then we are not able to grab the default language) ! if (!isset($mx_user->_lang['An_error_occured'])) { ! $message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persist.'; } else { ! $message .= '<br /><br />' . $mx_user->_lang['An_error_occured']; } } --- 439,456 ---- // If error occurs in initiating the session we need to use a pre-defined language string // This could happen if the connection could not be established for example (then we are not able to grab the default language) ! if (!isset($user->lang['SQL_ERROR_OCCURRED'])) { ! $message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persists.'; } else { ! if (!empty($config['board_contact'])) ! { ! $message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'); ! } ! else ! { ! $message .= '<br /><br />' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', ''); ! } } } *************** *** 452,458 **** } } ! return $error; } --- 461,482 ---- } + if (strlen($message) > 1024) + { + // We need to define $msg_long_text here to circumvent text stripping. + global $msg_long_text; + $msg_long_text = $message; + + trigger_error(false, E_USER_ERROR); + } + + //trigger_error($message, E_USER_ERROR); } ! if ($this->transaction) ! { ! $this->sql_transaction('rollback'); ! } ! ! return $this->sql_error_returned; } |