Fix NFSen tab not showing #3857

Merged
merged 2 commits into from Jul 26, 2016

Projects

None yet

4 participants

@jaroug
Contributor
jaroug commented Jul 20, 2016

Nfsen tab not appearing:

  • Wrong variable used
  • strstr won't return anything if nfsensuffix is empty
jaroug added some commits Jul 20, 2016
@jaroug jaroug fix: wrong variable used 87eb2a6
@jaroug jaroug fix: strstr won't return anything if nfsensuffix is empty
7817021
@jaroug
Contributor
jaroug commented Jul 20, 2016 edited

issue: #3856

@jaroug jaroug referenced this pull request Jul 20, 2016
Closed

netflow tab not appearing #3856

@murrant murrant commented on the diff Jul 22, 2016
html/includes/graphs/device/nfsen_common.inc.php
@@ -18,7 +18,7 @@
}
$basefilename_underscored = preg_replace('/\./', $config['nfsen_split_char'], $device['hostname']);
- $nfsen_filename = (strstr($basefilename_underscored, $nfsensuffix, true));
+ $nfsen_filename = preg_replace('/'.$nfsensuffix.'/', '', $basefilename_underscored);
@murrant
murrant Jul 22, 2016 edited Contributor

Looks like you could just use str_replace() here.

str_replace($nfsensuffix, '', $basefilename_underscored);
@murrant murrant commented on the diff Jul 22, 2016
html/includes/graphs/device/nfsen_common.inc.php
@@ -7,7 +7,7 @@
}
foreach ($config['nfsen_rrds'] as $nfsenrrds) {
- if ($configs[(strlen($nfsenrrds) - 1)] != '/') {
+ if ($nfsenrrds[(strlen($nfsenrrds) - 1)] != '/') {
@murrant
murrant Jul 22, 2016 Contributor

I would prefer something more obvious, like using substr()

 if (substr($nfsenrrds, -1) != '/') {
@laf laf changed the title from Issue 3856 to Fix NFSen tab not showing Jul 23, 2016
@laf laf added Bug WebUI labels Jul 26, 2016
@laf laf merged commit 047c5f5 into librenms:master Jul 26, 2016

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment