Added ability to set MySQLi error reporting (#813)

* Added ability to set MySQLi error reporting

* fix

* fix
This commit is contained in:
Roman Kelesidis 2023-06-22 13:07:48 +07:00 committed by GitHub
commit c0593b9fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -439,9 +439,6 @@ $bb_cfg['super_admins'] = [
2 => 'admin', 2 => 'admin',
]; ];
// Date format
$bb_cfg['date_format'] = 'Y-m-d';
// Subforums // Subforums
$bb_cfg['sf_on_first_page_only'] = true; $bb_cfg['sf_on_first_page_only'] = true;

View file

@ -81,6 +81,7 @@ define('LOG_MAX_SIZE', 1048576); // bytes
ini_set('error_reporting', E_ALL); ini_set('error_reporting', E_ALL);
ini_set('display_errors', 0); ini_set('display_errors', 0);
ini_set('display_startup_errors', 0); ini_set('display_startup_errors', 0);
define('MYSQLI_ERROR_REPORTING', MYSQLI_REPORT_ALL ^ MYSQLI_REPORT_STRICT);
ini_set('log_errors', 1); ini_set('log_errors', 1);
ini_set('error_log', LOG_DIR . '/php_errors.log'); // path to log file enabled only if log_errors == 1 (native) ini_set('error_log', LOG_DIR . '/php_errors.log'); // path to log file enabled only if log_errors == 1 (native)
define('WHOOPS_LOG_FILE', LOG_DIR . '/php_whoops.log'); // log file enabled only if log_errors == 1 (whoops) define('WHOOPS_LOG_FILE', LOG_DIR . '/php_whoops.log'); // log file enabled only if log_errors == 1 (whoops)

View file

@ -77,6 +77,8 @@ class SqlDb
*/ */
public function init() public function init()
{ {
mysqli_report(MYSQLI_ERROR_REPORTING);
// Connect to server // Connect to server
$this->connect(); $this->connect();

View file

@ -572,7 +572,7 @@ for ($i = 0; $i < $total_posts; $i++) {
$max_post_time = max($max_post_time, $postrow[$i]['post_time']); $max_post_time = max($max_post_time, $postrow[$i]['post_time']);
$poster_posts = ($poster_id != GUEST_UID) ? $postrow[$i]['user_posts'] : ''; $poster_posts = ($poster_id != GUEST_UID) ? $postrow[$i]['user_posts'] : '';
$poster_from = ($postrow[$i]['user_from'] && $poster_id != GUEST_UID) ? $postrow[$i]['user_from'] : ''; $poster_from = ($postrow[$i]['user_from'] && $poster_id != GUEST_UID) ? $postrow[$i]['user_from'] : '';
$poster_joined = ($poster_id != GUEST_UID) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], $bb_cfg['date_format']) : ''; $poster_joined = ($poster_id != GUEST_UID) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i', false) : '';
$poster_longevity = ($poster_id != GUEST_UID) ? delta_time($postrow[$i]['user_regdate']) : ''; $poster_longevity = ($poster_id != GUEST_UID) ? delta_time($postrow[$i]['user_regdate']) : '';
$post_id = $postrow[$i]['post_id']; $post_id = $postrow[$i]['post_id'];
$mc_type = $postrow[$i]['mc_type']; $mc_type = $postrow[$i]['mc_type'];