Zeile 116 | Zeile 116 |
---|
* @var boolean */ public $has_errors = false;
|
* @var boolean */ public $has_errors = false;
|
| /** * Display errors regardless of related settings (useful during initialization stage) * * @var boolean */ public $force_display_errors = false;
|
/** * Initializes the error handler
| /** * Initializes the error handler
|
Zeile 140 | Zeile 147 |
---|
* @param string $message The error message * @param string $file The error file * @param integer $line The error line
|
* @param string $message The error message * @param string $file The error file * @param integer $line The error line
|
| * @param boolean $allow_output Whether or not output is permitted
|
* @return boolean True if parsing was a success, otherwise assume a error */
|
* @return boolean True if parsing was a success, otherwise assume a error */
|
function error($type, $message, $file=null, $line=0)
| function error($type, $message, $file=null, $line=0, $allow_output=true)
|
{ global $mybb;
| { global $mybb;
|
Zeile 195 | Zeile 203 |
---|
$this->email_error($type, $message, $file, $line); }
|
$this->email_error($type, $message, $file, $line); }
|
// SQL Error if($type == MYBB_SQL) { $this->output_error($type, $message, $file, $line); } else
| if($allow_output === true)
|
{
|
{
|
// Do we have a PHP error? if(my_strpos(my_strtolower($this->error_types[$type]), 'warning') === false)
| // SQL Error if($type == MYBB_SQL)
|
{ $this->output_error($type, $message, $file, $line); }
|
{ $this->output_error($type, $message, $file, $line); }
|
// PHP Error
| |
else {
|
else {
|
if($mybb->settings['errortypemedium'] == "none" || $mybb->settings['errortypemedium'] == "error")
| // Do we have a PHP error? if(my_strpos(my_strtolower($this->error_types[$type]), 'warning') === false)
|
{
|
{
|
echo "<div class=\"php_warning\">MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.</div>";
| $this->output_error($type, $message, $file, $line);
|
}
|
}
|
| // PHP Error
|
else {
|
else {
|
global $templates;
$warning = "<strong>{$this->error_types[$type]}</strong> [$type] $message - Line: $line - File: $file PHP ".PHP_VERSION." (".PHP_OS.")<br />\n"; if(is_object($templates) && method_exists($templates, "get") && !defined("IN_ADMINCP")) { $this->warnings .= $warning; $this->warnings .= $this->generate_backtrace(); }
| if($mybb->settings['errortypemedium'] == "none" || $mybb->settings['errortypemedium'] == "error") { echo "<div class=\"php_warning\">MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.</div>"; }
|
else {
|
else {
|
echo "<div class=\"php_warning\">{$warning}".$this->generate_backtrace()."</div>";
| global $templates;
$warning = "<strong>{$this->error_types[$type]}</strong> [$type] $message - Line: $line - File: $file PHP ".PHP_VERSION." (".PHP_OS.")<br />\n"; if(is_object($templates) && method_exists($templates, "get") && !defined("IN_ADMINCP")) { $this->warnings .= $warning; $this->warnings .= $this->generate_backtrace(); } else { echo "<div class=\"php_warning\">{$warning}".$this->generate_backtrace()."</div>"; }
|
} } }
| } } }
|
Zeile 247 | Zeile 258 |
---|
if(empty($this->warnings)) { return false;
|
if(empty($this->warnings)) { return false;
|
}
| }
|
// Incase a template fails and we're receiving a blank page. if(MANUAL_WARNINGS) { echo $this->warnings."<br />";
|
// Incase a template fails and we're receiving a blank page. if(MANUAL_WARNINGS) { echo $this->warnings."<br />";
|
}
| }
|
if(!$lang->warnings) { $lang->warnings = "The following warnings occurred:";
|
if(!$lang->warnings) { $lang->warnings = "The following warnings occurred:";
|
}
$template_exists = false;
| }
$template_exists = false;
|
if(!is_object($templates) || !method_exists($templates, 'get')) {
| if(!is_object($templates) || !method_exists($templates, 'get')) {
|
Zeile 274 | Zeile 285 |
---|
else { $template_exists = true;
|
else { $template_exists = true;
|
}
| }
|
$warning = ''; if($template_exists == true) {
| $warning = ''; if($template_exists == true) {
|
Zeile 297 | Zeile 308 |
---|
global $lang;
if(!$message)
|
global $lang;
if(!$message)
|
{
| {
|
$message = $lang->unknown_user_trigger; }
| $message = $lang->unknown_user_trigger; }
|
Zeile 313 | Zeile 324 |
---|
/** * Logs the error in the specified error log file.
|
/** * Logs the error in the specified error log file.
|
* * @param string $type Warning type * @param string $message Warning message
| * * @param string $type Warning type * @param string $message Warning message
|
* @param string $file Warning file * @param integer $line Warning line */
| * @param string $file Warning file * @param integer $line Warning line */
|
Zeile 374 | Zeile 385 |
---|
if(!$mybb->settings['adminemail']) { return false;
|
if(!$mybb->settings['adminemail']) { return false;
|
}
if($type == MYBB_SQL)
| }
if($type == MYBB_SQL)
|
{ $message = "SQL Error: {$message['error_no']} - {$message['error']}\nQuery: {$message['query']}"; }
| { $message = "SQL Error: {$message['error_no']} - {$message['error']}\nQuery: {$message['query']}"; }
|
Zeile 421 | Zeile 432 |
---|
{ $title = "MyBB SQL Error"; $error_message = "<p>MyBB has experienced an internal SQL error and cannot continue.</p>";
|
{ $title = "MyBB SQL Error"; $error_message = "<p>MyBB has experienced an internal SQL error and cannot continue.</p>";
|
if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE"))
| if($this->force_display_errors || $mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE"))
|
{ $message['query'] = htmlspecialchars_uni($message['query']); $message['error'] = htmlspecialchars_uni($message['error']);
| { $message['query'] = htmlspecialchars_uni($message['query']); $message['error'] = htmlspecialchars_uni($message['error']);
|
Zeile 438 | Zeile 449 |
---|
{ $title = "MyBB Internal Error"; $error_message = "<p>MyBB has experienced an internal error and cannot continue.</p>";
|
{ $title = "MyBB Internal Error"; $error_message = "<p>MyBB has experienced an internal error and cannot continue.</p>";
|
if($mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE"))
| if($this->force_display_errors || $mybb->settings['errortypemedium'] == "both" || $mybb->settings['errortypemedium'] == "error" || defined("IN_INSTALL") || defined("IN_UPGRADE"))
|
{ $error_message .= "<dl>\n"; $error_message .= "<dt>Error Type:</dt>\n<dd>{$this->error_types[$type]} ($type)</dd>\n";
| { $error_message .= "<dl>\n"; $error_message .= "<dt>Error Type:</dt>\n<dd>{$this->error_types[$type]} ($type)</dd>\n";
|
Zeile 500 | Zeile 511 |
---|
else { $parser_exists = true;
|
else { $parser_exists = true;
|
}
| }
|
if($parser_exists) { $code = $parser->mycode_parse_php($code, true);
| if($parser_exists) { $code = $parser->mycode_parse_php($code, true);
|
Zeile 524 | Zeile 535 |
---|
}
if(isset($lang->settings['charset']))
|
}
if(isset($lang->settings['charset']))
|
{
| {
|
$charset = $lang->settings['charset']; } else
| $charset = $lang->settings['charset']; } else
|
Zeile 540 | Zeile 551 |
---|
{ $mybb->settings['contactlink'] = $mybb->settings['bburl'].'/'.$mybb->settings['contactlink']; }
|
{ $mybb->settings['contactlink'] = $mybb->settings['bburl'].'/'.$mybb->settings['contactlink']; }
|
|
|
$contact_site_owner = <<<HTML If this problem persists, please <a href="{$mybb->settings['contactlink']}">contact the site owner</a>. HTML; }
|
$contact_site_owner = <<<HTML If this problem persists, please <a href="{$mybb->settings['contactlink']}">contact the site owner</a>. HTML; }
|
$contact = <<<HTML
| $additional_name = ''; $docs_link = 'https://docs.mybb.com'; $common_issues_link = 'https://docs.mybb.com/1.8/faq/'; $support_link = 'https://community.mybb.com/';
if(isset($lang->settings['docs_link'])) { $docs_link = $lang->settings['docs_link']; }
if(isset($lang->settings['common_issues_link'])) { $common_issues_link = $lang->settings['common_issues_link']; }
if(isset($lang->settings['support_link'])) { $support_link = $lang->settings['support_link']; }
if(isset($lang->settings['additional_name'])) { $additional_name = $lang->settings['additional_name']; }
$contact = <<<HTML
|
<p> <strong>If you're a visitor of this website</strong>, please wait a few minutes and try again.{$contact_site_owner} </p>
<p>
|
<p> <strong>If you're a visitor of this website</strong>, please wait a few minutes and try again.{$contact_site_owner} </p>
<p>
|
<strong>If you are the site owner</strong>, please check the <a href="https://docs.mybb.com">MyBB Documentation</a> for help resolving <a href="https://docs.mybb.com/1.8/faq/">common issues</a>, or get technical help on the <a href="https://community.mybb.com/">MyBB Community Forums</a>.
| <strong>If you are the site owner</strong>, please check the <a href="{$docs_link}">MyBB{$additional_name} Documentation</a> for help resolving <a href="{$common_issues_link}">common issues</a>, or get technical help on the <a href="{$support_link}">MyBB{$additional_name} Community Forums</a>.
|
</p> HTML;
| </p> HTML;
|
Zeile 563 | Zeile 600 |
---|
@header('Retry-After: 1800'); @header("Content-type: text/html; charset={$charset}"); $file_name = htmlspecialchars_uni(basename($_SERVER['SCRIPT_FILENAME']));
|
@header('Retry-After: 1800'); @header("Content-type: text/html; charset={$charset}"); $file_name = htmlspecialchars_uni(basename($_SERVER['SCRIPT_FILENAME']));
|
echo <<<EOF
| echo <<<EOF
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head profile="http://gmpg.org/xfn/11">
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head profile="http://gmpg.org/xfn/11">
|
Zeile 602 | Zeile 639 |
---|
</div> </body> </html>
|
</div> </body> </html>
|
EOF; }
| EOF; }
|
else { echo <<<EOF
| else { echo <<<EOF
|
Zeile 626 | Zeile 663 |
---|
</div> EOF; }
|
</div> EOF; }
|
|
|
exit(1); }
| exit(1); }
|