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: Undefined variable in search.pl #6877

Merged
merged 2 commits into from
Jun 10, 2022
Merged

fix: Undefined variable in search.pl #6877

merged 2 commits into from
Jun 10, 2022

Conversation

dipietroR
Copy link
Contributor

Potential fix for #6845

@dipietroR dipietroR requested a review from a team as a code owner June 9, 2022 02:15
cgi/search.pl Outdated
@@ -654,11 +654,21 @@

my $share = lang('share');


my $map = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but you can do it in one line instead of 4 like this:

my $map = param("generate_map") || '';

If the first expression is true (it is defined and the value is not false), then it return the first expression, otherwise it returns the right expression.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants