Changeset 72b140d in github


Ignore:
Timestamp:
Feb 26, 2010 6:43:19 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
a72ad65
Parents:
ebc619c
Message:
  • Support arrays in get_input_value() (#1486277)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/main.inc

    r1e3271ed r72b140d  
    597597function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) 
    598598{ 
    599   global $OUTPUT; 
    600599  $value = NULL; 
    601600   
     
    614613    } 
    615614 
     615  return parse_input_value($value, $allow_html, $charset); 
     616} 
     617 
     618/** 
     619 * Parse/validate input value. See get_input_value() 
     620 * Performs stripslashes() and charset conversion if necessary 
     621 *  
     622 * @param  string   Input value 
     623 * @param  boolean  Allow HTML tags in field value 
     624 * @param  string   Charset to convert into 
     625 * @return string   Parsed value 
     626 */ 
     627function parse_input_value($value, $allow_html=FALSE, $charset=NULL) 
     628{ 
     629  global $OUTPUT; 
     630 
    616631  if (empty($value)) 
    617632    return $value; 
     633 
     634  if (is_array($value)) { 
     635    foreach ($value as $idx => $val) 
     636      $value[$idx] = parse_input_value($val, $allow_html, $charset); 
     637    return $value; 
     638  } 
    618639 
    619640  // strip single quotes if magic_quotes_sybase is enabled 
     
    629650   
    630651  // convert to internal charset 
    631   if (is_object($OUTPUT)) 
     652  if (is_object($OUTPUT) && $charset) 
    632653    return rcube_charset_convert($value, $OUTPUT->get_charset(), $charset); 
    633654  else 
Note: See TracChangeset for help on using the changeset viewer.