Ignore:
Timestamp:
Jun 11, 2009 11:15:28 AM (4 years ago)
Author:
alec
Message:
  • fix folder ID generation (for example two folders 'aaa' and 'aaa "')
File:
1 edited

Legend:

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

    r2626 r2638  
    591591/** 
    592592 * Remove all non-ascii and non-word chars 
    593  * except . and - 
    594  */ 
    595 function asciiwords($str, $css_id = false) 
     593 * except ., -, _ 
     594 */ 
     595function asciiwords($str, $css_id = false, $replace_with = '') 
    596596{ 
    597597  $allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : ''); 
    598   return preg_replace("/[^$allowed]/i", '', $str); 
     598  return preg_replace("/[^$allowed]/i", $replace_with, $str); 
    599599} 
    600600 
     
    12021202 
    12031203    // make folder name safe for ids and class names 
    1204     $folder_id = asciiwords($folder['id'], true); 
     1204    $folder_id = asciiwords($folder['id'], true, '_'); 
    12051205    $classes = array('mailbox'); 
    12061206 
Note: See TracChangeset for help on using the changeset viewer.