X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fforms.php;h=0d5bfef30a0c564d93739a111a6dd85e5e22136d;hb=6b309ebc3277729c3b592a6428c8db1f5799f4ec;hp=4ddc32d9693e1a7c9490f1c1c603b5d36268ca3c;hpb=6424bf75975f81c440e5539ce6445ffa513c1129;p=squirrelmail.git diff --git a/functions/forms.php b/functions/forms.php index 4ddc32d9..0d5bfef3 100644 --- a/functions/forms.php +++ b/functions/forms.php @@ -8,8 +8,9 @@ * Functions to build HTML forms in a safe and consistent manner. * All name, value attributes are htmlentitied. * - * $Id$ + * @version $Id$ * @package squirrelmail + * @subpackage forms */ /** @@ -18,8 +19,8 @@ */ function addInputField($type, $name = null, $value = null, $attributes = '') { return '\n"; } @@ -85,16 +86,16 @@ function addSelect($name, $values, $default = null, $usekeys = false) if(count($values) == 1) { $k = key($values); $v = array_pop($values); return addHidden($name, ($usekeys ? $k:$v)). - htmlentities($v) . "\n"; + htmlspecialchars($v) . "\n"; } - $ret = '\n"; foreach ($values as $k => $v) { if(!$usekeys) $k = $v; $ret .= '\n"; + '>' . htmlspecialchars($v) ."\n"; } $ret .= "\n"; @@ -119,9 +120,9 @@ function addReset($value) { * Textarea form element. */ function addTextArea($name, $text = '', $cols = 40, $rows = 10, $attr = '') { - return '\n"; + $attr . '">'.htmlspecialchars($text) ."\n"; } /**