diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-09-04 12:34:36 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-09-04 12:34:36 +0000 |
commit | 4fbca5a8ce75059e94e11339e251acf707a1d7c2 (patch) | |
tree | b45ef8494875c2a18ac0e4868966a5bdbe51f771 | |
parent | 61dd070d52e4af3a660328107d502ca04d898d9b (diff) | |
download | pkgsubmit-4fbca5a8ce75059e94e11339e251acf707a1d7c2.tar pkgsubmit-4fbca5a8ce75059e94e11339e251acf707a1d7c2.tar.gz pkgsubmit-4fbca5a8ce75059e94e11339e251acf707a1d7c2.tar.bz2 pkgsubmit-4fbca5a8ce75059e94e11339e251acf707a1d7c2.tar.xz pkgsubmit-4fbca5a8ce75059e94e11339e251acf707a1d7c2.zip |
check path exists before stat(), define defaults
-rw-r--r-- | test_index.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test_index.php b/test_index.php index 31a7408..f57fb71 100644 --- a/test_index.php +++ b/test_index.php @@ -170,9 +170,13 @@ if ($total > 0) { } // check if emi is running -$stat = stat("/var/lib/schedbot/tmp/upload"); -if ($stat) { - $upload_time = $stat['mtime']; +$upload_time = null; +$stat = null; +if (file_exists('/var/lib/schedbot/tmp/upload')) { + $stat = stat('/var/lib/schedbot/tmp/upload'); + if ($stat) { + $upload_time = $stat['mtime']; + } } // publish stats as headers @@ -269,7 +273,7 @@ if (!isset($_GET['package'])) { ); } - if ($upload_time) { + if (!is_null($upload_time)) { $figures_list[] = sprintf('<p>Upload in progress for %s.</p>', timediff($upload_time)); } |