summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2011-02-06 13:51:21 -0500
committerScott Ullrich <sullrich@pfsense.org>2011-02-06 13:51:21 -0500
commit3a6cda80526d676a709c6ca1190d0f57f35a741c (patch)
treec7ae82466b4ba48f89dd661f5c838989002e74cf
parent52cdb50b3df5facf9de1318f7318fea2cd09fbb0 (diff)
downloadpfsense-3a6cda80526d676a709c6ca1190d0f57f35a741c.zip
pfsense-3a6cda80526d676a709c6ca1190d0f57f35a741c.tar.gz
Correctly detect amount of files in /var/crash
-rwxr-xr-xusr/local/www/crash_reporter.php8
-rwxr-xr-xusr/local/www/index.php12
2 files changed, 15 insertions, 5 deletions
diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php
index 9ac0eaa..2dd9a50 100755
--- a/usr/local/www/crash_reporter.php
+++ b/usr/local/www/crash_reporter.php
@@ -69,11 +69,11 @@ function output_crash_reporter_html($crash_reports) {
echo "<strong>" . gettext("Would you like to submit the crash debug logs to the pfSense developers for inspection?") . "</strong></p>";
echo "<p>";
echo gettext("Contents of crash reports") . ":<br/>";
- echo "<textarea rows='60' cols='65' name='crashreports'>{$crash_reports}</textarea>";
+ echo "<textarea rows='40' cols='65' name='crashreports'>{$crash_reports}</textarea>";
+ echo "<p/>";
+ echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") . "\">";
+ echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") . "\">";
echo "<p/>";
- echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") . ">";
- echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") . ">";
- echo "</p>";
echo "</form>";
}
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index 1ea8e5b..30c369d 100755
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -43,8 +43,18 @@
##|-PRIV
$crash = glob("/var/crash/*");
+$x = 0;
if(is_array($crash)) {
- if(count($crash) > 0) {
+ foreach($crash as $c) {
+ if($c == ".")
+ continue;
+ if($c == "..")
+ continue;
+ if($c == "")
+ continue;
+ $x++;
+ }
+ if($x > 0) {
Header("Location: /crash_reporter.php");
exit;
}
OpenPOWER on IntegriCloud