Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Cleanup printing ifAlias #4874

Merged
merged 3 commits into from Dec 12, 2016

Conversation

Projects
None yet
4 participants
@laf
Copy link
Member

commented Oct 24, 2016

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Fixes: #2666
Fixes: #2703

Not sure this is the best way to do this.

Updated display() function to use stripslashes twice. Reason for this is when ifAlias returns "something" we store \something\ (we strip " in snmp_walk() function. So we are then left with \something\ where as now we should just have something.

Other options to deal with this are:

  1. Update ports poller to strip out \ as well. We have the same issue anywhere else though.
  2. Strip out \ in snmp_walk response but does this have a negative impact anywhere else?

This option is the safest way but welcome to suggestions.

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Oct 24, 2016

Auto-Deploy finished, Test PR at http://4874.ci.librenms.org or https://4874.ci.librenms.org

@f0o
Copy link
Member

left a comment

Double stripslashes?

@laf

This comment has been minimized.

Copy link
Member Author

commented Oct 28, 2016

Yes, if you have a " in the description for cisco devices it comes back with " which then turns into \" so a single strip still ends up in "

@f0o

This comment has been minimized.

Copy link
Member

commented Oct 28, 2016

Wouldn't a preg_replace on '//+' be more efficient?

On 28 October 2016 08:18:00 CEST, Neil Lathwood notifications@github.com wrote:

Yes, if you have a " in the description for cisco devices it comes back
with " which then turns into \" so a single strip still ends up in
"

You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#4874 (comment)

@laf

This comment has been minimized.

Copy link
Member Author

commented Oct 28, 2016

Possibly

@laf

This comment has been minimized.

Copy link
Member Author

commented Nov 1, 2016

bump

@f0o
Copy link
Member

left a comment

I think a preg_replace approach is more suiting rather than multiple stripslashes

@laf

This comment has been minimized.

Copy link
Member Author

commented Nov 1, 2016

You'd still need to run stripslashes as well as doing a preg_replace so I'm not sure I see the savings with doing that.

@laf

This comment has been minimized.

Copy link
Member Author

commented Nov 13, 2016

bump

1 similar comment
@laf

This comment has been minimized.

Copy link
Member Author

commented Nov 20, 2016

bump

@laf

This comment has been minimized.

Copy link
Member Author

commented Nov 23, 2016

Rebased

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Nov 23, 2016

Auto-Deploy finished, Test PR at http://4874.ci.librenms.org or https://4874.ci.librenms.org

@laf

This comment has been minimized.

Copy link
Member Author

commented Dec 4, 2016

rebased, display() function was updated in another PR so this should no longer be a concern with double stripslashes().

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Dec 4, 2016

Auto-Deploy finished, Test PR at http://4874.ci.librenms.org or https://4874.ci.librenms.org

@scrutinizer-notifier

This comment has been minimized.

Copy link

commented Dec 4, 2016

The inspection completed: 4 new issues

@laf laf merged commit 9b9c10e into librenms:master Dec 12, 2016

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@laf laf deleted the laf:issue-2666 branch Dec 12, 2016

VimCommando added a commit to VimCommando/librenms that referenced this pull request Jan 4, 2017

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.