Commit 6652e239 authored by Franco Fichtner's avatar Franco Fichtner

src: multiple crash reports and whitespace sweep

parent f6301ca7
...@@ -46,7 +46,7 @@ with zipfile.ZipFile(output_data, mode='w', compression=zipfile.ZIP_DEFLATED) as ...@@ -46,7 +46,7 @@ with zipfile.ZipFile(output_data, mode='w', compression=zipfile.ZIP_DEFLATED) as
user_filenames = list() user_filenames = list()
if len(sys.argv) > 1: if len(sys.argv) > 1:
# Search for user template, using fileid # Search for user template, using fileid
# In this case, we must use the config.xml to retrieve the latest content. # In this case, we must use the config.xml to retrieve the latest content.
# When using the generated config, the user experience will be a bit odd (old content after upload) # When using the generated config, the user experience will be a bit odd (old content after upload)
cnf = OPNSenseConfig() cnf = OPNSenseConfig()
template_content = cnf.get_template(sys.argv[1]) template_content = cnf.get_template(sys.argv[1])
......
...@@ -71,8 +71,8 @@ function rrd_data_xml() { ...@@ -71,8 +71,8 @@ function rrd_data_xml() {
$basename = basename($rrd_file); $basename = basename($rrd_file);
$xml_file = preg_replace('/\.rrd$/', ".xml", $rrd_file); $xml_file = preg_replace('/\.rrd$/', ".xml", $rrd_file);
exec("$rrdtool dump '{$rrd_file}' '{$xml_file}'"); exec("$rrdtool dump '{$rrd_file}' '{$xml_file}'");
$xml_data = file_get_contents($xml_file); $xml_data = @file_get_contents($xml_file);
unlink($xml_file); @unlink($xml_file);
if ($xml_data !== false) { if ($xml_data !== false) {
$result .= "\t\t<rrddatafile>\n"; $result .= "\t\t<rrddatafile>\n";
$result .= "\t\t\t<filename>{$basename}</filename>\n"; $result .= "\t\t\t<filename>{$basename}</filename>\n";
......
...@@ -744,7 +744,7 @@ include("head.inc"); ...@@ -744,7 +744,7 @@ include("head.inc");
<?php <?php
endif; endif;
foreach (formInterfaces() as $iface => $ifacename): ?> foreach (formInterfaces() as $iface => $ifacename): ?>
<option value="<?=$iface;?>" <?= !empty($pconfig['interface']) && ($iface == $pconfig['interface'] || in_array($iface, explode(",", $pconfig['interface']))) ? "selected=\"selected\"" : ""; ?>> <option value="<?=$iface;?>" <?= !empty($pconfig['interface']) && ($iface == $pconfig['interface'] || (strpos($pconfig['interface'], ',') !== false && in_array($iface, explode(',', $pconfig['interface'])))) ? 'selected="selected"' : ''; ?>>
<?=htmlspecialchars($ifacename);?> <?=htmlspecialchars($ifacename);?>
</option> </option>
<?php <?php
......
...@@ -868,7 +868,7 @@ endif; ?> ...@@ -868,7 +868,7 @@ endif; ?>
<?php foreach ($p2_halgos as $algo => $algoname) : <?php foreach ($p2_halgos as $algo => $algoname) :
?> ?>
<input type="checkbox" name="hash-algorithm-option[]" value="<?=$algo; <input type="checkbox" name="hash-algorithm-option[]" value="<?=$algo;
?>" <?=in_array($algo, $pconfig['hash-algorithm-option']) ? "checked=\"checked\"" : "";?>/> ?>" <?= isset($pconfig['hash-algorithm-option']) && in_array($algo, $pconfig['hash-algorithm-option']) ? 'checked="checked"' : '';?>/>
<?=$algoname;?> <?=$algoname;?>
</br> </br>
<?php <?php
......
...@@ -156,7 +156,7 @@ endif; ?> ...@@ -156,7 +156,7 @@ endif; ?>
?> ?>
</td> </td>
</tr> </tr>
<?php if ($config['revision']) : <?php if (isset($config['revision']['time'])) :
?> ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("Last config change");?></td> <td width="25%" class="vncellt"><?=gettext("Last config change");?></td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment