diff options
author | Phil Davis <phil.davis@inf.org> | 2016-06-28 09:01:31 +0930 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-06-28 22:01:42 -0500 |
commit | 6dfb6b27d8320947fb07865ae5e2ebfa17c1e3fc (patch) | |
tree | 7d391fe718cb04ec61d0593c2568e87d5ebee1cb /src/usr/local/www/index.php | |
parent | e8019bcde8dc8db6349f93b963d41172a60f06f8 (diff) | |
download | pfsense-6dfb6b27d8320947fb07865ae5e2ebfa17c1e3fc.zip pfsense-6dfb6b27d8320947fb07865ae5e2ebfa17c1e3fc.tar.gz |
Update include() to include_once()
For safety, use include_once() when including various "side" files.
There are a couple of instances of include("guiconfig,inc") that I
changes to use require_once() to be consistent with everywhere else.
The remaining cases of include() are just (hundreds of) head.inc and
footer.inc - those are only at the start/end of the ordinary top-level
interactive PHP files. There is no nested interaction of those to think
about, so that should be fine.
Diffstat (limited to 'src/usr/local/www/index.php')
-rw-r--r-- | src/usr/local/www/index.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php index 1f2eac0..0cd459c 100644 --- a/src/usr/local/www/index.php +++ b/src/usr/local/www/index.php @@ -130,7 +130,7 @@ while (false !== ($filename = readdir($dirhandle))) { ## These define vars that specify the widget title and title link. foreach ($phpincludefiles as $includename) { if (file_exists($directory . $includename)) { - include($directory . $includename); + include_once($directory . $includename); } } @@ -425,7 +425,7 @@ foreach ($widgets as $widgetname => $widgetconfig) { </h2> </div> <div id="widget-<?=$widgetname?>_panel-body" class="panel-body collapse<?=($widgetconfig['display'] == 'close' ? '' : ' in')?>"> - <?php include('/usr/local/www/widgets/widgets/'. $widgetname.'.widget.php'); ?> + <?php include_once('/usr/local/www/widgets/widgets/'. $widgetname.'.widget.php'); ?> </div> </div> <?php |