summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-03-01 19:56:26 +0545
committerPhil Davis <phil.davis@inf.org>2016-03-01 19:56:26 +0545
commitb8f62ec244fc712531fc72b4c8fb4a42d34fba61 (patch)
tree8073e2f1a5564dca9acaedf3fdc0570496a553b9
parentdb653fc6f1fea2a4807320d9bd50f362490ab2d5 (diff)
downloadpfsense-b8f62ec244fc712531fc72b4c8fb4a42d34fba61.zip
pfsense-b8f62ec244fc712531fc72b4c8fb4a42d34fba61.tar.gz
print_callout class setting
The last test here looks not good having just a single equals sign - if the interpreter evaluates this then $class will always get set to 'info'. In practice it should work OK, because the evaluation of boolean conditions left to right should stop when any of the other tests to the left evaluates false. So $class will only be set to 'info' if it is not already 'default' 'danger' or 'warning'. Actually the code could be: a) Obfuscated version with empty if block content: if ($class != 'default' && $class != 'danger' && $class != 'warning' && $class = 'info') { // Noop - the if test above has already set $class to 'info' as required. } or b) Clearer version without bothering with any test for $class != 'info' : if ($class != 'default' && $class != 'danger' && $class != 'warning') { $class = 'info'; }
-rw-r--r--src/usr/local/www/guiconfig.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc
index b33d977..2ddee11 100644
--- a/src/usr/local/www/guiconfig.inc
+++ b/src/usr/local/www/guiconfig.inc
@@ -359,7 +359,7 @@ function print_callout($msg, $class = 'info', $heading = '') {
$class = strtolower($class);
$callout = '';
- if ($class != 'default' && $class != 'danger' && $class != 'warning' && $class = 'info') {
+ if ($class != 'default' && $class != 'danger' && $class != 'warning' && $class != 'info') {
$class = 'info';
}
$callout .= '<div class="bs-callout bs-callout-' . $class . '">';
OpenPOWER on IntegriCloud