From 7ca82e48242ebb861a522687fb258d2e1b3d2d5e Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 27 Jun 2018 15:16:23 +0200 Subject: dont use safer file funcs in it::error, could theoretically recurse --- it.class | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/it.class b/it.class index 502c554..01fe916 100644 --- a/it.class +++ b/it.class @@ -171,7 +171,7 @@ static function error($p = array()) else $url = $_SERVER['SCRIPT_NAME'] . " " . join(" ", array_slice($GLOBALS['argv'], 1)) . " (pwd " . $_SERVER['PWD'] . ")"; - $gods = strtr(trim(@it::file_get_contents($GLOBALS['ULTRAHOME'] . "/.diffnotice")), array("\n"=>', ')); + $gods = strtr(trim(@file_get_contents($GLOBALS['ULTRAHOME'] . "/.diffnotice")), array("\n"=>', ')); if (!$p['to']) unset($p['to']); # allow defaults to kick in $p += array( @@ -196,8 +196,8 @@ static function error($p = array()) if ($p['okstate']) { list($okfn, $okstatus) = explode("=", "/tmp/alertdata/okstate_" . $p['okstate']); - $failcount = $okstatus ? 0 : (int)@it::file_get_contents($okfn) + 1; - it::file_put_contents($okfn, "$failcount\n"); + $failcount = $okstatus ? 0 : (int)@file_get_contents($okfn) + 1; + file_put_contents($okfn, "$failcount\n"); if ($failcount != $p['failcount'] && $failcount != $p['failcount'] * 2) return; } @@ -247,7 +247,7 @@ static function error($p = array()) $p['body'] = is_string($p['body']) || !array_key_exists('body', $p) ? $p['body'] : var_export($p['body'], true); if (strlen($p['body']) > 500000) { - it::file_put_contents($datafn = "/tmp/alertdata/error-" . substr(md5($p['body']), 0, 2), $p['body']); + file_put_contents($datafn = "/tmp/alertdata/error-" . substr(md5($p['body']), 0, 2), $p['body']); $p['body'] = "Body: " . getenv('HOSTNAME') . ":$datafn"; } -- cgit v1.2.3