alecpl
2009-06-15 3a2b270c9d1f531c2e2d1c422a4756afd639ef47
program/include/main.inc
@@ -590,12 +590,12 @@
/**
 * Remove all non-ascii and non-word chars
 * except . and -
 * except ., -, _
 */
function asciiwords($str, $css_id = false)
function asciiwords($str, $css_id = false, $replace_with = '')
{
  $allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : '');
  return preg_replace("/[^$allowed]/i", '', $str);
  return preg_replace("/[^$allowed]/i", $replace_with, $str);
}
/**
@@ -1023,17 +1023,16 @@
 * @access private
 */
function rcube_timer()
  {
  list($usec, $sec) = explode(" ", microtime());
  return ((float)$usec + (float)$sec);
  }
{
  return microtime(true);
}
  
/**
 * @access private
 */
function rcube_print_time($timer, $label='Timer')
  {
{
  static $print_count = 0;
  
  $print_count++;
@@ -1044,7 +1043,7 @@
    $label = 'Timer '.$print_count;
  
  console(sprintf("%s: %0.4f sec", $label, $diff));
  }
}
/**
@@ -1202,7 +1201,7 @@
    }
    // make folder name safe for ids and class names
    $folder_id = asciiwords($folder['id'], true);
    $folder_id = asciiwords($folder['id'], true, '_');
    $classes = array('mailbox');
    // set special class for Sent, Drafts, Trash and Junk