Changeset 2638 in subversion


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 "')
Location:
trunk/roundcubemail/program
Files:
2 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 
  • trunk/roundcubemail/program/js/app.js

    r2630 r2638  
    34973497        $(current_li).removeClass('selected').removeClass('unfocused'); 
    34983498      } 
    3499  
    35003499      if ((target_li = this.get_folder_li(name))) { 
    35013500        $(target_li).removeClass('unfocused').addClass('selected'); 
     
    35123511    if (this.gui_objects.folderlist) 
    35133512    { 
    3514       name = String(name).replace(this.identifier_expr, ''); 
     3513      name = String(name).replace(this.identifier_expr, '_'); 
    35153514      return document.getElementById('rcmli'+name); 
    35163515    } 
Note: See TracChangeset for help on using the changeset viewer.