alecpl
2009-07-23 c9e9fe1901631af76be85176434096de1df7f018
program/include/rcube_shared.inc
@@ -170,7 +170,7 @@
      foreach ($var as $key => $value)
      {
        // enclose key with quotes if it is not variable-name conform
        if (!ereg("^[_a-zA-Z]{1}[_a-zA-Z0-9]*$", $key) || is_js_reserved_word($key))
        if (!preg_match('/^[_a-zA-Z]{1}[_a-zA-Z0-9]*$/', $key) || is_js_reserved_word($key))
          $key = "'$key'";
        $pairs[] = sprintf("%s%s", $is_assoc ? "$key:" : '', json_serialize($value));
@@ -238,12 +238,12 @@
 * Parse a human readable string for a number of bytes
 *
 * @param string Input string
 * @return int Number of bytes
 * @return float Number of bytes
 */
function parse_bytes($str)
{
  if (is_numeric($str))
    return intval($str);
    return floatval($str);
    
  if (preg_match('/([0-9]+)([a-z])/i', $str, $regs))
  {
@@ -262,7 +262,7 @@
    }
  }
  return intval($bytes);
  return floatval($bytes);
}
    
/**
@@ -425,7 +425,7 @@
      if ($newlen <= $width) {
        $string .= ($len ? ' ' : '').$line;
        $len += ($len ? 1 : 0) + $l;
        $len += (1 + $l);
      } else {
   if ($l > $width) {
     if ($cut) {