mirror of
https://github.com/Xkeeper0/jul.git
synced 2025-08-09 00:22:01 -07:00
Fixing error reporting (for real)
This commit is contained in:
@@ -349,11 +349,13 @@ function calclvl($exp){
|
|||||||
}
|
}
|
||||||
function printtimedif($timestart){
|
function printtimedif($timestart){
|
||||||
global $x_hacks;
|
global $x_hacks;
|
||||||
|
|
||||||
$timenow=gettimeofday();
|
$timenow=gettimeofday();
|
||||||
$timedif=number_format(microtime(true) - $timestart, 3); /* sprintf('%01.3f',$timenow[sec]+$timenow[usec]/1000000-$timestart); */
|
$timedif=number_format(microtime(true) - $timestart, 3); /* sprintf('%01.3f',$timenow[sec]+$timenow[usec]/1000000-$timestart); */
|
||||||
print "<br>$smallfont Page rendered in $timedif seconds.";
|
print "<br>$smallfont Page rendered in $timedif seconds.";
|
||||||
|
|
||||||
errorprinter();
|
print "<div id='errors' style='width: 100%; margin: 0; text-align: left;'>". errorprinter(true) ."</div>";
|
||||||
|
|
||||||
|
|
||||||
if (!$x_hacks['host']) {
|
if (!$x_hacks['host']) {
|
||||||
$pages = array(
|
$pages = array(
|
||||||
@@ -367,6 +369,9 @@ function printtimedif($timestart){
|
|||||||
mysql_query("DELETE FROM `rendertimes` WHERE `time` < '". (ctime() - 86400 * 14) ."'");
|
mysql_query("DELETE FROM `rendertimes` WHERE `time` < '". (ctime() - 86400 * 14) ."'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "</body></html>";
|
||||||
|
|
||||||
}
|
}
|
||||||
function generatenumbergfx($num,$minlen=0,$double=false){
|
function generatenumbergfx($num,$minlen=0,$double=false){
|
||||||
global $numdir;
|
global $numdir;
|
||||||
@@ -1313,7 +1318,7 @@ pw_d.projectwonderful_background_color = \"#$bgcolor\";
|
|||||||
if ($type == -1) {
|
if ($type == -1) {
|
||||||
$output = "";
|
$output = "";
|
||||||
foreach ($elog as $out) {
|
foreach ($elog as $out) {
|
||||||
$output .= "$out<br>";
|
$output .= "$out<br>\n";
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@@ -1334,7 +1339,7 @@ pw_d.projectwonderful_background_color = \"#$bgcolor\";
|
|||||||
E_RECOVERABLE_ERROR => "Recoverable Error",
|
E_RECOVERABLE_ERROR => "Recoverable Error",
|
||||||
);
|
);
|
||||||
|
|
||||||
$elog[] = $errortypes[$type] ."<small> ($file : $line)</small> $msg";
|
$elog[] = $errortypes[$type] ."<small> (". str_replace($_SERVER['DOCUMENT_ROOT'], "", $file) ." #$line)</small> ". htmlspecialchars($msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1342,7 +1347,7 @@ pw_d.projectwonderful_background_color = \"#$bgcolor\";
|
|||||||
// Function runs twice, once when called by printtimedif and once at the end of a script
|
// Function runs twice, once when called by printtimedif and once at the end of a script
|
||||||
// If it's called in printtimedif, it doesn't print the errors twice (that way they always get out even if printtimedif isn't called)
|
// If it's called in printtimedif, it doesn't print the errors twice (that way they always get out even if printtimedif isn't called)
|
||||||
// Also tries to not break gd-images or other things
|
// Also tries to not break gd-images or other things
|
||||||
function errorprinter() {
|
function errorprinter($return = false) {
|
||||||
static $done = false;
|
static $done = false;
|
||||||
|
|
||||||
global $displayerrors;
|
global $displayerrors;
|
||||||
@@ -1350,21 +1355,25 @@ pw_d.projectwonderful_background_color = \"#$bgcolor\";
|
|||||||
|
|
||||||
if ($displayerrors && !$done) {
|
if ($displayerrors && !$done) {
|
||||||
|
|
||||||
|
$done = true;
|
||||||
$headers = headers_list();
|
$headers = headers_list();
|
||||||
$silence = false;
|
$silence = false;
|
||||||
|
|
||||||
// Half-heartedly check to see if this is a PHP-generated image or some other fun thing.
|
// Half-heartedly check to see if this is a PHP-generated image or some other fun thing.
|
||||||
// If so, try to silence error reporting so that they don't break.
|
// If so, try to silence error reporting so that they don't break.
|
||||||
foreach ($headers as $header) {
|
foreach ($headers as $header) {
|
||||||
if (strpos("Content-type:") !== false && strpos("image/") !== false) {
|
if (strpos($header, "Content-type:") !== false && strpos($header, "image/") !== false) {
|
||||||
$silence = true;
|
$silence = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$silence) {
|
if (!$silence) {
|
||||||
print errorhandler(-1);
|
if ($return) {
|
||||||
|
return errorhandler(-1);
|
||||||
|
} else {
|
||||||
|
print errorhandler(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$done = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -446,8 +446,8 @@ pageTracker._trackPageview();
|
|||||||
<br><small>©2000-2010 Acmlm, Emuz, Blades, Xkeeper</small> <!--
|
<br><small>©2000-2010 Acmlm, Emuz, Blades, Xkeeper</small> <!--
|
||||||
<br><img src=\"images/4funin1.png\" title=\"totally!\" width=448 height=48> -->
|
<br><img src=\"images/4funin1.png\" title=\"totally!\" width=448 height=48> -->
|
||||||
$honeypotl
|
$honeypotl
|
||||||
". ($x_hacks['mmdeath'] >= 0 ? "<div style='position: absolute; top: -100px; left: -100px;'>Hidden preloader for doom numbers:
|
". ($x_hacks['mmdeath'] > 0 ? "<div style='position: absolute; top: -100px; left: -100px;'>Hidden preloader for doom numbers:
|
||||||
<img src='numgfx/death/0.png'> <img src='numgfx/death/1.png'> <img src='numgfx/death/2.png'> <img src='numgfx/death/3.png'> <img src='numgfx/death/4.png'> <img src='numgfx/death/5.png'> <img src='numgfx/death/6.png'> <img src='numgfx/death/7.png'> <img src='numgfx/death/8.png'> <img src='numgfx/death/9.png'>" : "") ."
|
<img src='numgfx/death/0.png'> <img src='numgfx/death/1.png'> <img src='numgfx/death/2.png'> <img src='numgfx/death/3.png'> <img src='numgfx/death/4.png'> <img src='numgfx/death/5.png'> <img src='numgfx/death/6.png'> <img src='numgfx/death/7.png'> <img src='numgfx/death/8.png'> <img src='numgfx/death/9.png'></div>" : "") ."
|
||||||
<!-- Piwik -->
|
<!-- Piwik -->
|
||||||
<script type=\"text/javascript\">
|
<script type=\"text/javascript\">
|
||||||
var pkBaseURL = ((\"https:\" == document.location.protocol) ? \"https://stats.rustedlogic.net/\" : \"http://stats.rustedlogic.net/\");
|
var pkBaseURL = ((\"https:\" == document.location.protocol) ? \"https://stats.rustedlogic.net/\" : \"http://stats.rustedlogic.net/\");
|
||||||
@@ -463,7 +463,6 @@ piwikTracker.enableLinkTracking();
|
|||||||
<!--<script type=\"text/javascript\" src=\"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js\"></script>
|
<!--<script type=\"text/javascript\" src=\"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js\"></script>
|
||||||
<script type=\"text/javascript\" src=\"js/useful.js\"></script> -->
|
<script type=\"text/javascript\" src=\"js/useful.js\"></script> -->
|
||||||
|
|
||||||
</body></html>
|
|
||||||
";
|
";
|
||||||
if($ipbanned) {
|
if($ipbanned) {
|
||||||
if ($loguser['title'] == "Banned; account hijacked. Contact admin via PM to change it.") {
|
if ($loguser['title'] == "Banned; account hijacked. Contact admin via PM to change it.") {
|
||||||
|
Reference in New Issue
Block a user