Changeset c39957c in github


Ignore:
Timestamp:
Aug 11, 2006 5:11:15 PM (7 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
8d1d034
Parents:
64009eb
Message:

More encoding issues; enhanced debugging functions

Location:
program
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • program/include/main.inc

    r4d4264c rc39957c  
    708708  $framed = $GLOBALS['_framed']; 
    709709  $command = sprintf("display_message('%s', '%s');", 
    710                      addslashes(rep_specialchars_output(rcube_label(array('name' => $message, 'vars' => $vars)))), 
     710                     rep_specialchars_output(rcube_label(array('name' => $message, 'vars' => $vars)), 'js'), 
    711711                     $type); 
    712712                      
     
    719719                                $JS_OBJECT_NAME, 
    720720                                $command)); 
    721    
    722   // console(rcube_label($message)); 
    723   } 
    724  
    725  
    726 function console($msg, $type=1) 
    727   { 
    728   if ($GLOBALS['REMOTE_REQUEST']) 
    729     print "// $msg\n"; 
    730   else 
    731     { 
    732     print $msg; 
    733     print "\n<hr>\n"; 
    734     } 
    735721  } 
    736722 
     
    10151001      $str = rcube_charset_convert($str, $GLOBALS['CHARSET'], $OUTPUT->get_charset()); 
    10161002       
    1017     return preg_replace(array("/\r\n/", '/"/', "/([^\\\])'/"), array('\n', '\"', "$1\'"), strtr($str, $js_rep_table)); 
     1003    return addslashes(preg_replace(array("/\r\n/", "/\r/"), array('\n', '\n'), strtr($str, $js_rep_table))); 
    10181004    } 
    10191005 
     
    17931779 
    17941780 
    1795 /****** debugging function ********/ 
     1781/****** debugging functions ********/ 
     1782 
     1783 
     1784/** 
     1785 * Print or write debug messages 
     1786 * 
     1787 * @param mixed Debug message or data 
     1788 */ 
     1789function console($msg) 
     1790  { 
     1791  if (is_string($msg)) 
     1792    $msg = var_export($msg, true); 
     1793 
     1794  if (!($GLOBALS['CONFIG']['debug_level'] & 4)) 
     1795    write_log('console', $msg); 
     1796  else if ($GLOBALS['REMOTE_REQUEST']) 
     1797    print "/*\n $msg \n*/\n"; 
     1798  else 
     1799    { 
     1800    print '<div style="background:#eee; border:1px solid #ccc; margin-bottom:3px; padding:6px"><pre>'; 
     1801    print $msg; 
     1802    print "</pre></div>\n"; 
     1803    } 
     1804  } 
     1805 
     1806 
     1807/** 
     1808 * Append a line to a logfile in the logs directory. 
     1809 * Date will be added automatically to the line. 
     1810 * 
     1811 * @param $name Name of logfile 
     1812 * @param $line Line to append 
     1813 */ 
     1814function write_log($name, $line) 
     1815  { 
     1816  global $CONFIG; 
     1817   
     1818  $log_entry = sprintf("[%s]: %s\n", 
     1819                 date("d-M-Y H:i:s O", mktime()), 
     1820                 $line); 
     1821                  
     1822  if (empty($CONFIG['log_dir'])) 
     1823    $CONFIG['log_dir'] = $INSTALL_PATH.'logs'; 
     1824       
     1825  // try to open specific log file for writing 
     1826  if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a'))     
     1827    { 
     1828    fwrite($fp, $log_entry); 
     1829    fclose($fp); 
     1830    } 
     1831  } 
     1832 
    17961833 
    17971834function rcube_timer() 
  • program/steps/mail/func.inc

    r90022ee rc39957c  
    215215      $class_name = 'junk'; 
    216216 
     217    $js_name = rep_specialchars_output($folder['id'], 'js'); 
    217218    $out .= sprintf('<li id="rcmbx%s" class="mailbox %s %s%s%s"><a href="%s&amp;_mbox=%s"'. 
    218219                    ' onclick="return %s.command(\'list\',\'%s\')"'. 
     
    224225                    $zebra_class, 
    225226                    $unread_count ? ' unread' : '', 
    226                     addslashes($folder['id'])==addslashes($mbox_name) ? ' selected' : '', 
     227                    $folder['id']==$mbox_name ? ' selected' : '', 
    227228                    $COMM_PATH, 
    228229                    urlencode($folder['id']), 
    229230                    $JS_OBJECT_NAME, 
    230                     addslashes($folder['id']), 
     231                    $js_name, 
    231232                    $JS_OBJECT_NAME, 
    232                     addslashes($folder['id']), 
     233                    $js_name, 
    233234                    $JS_OBJECT_NAME, 
    234                     addslashes($folder['id']), 
     235                    $js_name, 
    235236                    $JS_OBJECT_NAME, 
    236                     addslashes($folder['id']), 
     237                    $js_name, 
    237238                    $title, 
    238239                    rep_specialchars_output($foldername, 'html', 'all')); 
  • program/steps/settings/manage_folders.inc

    r4d4264c rc39957c  
    7575    { 
    7676    $commands = sprintf("this.replace_folder_row('%s','%s','%s');", 
    77                         rep_specialchars_output($_GET['_folder_oldname'], 'js'), 
     77                        rep_specialchars_output(get_input_value('_folder_oldname', RCUBE_INPUT_GET), 'js'), 
    7878                        rep_specialchars_output($rename, 'js'), 
    7979                        rep_specialchars_output(rcube_charset_convert($rename, 'UTF-7'), 'js')); 
Note: See TracChangeset for help on using the changeset viewer.