| | |
| | | $table = new html_table(/*array('cols' => count($a_show_cols))*/); |
| | | |
| | | // add table header |
| | | foreach ($a_show_cols as $col) |
| | | $table->add_header($col, Q(rcube_label($col))); |
| | | if (!$attrib['noheader']) |
| | | foreach ($a_show_cols as $col) |
| | | $table->add_header($col, Q(rcube_label($col))); |
| | | |
| | | $c = 0; |
| | | if (!is_array($table_data)) |
| | |
| | | if (preg_match('/expression|behavior|url\(|import/', $stripped)) |
| | | return '/* evil! */'; |
| | | |
| | | // remove css comments (sometimes used for some ugly hacks) |
| | | $source = preg_replace('!/\*(.+)\*/!Ums', '', $source); |
| | | |
| | | // cut out all contents between { and } |
| | | while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos))) |
| | | { |
| | |
| | | $source = substr($source, 0, $pos+1) . $replacements->get_replacement($key) . substr($source, $pos2, strlen($source)-$pos2); |
| | | $last_pos = $pos+2; |
| | | } |
| | | |
| | | |
| | | // remove html comments and add #container to each tag selector. |
| | | // also replace body definition because we also stripped off the <body> tag |
| | | $styles = preg_replace( |
| | | array( |
| | | '/(^\s*<!--)|(-->\s*$)/', |
| | | '/(^\s*|,\s*|\}\s*)([a-z0-9\._#][a-z0-9\.\-_]*)/im', |
| | | '/(^\s*|,\s*|\}\s*)([a-z0-9\._#\*][a-z0-9\.\-_]*)/im', |
| | | "/$container_id\s+body/i", |
| | | ), |
| | | array( |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // for backward compatibility |
| | | function rcube_sess_unset($var_name=null) |
| | | { |
| | | global $RCMAIL; |
| | | |
| | | $RCMAIL->session->remove($var_name); |
| | | } |
| | | |
| | | |
| | | // Replaces hostname variables |
| | | function rcube_parse_host($name) |
| | | { |
| | | // %n - host |
| | | $n = preg_replace('/:\d+$/', '', $_SERVER['SERVER_NAME']); |
| | | // %d - domain name without first part, e.g. %d=mail.domain.tld, %m=domain.tld |
| | | $d = preg_replace('/^[^\.]+\./', '', $n); |
| | | // %h - IMAP host |
| | | $h = $_SESSION['imap_host']; |
| | | |
| | | $name = str_replace(array('%n', '%d', '%h'), array($n, $d, $h), $name); |
| | | return $name; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Throw system error and show error page |
| | | * |
| | |
| | | * @param boolean True to log the error |
| | | * @param boolean Terminate script execution |
| | | */ |
| | | // may be defined in Installer |
| | | if (!function_exists('raise_error')) { |
| | | function raise_error($arg=array(), $log=false, $terminate=false) |
| | | { |
| | | global $__page_content, $CONFIG, $OUTPUT, $ERROR_CODE, $ERROR_MESSAGE; |
| | |
| | | exit; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |