diff options
author | Phil Davis <phil.davis@inf.org> | 2015-12-17 11:53:44 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-12-17 11:53:44 +0545 |
commit | e3843a0890b48a7176c6b5e4208bab6a771a7b45 (patch) | |
tree | 646aa1836a0daa3aedc7fb1175650f500a65d863 /src | |
parent | 9851ce32c1c40281fd76ac1ff140acaccbcc1d30 (diff) | |
download | pfsense-e3843a0890b48a7176c6b5e4208bab6a771a7b45.zip pfsense-e3843a0890b48a7176c6b5e4208bab6a771a7b45.tar.gz |
Use different var name looping through columns
There is some problem with the var $i getting reset somehow somewhere
related to the include of each widget PHP code. I found that this was
doing $i = 1, $i = 2 and then $i = 2 again and I got fatal errors
because each widget code was being included twice.
Crash report begins. Anonymous machine information:
amd64
10.2-STABLE
FreeBSD 10.2-STABLE #245 1b7c029(devel): Mon Dec 14 04:17:47 CST 2015
root@pfs23-amd64-builder:/usr/home/pfsense/pfsense/tmp/obj/usr/home/pfsense/pfsense/tmp/FreeBSD-src/sys/pfSense
Crash report details:
PHP Errors:
[17-Dec-2015 10:10:50 Asia/Kathmandu] PHP Fatal error: Cannot redeclare
getServerDateItems() (previously declared in
/usr/local/www/widgets/widgets/ntp_status.widget.php:64) in
/usr/local/www/widgets/widgets/ntp_status.widget.php on line 64
[17-Dec-2015 10:10:50 Asia/Kathmandu] PHP Stack trace:
[17-Dec-2015 10:10:50 Asia/Kathmandu] PHP 1. {main}()
/usr/local/www/index.php:0
[17-Dec-2015 10:10:53 Asia/Kathmandu] PHP Fatal error: Cannot redeclare
getServerDateItems() (previously declared in
/usr/local/www/widgets/widgets/ntp_status.widget.php:64) in
/usr/local/www/widgets/widgets/ntp_status.widget.php on line 64
[17-Dec-2015 10:10:53 Asia/Kathmandu] PHP Stack trace:
[17-Dec-2015 10:10:53 Asia/Kathmandu] PHP 1. {main}()
/usr/local/www/index.php:0
[17-Dec-2015 10:11:27 Asia/Kathmandu] PHP Fatal error: Cannot redeclare
getServerDateItems() (previously declared in
/usr/local/www/widgets/widgets/ntp_status.widget.php:64) in
/usr/local/www/widgets/widgets/ntp_status.widget.php on line 64
[17-Dec-2015 10:11:27 Asia/Kathmandu] PHP Stack trace:
[17-Dec-2015 10:11:27 Asia/Kathmandu] PHP 1. {main}()
/usr/local/www/index.php:0
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/index.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php index 214f129..f6d5b93 100644 --- a/src/usr/local/www/index.php +++ b/src/usr/local/www/index.php @@ -381,13 +381,12 @@ foreach ($widgets as $widgetname => $widgetconfig) { <?php $columnWidth = 12 / $numColumns; - for ($i=1; $i<=$numColumns; $i++) { - echo '<div class="col-md-' . $columnWidth . '" id="widgets-col' . $i . '">'; + for ($currentColumnNumber = 1; $currentColumnNumber <= $numColumns; $currentColumnNumber++) { + echo '<div class="col-md-' . $columnWidth . '" id="widgets-col' . $currentColumnNumber . '">'; - //if col$i exists - if (isset($widgetColumns['col'.$i])) { - - $columnWidgets = $widgetColumns['col'.$i]; + //if col$currentColumnNumber exists + if (isset($widgetColumns['col'.$currentColumnNumber])) { + $columnWidgets = $widgetColumns['col'.$currentColumnNumber]; foreach ($columnWidgets as $widgetname => $widgetconfig) { // Compose the widget title and include the title link if available @@ -422,7 +421,7 @@ foreach ($widgets as $widgetname => $widgetconfig) { <?php } } else { - echo '<div class="col-md-' . $columnWidth . '" id="widgets-col' . $i . '"></div>'; + echo '<div class="col-md-' . $columnWidth . '" id="widgets-col' . $currentColumnNumber . '"></div>'; } echo "</div>"; } |