Ignore:
Timestamp:
Mar 21, 2007 5:56:49 AM (6 years ago)
Author:
thomasb
Message:

Minor bugfixes posted to the dev-mailing list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/main.inc

    r510 r515  
    581581              (created, last_login, username, mail_host, alias, language) 
    582582              VALUES (".$DB->now().", ".$DB->now().", ?, ?, ?, ?)", 
    583               $user, 
    584               $host, 
    585               $user_email, 
    586                       $_SESSION['user_lang']); 
     583              strip_newlines($user), 
     584              strip_newlines($host), 
     585              strip_newlines($user_email), 
     586              $_SESSION['user_lang']); 
    587587 
    588588  if ($user_id = $DB->insert_id(get_sequence_name('users'))) 
     
    596596 
    597597    // try to resolve the e-mail address from the virtuser table 
    598         if (!empty($CONFIG['virtuser_query']) && 
     598    if (!empty($CONFIG['virtuser_query']) && 
    599599        ($sql_result = $DB->query(preg_replace('/%u/', $user, $CONFIG['virtuser_query']))) && 
    600600        ($DB->num_rows()>0)) 
     
    605605                   VALUES (?, 0, 1, ?, ?)", 
    606606                   $user_id, 
    607                    $user_name, 
     607                   strip_newlines($user_name), 
    608608                   preg_replace('/^@/', $user . '@', $sql_arr[0])); 
    609609        } 
     
    615615                  VALUES (?, 0, 1, ?, ?)", 
    616616                  $user_id, 
    617                   $user_name, 
    618                   $user_email); 
     617                  strip_newlines($user_name), 
     618                  strip_newlines($user_email)); 
    619619      } 
    620620                        
     
    11391139{ 
    11401140  return preg_replace('/[\'"]/', '', $str); 
     1141} 
     1142 
     1143/** 
     1144 * Remove new lines characters from given string 
     1145 */ 
     1146function strip_newlines($str) 
     1147{ 
     1148  return preg_replace('/[\r\n]/', '', $str); 
    11411149} 
    11421150 
Note: See TracChangeset for help on using the changeset viewer.