die("Couldn't find options for \"$name\". Be sure to call pulldown().");
}
- if(!in_array($str, array_keys($GLOBALS[$name . '_options']['options']))) {
- return '';
+ foreach($GLOBALS[$name . '_options']['options'] as $keyval) {
+ list($key, $value) = $keyval;
+ if($str == $key) {
+ return $str;
+ }
}
return $str;
function format_int($str) {
$str = ereg_replace('[^0-9]', '', $str);
- return ereg_replace('^0*([1-9])', '\1', $str);
+ return ereg_replace('^0*([0-9])', '\1', $str);
}
function format_decimal($str) {
function format_email($str) {
# FIXME
- return format_oneline($str);
+ return trim(format_oneline($str));
}
function format_url($str) {