diff options
author | NOYB <Al_Stu@Frontier.com> | 2016-01-22 00:02:57 -0800 |
---|---|---|
committer | NOYB <Al_Stu@Frontier.com> | 2016-01-22 00:02:57 -0800 |
commit | cba2816e689553fa9c6dd408408accb34d370b79 (patch) | |
tree | 8b53ca9afa924f633b3879be1e4cc189e5d49f7d /src/usr/local/www/classes/Form | |
parent | c40fbe6d09c15c367fd900ff20e88b4dedb6bd4e (diff) | |
download | pfsense-cba2816e689553fa9c6dd408408accb34d370b79.zip pfsense-cba2816e689553fa9c6dd408408accb34d370b79.tar.gz |
Form Group - Empty Title GetText
Don't call gettext with an empty title.
There are undoubtedly other places that a check should be done before passing a variable only to a gettext call.
Fixes use case of form group class without a title from passing empty var to gettext.
Gettext returns header info. when an empty string/var is passed.
Perhaps a function should be created for this for consistency.
http://php.net/manual/en/function.gettext.php#108594
For groups without a title gettext returns header info.
To reproduce the issue select a non English language and open any of the following:
Services Load Balancer - edit
Diagnostics - Backup/Restore
Diagnostics - Status SMART
Status - System Logs - log filter and manage log panels
(not a comprehensive list)
Diffstat (limited to 'src/usr/local/www/classes/Form')
-rw-r--r-- | src/usr/local/www/classes/Form/Group.class.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/usr/local/www/classes/Form/Group.class.php b/src/usr/local/www/classes/Form/Group.class.php index e1ddaac..d2563a9 100644 --- a/src/usr/local/www/classes/Form/Group.class.php +++ b/src/usr/local/www/classes/Form/Group.class.php @@ -148,7 +148,8 @@ EOT; $label = new Form_Element('label', false, ['for' => $target]); $label->addClass('col-sm-'.Form::LABEL_WIDTH, 'control-label'); - $title = htmlspecialchars(gettext($this->_title)); + if (!empty(trim($this->_title)) || is_numeric($this->_title)) + $title = htmlspecialchars(gettext($this->_title)); return <<<EOT {$element} |