summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-09-27 03:41:58 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-09-27 03:41:58 +0000
commitf4fc97cd88466e913f480945a6d0ab1669402f2d (patch)
treeccff2af7b76af389a4874ecb8713cc80479c5edd /etc/inc
parentad6eae25dcd2aa4137f603a3e4b6fd14978a9c7f (diff)
downloadpfsense-f4fc97cd88466e913f480945a6d0ab1669402f2d.zip
pfsense-f4fc97cd88466e913f480945a6d0ab1669402f2d.tar.gz
Only write out $fd_log items if a handle exists
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/pfsense-utils.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 0f89313..e16c2d2 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -756,10 +756,12 @@ function add_rule_to_anchor($anchor, $rule, $label) {
*/
function remove_text_from_file($file, $text) {
global $fd_log;
- fwrite($fd_log, "Adding needed text items:\n");
+ if($fd_log)
+ fwrite($fd_log, "Adding needed text items:\n");
$filecontents = exec_command_and_return_text("cat " . $file);
$textTMP = str_replace($text, "", $filecontents);
$text .= $textTMP;
+ if($fd_log)
fwrite($fd_log, $text . "\n");
$fd = fopen($file, "w");
fwrite($fd, $text);
OpenPOWER on IntegriCloud