Allow HTML in option info
[squirrelmail.git] / functions / options.php
index bda017815a69ef46807a6561e3ae1fd4669ece67..fa18ccee7281059376c5bd6bdf4598d5c5a16919 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Functions needed to display the options pages.
  *
- * @copyright 1999-2015 The SquirrelMail Project Team
+ * @copyright 1999-2017 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -68,6 +68,7 @@ class SquirrelOption {
      * useful for indicating units, meanings of special values, etc.
      * @var string
      */
+//TODO: add trailing_text_small as has been done with 1.4.x
     var $trailing_text;
     /**
      * Text that overrides the "Yes" label for boolean 
@@ -182,7 +183,7 @@ class SquirrelOption {
     var $folder_filter='noselect';
 
     /**
-     * Constructor function
+     * Constructor (PHP5 style, required in some future version of PHP)
      * @param array $raw_option_array
      * @param string $name
      * @param string $caption
@@ -192,7 +193,7 @@ class SquirrelOption {
      * @param array $possible_values
      * @param bool $htmlencoded
      */
-    function SquirrelOption
+    function __construct
     ($raw_option_array, $name, $caption, $type, $refresh_level, $initial_value = '', $possible_values = '', $htmlencoded = false) {
         /* Set the basic stuff. */
         $this->raw_option_array = $raw_option_array;
@@ -239,6 +240,22 @@ class SquirrelOption {
         }
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * @param array $raw_option_array
+     * @param string $name
+     * @param string $caption
+     * @param integer $type
+     * @param integer $refresh_level
+     * @param mixed $initial_value
+     * @param array $possible_values
+     * @param bool $htmlencoded
+     */
+    function SquirrelOption
+    ($raw_option_array, $name, $caption, $type, $refresh_level, $initial_value = '', $possible_values = '', $htmlencoded = false) {
+        self::__construct($raw_option_array, $name, $caption, $type, $refresh_level, $initial_value, $possible_values, $htmlencoded);
+    }
+
     /** Convenience function that identifies which types of
         widgets are stored as (serialized) array values. */
     function is_multiple_valued() {
@@ -469,7 +486,9 @@ class SquirrelOption {
      * @return string html formated output
      */
     function createWidget_Info() {
-        return sq_htmlspecialchars($this->value);
+        // return sq_htmlspecialchars($this->value);
+        // like COMMENT, allow HTML here
+        return $this->value;
     }
 
     /**