Vergleich inc/class_error.php - 1.8.4 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 136Zeile 136
	/**
* Parses a error for processing.
*

	/**
* Parses a error for processing.
*

	 * @param string The error type (i.e. E_ERROR, E_FATAL)
* @param string The error message
* @param string The error file
* @param integer The error line

	 * @param string $type The error type (i.e. E_ERROR, E_FATAL)
* @param string $message The error message
* @param string $file The error file
* @param integer $line The error line

	 * @return boolean True if parsing was a success, otherwise assume a error
*/
function error($type, $message, $file=null, $line=0)

	 * @return boolean True if parsing was a success, otherwise assume a error
*/
function error($type, $message, $file=null, $line=0)

Zeile 174Zeile 174

require_once MYBB_ROOT."inc/functions_task.php";



require_once MYBB_ROOT."inc/functions_task.php";


 
			$filestr = '';

			if($file)
{
$filestr = " - Line: $line - File: $file";

			if($file)
{
$filestr = " - Line: $line - File: $file";

Zeile 237Zeile 238
	/**
* Returns all the warnings
*

	/**
* Returns all the warnings
*

	 * @return string The warnings

	 * @return string|bool The warnings or false if no warnings exist

	 */
function show_warnings()
{

	 */
function show_warnings()
{

Zeile 275Zeile 276
			$template_exists = true;
}


			$template_exists = true;
}


 
		$warning = '';

		if($template_exists == true)
{
eval("\$warning = \"".$templates->get("php_warnings")."\";");

		if($template_exists == true)
{
eval("\$warning = \"".$templates->get("php_warnings")."\";");

Zeile 287Zeile 289
	 * Triggers a user created error
* Example: $error_handler->trigger("Some Warning", E_USER_ERROR);
*

	 * Triggers a user created error
* Example: $error_handler->trigger("Some Warning", E_USER_ERROR);
*

	 * @param string Message
* @param string Type

	 * @param string $message Message
* @param string|int $type Type

	 */
function trigger($message="", $type=E_USER_ERROR)
{

	 */
function trigger($message="", $type=E_USER_ERROR)
{

Zeile 312Zeile 314
	/**
* Logs the error in the specified error log file.
*

	/**
* Logs the error in the specified error log file.
*

	 * @param string Warning type
* @param string Warning message
* @param string Warning file
* @param integer Warning line

	 * @param string $type Warning type
* @param string $message Warning message
* @param string $file Warning file
* @param integer $line Warning line

	 */
function log_error($type, $message, $file, $line)
{

	 */
function log_error($type, $message, $file, $line)
{

Zeile 328Zeile 330

// Do not log something that might be executable
$message = str_replace('<?', '< ?', $message);


// Do not log something that might be executable
$message = str_replace('<?', '< ?', $message);

 

if(function_exists('debug_backtrace'))
{
ob_start();
debug_print_backtrace();
$trace = ob_get_contents();
ob_end_clean();

$back_trace = "\t<back_trace>{$trace}</back_trace>\n";
}
else
{
$back_trace = '';
}


$error_data = "<error>\n";
$error_data .= "\t<dateline>".TIME_NOW."</dateline>\n";


$error_data = "<error>\n";
$error_data .= "\t<dateline>".TIME_NOW."</dateline>\n";

Zeile 336Zeile 352
		$error_data .= "\t<type>".$type."</type>\n";
$error_data .= "\t<friendly_type>".$this->error_types[$type]."</friendly_type>\n";
$error_data .= "\t<message>".$message."</message>\n";

		$error_data .= "\t<type>".$type."</type>\n";
$error_data .= "\t<friendly_type>".$this->error_types[$type]."</friendly_type>\n";
$error_data .= "\t<message>".$message."</message>\n";

 
		$error_data .= $back_trace;

		$error_data .= "</error>\n\n";

if(trim($mybb->settings['errorloglocation']) != "")

		$error_data .= "</error>\n\n";

if(trim($mybb->settings['errorloglocation']) != "")

		{

		{

			@error_log($error_data, 3, $mybb->settings['errorloglocation']);
}
else

			@error_log($error_data, 3, $mybb->settings['errorloglocation']);
}
else

Zeile 351Zeile 368
	/**
* Emails the error in the specified error log file.
*

	/**
* Emails the error in the specified error log file.
*

	 * @param string Warning type
* @param string Warning message
* @param string Warning file
* @param integer Warning line


	 * @param string $type Warning type
* @param string $message Warning message
* @param string $file Warning file
* @param integer $line Warning line
* @return bool returns false if no admin email is set

	 */
function email_error($type, $message, $file, $line)
{

	 */
function email_error($type, $message, $file, $line)
{

Zeile 363Zeile 381
		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']}";
}


		$message = "Your copy of MyBB running on {$mybb->settings['bbname']} ({$mybb->settings['bburl']}) has experienced an error. Details of the error include:\n---\nType: $type\nFile: $file (Line no. $line)\nMessage\n$message";















		if(function_exists('debug_backtrace'))
{
ob_start();
debug_print_backtrace();
$trace = ob_get_contents();
ob_end_clean();

$back_trace = "\nBack Trace: {$trace}";
}
else
{
$back_trace = '';
}

$message = "Your copy of MyBB running on {$mybb->settings['bbname']} ({$mybb->settings['bburl']}) has experienced an error. Details of the error include:\n---\nType: $type\nFile: $file (Line no. $line)\nMessage\n$message{$back_trace}";


@my_mail($mybb->settings['adminemail'], "MyBB error on {$mybb->settings['bbname']}", $message, $mybb->settings['adminemail']);


@my_mail($mybb->settings['adminemail'], "MyBB error on {$mybb->settings['bbname']}", $message, $mybb->settings['adminemail']);

 

return true;

	}


	}


 
	/**
* @param string $type
* @param string $message
* @param string $file
* @param int $line
*/

	function output_error($type, $message, $file, $line)
{

	function output_error($type, $message, $file, $line)
{

		global $mybb, $parser;

		global $mybb, $parser, $lang;


if(!$mybb->settings['bbname'])
{


if(!$mybb->settings['bbname'])
{

Zeile 505Zeile 545
			@header('Status: 503 Service Temporarily Unavailable');
@header('Retry-After: 1800');
@header("Content-type: text/html; charset={$charset}");

			@header('Status: 503 Service Temporarily Unavailable');
@header('Retry-After: 1800');
@header("Content-type: text/html; charset={$charset}");

			$_SERVER['PHP_SELF'] = htmlspecialchars_uni($_SERVER['PHP_SELF']);

			$file_name = htmlspecialchars_uni(basename($_SERVER['SCRIPT_FILENAME']));


echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Zeile 519Zeile 559
		a:visited {	color: #026CB1;	text-decoration: none; }
a:hover, a:active { color: #000; text-decoration: underline; }
#container { width: 600px; padding: 20px; background: #fff; border: 1px solid #e4e4e4; margin: 100px auto; text-align: left; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; }

		a:visited {	color: #026CB1;	text-decoration: none; }
a:hover, a:active { color: #000; text-decoration: underline; }
#container { width: 600px; padding: 20px; background: #fff; border: 1px solid #e4e4e4; margin: 100px auto; text-align: left; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; }

		h1 { margin: 0; background: url({$_SERVER['PHP_SELF']}?action=mybb_logo) no-repeat;	height: 82px; width: 248px; }

		h1 { margin: 0; background: url({$file_name}?action=mybb_logo) no-repeat;	height: 82px; width: 248px; }

		#content { border: 1px solid #026CB1; background: #fff; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
h2 { font-size: 12px; padding: 4px; background: #026CB1; color: #fff; margin: 0; }
.invisible { display: none; }

		#content { border: 1px solid #026CB1; background: #fff; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
h2 { font-size: 12px; padding: 4px; background: #026CB1; color: #fff; margin: 0; }
.invisible { display: none; }

Zeile 531Zeile 571
<body>
<div id="container">
<div id="logo">

<body>
<div id="container">
<div id="logo">

			<h1><a href="http://www.mybb.com/" title="MyBB"><span class="invisible">MyBB</span></a></h1>

			<h1><a href="https://mybb.com/" title="MyBB"><span class="invisible">MyBB</span></a></h1>

		</div>

<div id="content">

		</div>

<div id="content">

Zeile 539Zeile 579

<div id="error">
{$error_message}


<div id="error">
{$error_message}

				<p id="footer">Please contact the <a href="http://www.mybb.com">MyBB Group</a> for technical support.</p>

				<p id="footer">Please contact the <a href="https://mybb.com">MyBB Group</a> for technical support.</p>

			</div>
</div>
</div>

			</div>
</div>
</div>

Zeile 564Zeile 604
		<h2>{$title}</h2>
<div id="mybb_error_error">
{$error_message}

		<h2>{$title}</h2>
<div id="mybb_error_error">
{$error_message}

			<p id="mybb_error_footer">Please contact the <a href="http://www.mybb.com">MyBB Group</a> for technical support.</p>

			<p id="mybb_error_footer">Please contact the <a href="https://mybb.com">MyBB Group</a> for technical support.</p>

		</div>
</div>
EOF;

		</div>
</div>
EOF;

Zeile 579Zeile 619
	 */
function generate_backtrace()
{

	 */
function generate_backtrace()
{

 
		$backtrace = '';

		if(function_exists("debug_backtrace"))
{
$trace = debug_backtrace();

		if(function_exists("debug_backtrace"))
{
$trace = debug_backtrace();