Changeset 5822 in subversion
- Timestamp:
- Jan 25, 2012 2:19:14 PM (16 months ago)
- Location:
- branches/devel-framework/roundcubemail
- Files:
-
- 27 edited
-
index.php (modified) (10 diffs)
-
program/include/html.php (modified) (3 diffs)
-
program/include/main.inc (modified) (1 diff)
-
program/include/rcmail.php (modified) (21 diffs)
-
program/include/rcube_addressbook.php (modified) (1 diff)
-
program/include/rcube_cache.php (modified) (6 diffs)
-
program/include/rcube_config.php (modified) (2 diffs)
-
program/include/rcube_contacts.php (modified) (19 diffs)
-
program/include/rcube_html_page.php (modified) (2 diffs)
-
program/include/rcube_imap.php (modified) (7 diffs)
-
program/include/rcube_imap_cache.php (modified) (18 diffs)
-
program/include/rcube_json_output.php (modified) (9 diffs)
-
program/include/rcube_ldap.php (modified) (2 diffs)
-
program/include/rcube_mdb2.php (modified) (2 diffs)
-
program/include/rcube_message.php (modified) (4 diffs)
-
program/include/rcube_mime.php (modified) (6 diffs)
-
program/include/rcube_session.php (modified) (7 diffs)
-
program/include/rcube_shared.inc (modified) (1 diff)
-
program/include/rcube_smtp.php (modified) (2 diffs)
-
program/include/rcube_spellchecker.php (modified) (4 diffs)
-
program/include/rcube_sqlite.inc (modified) (1 diff)
-
program/include/rcube_storage.php (modified) (1 diff)
-
program/include/rcube_string_replacer.php (modified) (2 diffs)
-
program/include/rcube_template.php (modified) (23 diffs)
-
program/include/rcube_ui.php (modified) (15 diffs)
-
program/include/rcube_user.php (modified) (15 diffs)
-
program/include/rcube_vcard.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-framework/roundcubemail/index.php
r5759 r5822 35 35 36 36 // Make the whole PHP output non-cacheable (#1487797) 37 send_nocacheing_headers();37 rcube_ui::send_nocacheing_headers(); 38 38 39 39 // turn on output buffering … … 57 57 58 58 // error steps 59 if ($RCMAIL->action =='error' && !empty($_GET['_code'])) {59 if ($RCMAIL->action == 'error' && !empty($_GET['_code'])) { 60 60 raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE); 61 61 } … … 64 64 if (empty($_SESSION['user_id']) && ($force_https = $RCMAIL->config->get('force_https', false))) { 65 65 $https_port = is_bool($force_https) ? 443 : $force_https; 66 if (!rcube_ https_check($https_port)) {66 if (!rcube__ui::https_check($https_port)) { 67 67 $host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']); 68 68 $host .= ($https_port != 443 ? ':' . $https_port : ''); … … 79 79 // try to log in 80 80 if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') { 81 $request_valid = $_SESSION['temp'] && $RCMAIL->check_request( RCUBE_INPUT_POST, 'login');81 $request_valid = $_SESSION['temp'] && $RCMAIL->check_request(rcube_ui::INPUT_POST, 'login'); 82 82 83 83 // purge the session in case of new login when a session already exists … … 86 86 $auth = $RCMAIL->plugins->exec_hook('authenticate', array( 87 87 'host' => $RCMAIL->autoselect_host(), 88 'user' => trim( get_input_value('_user', RCUBE_INPUT_POST)),89 'pass' => get_input_value('_pass', RCUBE_INPUT_POST, true,88 'user' => trim(rcube_ui::get_input_value('_user', rcube_ui::INPUT_POST)), 89 'pass' => rcube_ui::get_input_value('_pass', rcube_ui::INPUT_POST, true, 90 90 $RCMAIL->config->get('password_charset', 'ISO-8859-1')), 91 91 'cookiecheck' => true, … … 109 109 110 110 // log successful login 111 rcmail_log_login();111 $RCMAIL->log_login(); 112 112 113 113 // restore original request parameters 114 114 $query = array(); 115 if ($url = get_input_value('_url', RCUBE_INPUT_POST)) {115 if ($url = rcube_ui::get_input_value('_url', rcube_ui::INPUT_POST)) { 116 116 parse_str($url, $query); 117 117 … … 139 139 140 140 // end session (after optional referer check) 141 else if ($RCMAIL->task == 'logout' && isset($_SESSION['user_id']) && (!$RCMAIL->config->get('referer_check') || rc ube_check_referer())) {141 else if ($RCMAIL->task == 'logout' && isset($_SESSION['user_id']) && (!$RCMAIL->config->get('referer_check') || rcmail::check_referer())) { 142 142 $userdata = array( 143 143 'user' => $_SESSION['username'], … … 162 162 if (empty($RCMAIL->user->ID)) { 163 163 // log session failures 164 if (($task = get_input_value('_task', RCUBE_INPUT_GPC)) && !in_array($task, array('login','logout')) && !$session_error && ($sess_id = $_COOKIE[ini_get('session.name')])) { 164 $task = rcube_ui::get_input_value('_task', rcube_ui::INPUT_GPC); 165 if ($task && !in_array($task, array('login','logout')) && !$session_error && ($sess_id = $_COOKIE[ini_get('session.name')])) { 165 166 $RCMAIL->session->log("Aborted session " . $sess_id . "; no valid session data found"); 166 167 $session_error = true; … … 198 199 // check client X-header to verify request origin 199 200 if ($OUTPUT->ajax_call) { 200 if (rc _request_header('X-Roundcube-Request') != $RCMAIL->get_request_token() && !$RCMAIL->config->get('devel_mode')) {201 if (rcube_request_header('X-Roundcube-Request') != $RCMAIL->get_request_token() && !$RCMAIL->config->get('devel_mode')) { 201 202 header('HTTP/1.1 403 Forbidden'); 202 203 die("Invalid Request"); … … 210 211 211 212 // check referer if configured 212 if (!$request_check_whitelist[$RCMAIL->action] && $RCMAIL->config->get('referer_check') && !rc ube_check_referer()) {213 if (!$request_check_whitelist[$RCMAIL->action] && $RCMAIL->config->get('referer_check') && !rcmail::check_referer()) { 213 214 raise_error(array( 214 215 'code' => 403, -
branches/devel-framework/roundcubemail/program/include/html.php
r5807 r5822 296 296 } 297 297 else if ($key=='value') { 298 $attrib_arr[] = $key . '="' . Q($value, 'strict', false) . '"';298 $attrib_arr[] = $key . '="' . rcube_ui::Q($value, 'strict', false) . '"'; 299 299 } 300 300 else { 301 $attrib_arr[] = $key . '="' . Q($value) . '"';301 $attrib_arr[] = $key . '="' . rcube_ui::Q($value) . '"'; 302 302 } 303 303 } … … 541 541 542 542 if (!empty($value) && !preg_match('/mce_editor/', $this->attrib['class'])) { 543 $value = Q($value, 'strict', false);543 $value = rcube_ui::Q($value, 'strict', false); 544 544 } 545 545 … … 615 615 in_array($option['text'], $select, true)) ? 1 : null); 616 616 617 $this->content .= self::tag('option', $attr, Q($option['text']));617 $this->content .= self::tag('option', $attr, rcube_ui::Q($option['text'])); 618 618 } 619 619 return parent::show(); -
branches/devel-framework/roundcubemail/program/include/main.inc
r5807 r5822 334 334 function rc_wordwrap($string, $width=75, $break="\n", $cut=false) 335 335 { 336 return rcube_ wordwrap($string, $width, $break, $cut);336 return rcube_mime::wordwrap($string, $width, $break, $cut); 337 337 } 338 338 -
branches/devel-framework/roundcubemail/program/include/rcmail.php
r5807 r5822 183 183 184 184 // set task and action properties 185 $this->set_task( get_input_value('_task', RCUBE_INPUT_GPC));186 $this->action = asciiwords( get_input_value('_action', RCUBE_INPUT_GPC));185 $this->set_task(rcube_ui::get_input_value('_task', rcube_ui::INPUT_GPC)); 186 $this->action = asciiwords(rcube_ui::get_input_value('_action', rcube_ui::INPUT_GPC)); 187 187 188 188 // reset some session parameters when changing task … … 336 336 $this->memcache = new Memcache; 337 337 $this->mc_available = 0; 338 338 339 339 // add alll configured hosts to pool 340 340 $pconnect = $this->config->get('memcache_pconnect', true); … … 344 344 $this->mc_available += intval($this->memcache->addServer($host, $port, $pconnect, 1, 1, 15, false, array($this, 'memcache_failure'))); 345 345 } 346 346 347 347 // test connection and failover (will result in $this->mc_available == 0 on complete failure) 348 348 $this->memcache->increment('__CONNECTIONTEST__', 1); // NOP if key doesn't exist … … 354 354 return $this->memcache; 355 355 } 356 356 357 357 358 /** 358 359 * Callback for memcache failure … … 361 362 { 362 363 static $seen = array(); 363 364 364 365 // only report once 365 366 if (!$seen["$host:$port"]++) { … … 477 478 $list['0'] = array( 478 479 'id' => '0', 479 'name' => rcube_label('personaladrbook'),480 'name' => $this->gettext('personaladrbook'), 480 481 'groups' => $this->address_books['0']->groups, 481 482 'readonly' => $this->address_books['0']->readonly, … … 747 748 } 748 749 749 ini_set('session.cookie_secure', rcube_ https_check());750 ini_set('session.cookie_secure', rcube_ui::https_check()); 750 751 ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid'); 751 752 ini_set('session.use_cookies', 1); … … 829 830 return false; 830 831 } 831 else if (!empty($config['default_host']) && $host != rcube_parse_host($config['default_host']))832 else if (!empty($config['default_host']) && $host != self::parse_host($config['default_host'])) 832 833 return false; 833 834 … … 853 854 if (!empty($config['username_domain']) && strpos($username, '@') === false) { 854 855 if (is_array($config['username_domain']) && isset($config['username_domain'][$host])) 855 $username .= '@'. rcube_parse_host($config['username_domain'][$host], $host);856 $username .= '@'.self::parse_host($config['username_domain'][$host], $host); 856 857 else if (is_string($config['username_domain'])) 857 $username .= '@'. rcube_parse_host($config['username_domain'], $host);858 $username .= '@'.self::parse_host($config['username_domain'], $host); 858 859 } 859 860 … … 1003 1004 1004 1005 if (is_array($default_host)) { 1005 $post_host = get_input_value('_host', RCUBE_INPUT_POST);1006 $post_host = rcube_ui::get_input_value('_host', rcube_ui::INPUT_POST); 1006 1007 1007 1008 // direct match in default_host array … … 1011 1012 1012 1013 // try to select host by mail domain 1013 list($user, $domain) = explode('@', get_input_value('_user', RCUBE_INPUT_POST));1014 list($user, $domain) = explode('@', rcube_ui::get_input_value('_user', rcube_ui::INPUT_POST)); 1014 1015 if (!empty($domain)) { 1015 1016 foreach ($default_host as $storage_host => $mail_domains) { … … 1027 1028 } 1028 1029 else if (empty($default_host)) { 1029 $host = get_input_value('_host', RCUBE_INPUT_POST);1030 $host = rcube_ui::get_input_value('_host', rcube_ui::INPUT_POST); 1030 1031 } 1031 1032 else 1032 $host = rcube_parse_host($default_host);1033 $host = self::parse_host($default_host); 1033 1034 1034 1035 return $host; … … 1274 1275 if ($this->config->get('devel_mode')) { 1275 1276 if (function_exists('memory_get_usage')) 1276 $mem = show_bytes(memory_get_usage());1277 $mem = rcube_ui::show_bytes(memory_get_usage()); 1277 1278 if (function_exists('memory_get_peak_usage')) 1278 $mem .= '/'. show_bytes(memory_get_peak_usage());1279 $mem .= '/'.rcube_ui::show_bytes(memory_get_peak_usage()); 1279 1280 1280 1281 $log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : ''); 1281 1282 if (defined('RCMAIL_START')) 1282 rcube_print_time(RCMAIL_START, $log);1283 self::print_timer(RCMAIL_START, $log); 1283 1284 else 1284 console($log);1285 self::console($log); 1285 1286 } 1286 1287 } … … 1320 1321 * @return boolean True if request token is valid false if not 1321 1322 */ 1322 public function check_request($mode = RCUBE_INPUT_POST)1323 { 1324 $token = get_input_value('_token', $mode);1323 public function check_request($mode = rcube_ui::INPUT_POST) 1324 { 1325 $token = rcube_ui::get_input_value('_token', $mode); 1325 1326 $sess_id = $_COOKIE[ini_get('session.name')]; 1326 1327 return !empty($sess_id) && $token == $this->get_request_token(); … … 1623 1624 1624 1625 setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], 1625 rcube_ https_check(), true);1626 rcube_ui::https_check(), true); 1626 1627 } 1627 1628 … … 1896 1897 1897 1898 if ($this->config->get('smtp_log')) { 1898 write_log('sendmail', sprintf("User %s [%s]; Message for %s; %s",1899 self::write_log('sendmail', sprintf("User %s [%s]; Message for %s; %s", 1899 1900 $this->user->get_username(), 1900 1901 $_SERVER['REMOTE_ADDR'], … … 1979 1980 // %s - domain name after the '@' from e-mail address provided at login screen. Returns FALSE if an invalid email is provided 1980 1981 if (strpos($name, '%s') !== false) { 1981 $user_email = rcube_idn_convert(get_input_value('_user', RCUBE_INPUT_POST), true); 1982 $user_email = rcube_ui::get_input_value('_user', rcube_ui::INPUT_POST); 1983 $user_email = rcube_idn_convert($user_email, true); 1982 1984 $matches = preg_match('/(.*)@([a-z0-9\.\-\[\]\:]+)/i', $user_email, $s); 1983 1985 if ($matches < 1 || filter_var($s[1]."@".$s[2], FILTER_VALIDATE_EMAIL) === false) { … … 2104 2106 } 2105 2107 2106 write_log('console', join(";\n", $msg));2108 self::write_log('console', join(";\n", $msg)); 2107 2109 } 2108 2110 … … 2181 2183 } 2182 2184 2183 $this->write_log('userlogins',2185 self::write_log('userlogins', 2184 2186 sprintf('Successful login for %s (ID: %d) from %s in session %s', 2185 2187 $this->user->get_username(), 2186 $this->user->ID, $this->remote_ip(), session_id()));2188 $this->user->ID, self::remote_ip(), session_id())); 2187 2189 } 2188 2190 … … 2252 2254 2253 2255 $print_count++; 2254 $now = rcube_timer();2255 $diff = $now -$timer;2256 $now = self::timer(); 2257 $diff = $now - $timer; 2256 2258 2257 2259 if (empty($label)) { … … 2299 2301 $ts = get_offset_time($this->config->get('message_cache_lifetime', '30d'), -1); 2300 2302 2301 $db->query("DELETE FROM " .get_table_name('cache_messages')2303 $db->query("DELETE FROM " . $db->table_name('cache_messages') 2302 2304 ." WHERE changed < " . $db->fromunixtime($ts)); 2303 2305 2304 $db->query("DELETE FROM " .get_table_name('cache_index')2306 $db->query("DELETE FROM " . $db->table_name('cache_index') 2305 2307 ." WHERE changed < " . $db->fromunixtime($ts)); 2306 2308 2307 $db->query("DELETE FROM " .get_table_name('cache_thread')2309 $db->query("DELETE FROM " . $db->table_name('cache_thread') 2308 2310 ." WHERE changed < " . $db->fromunixtime($ts)); 2309 2311 2310 $db->query("DELETE FROM " .get_table_name('cache')2312 $db->query("DELETE FROM " . $db->table_name('cache') 2311 2313 ." WHERE created < " . $db->fromunixtime($ts)); 2312 2314 } -
branches/devel-framework/roundcubemail/program/include/rcube_addressbook.php
r5411 r5822 192 192 public function validate(&$save_data, $autofix = false) 193 193 { 194 $rcmail = rcmail::get_instance(); 195 194 196 // check validity of email addresses 195 197 foreach ($this->get_col_values('email', $save_data, true) as $email) { 196 198 if (strlen($email)) { 197 if (!check_email(rcube_idn_to_ascii($email))) { 198 $this->set_error(self::ERROR_VALIDATE, rcube_label(array('name' => 'emailformaterror', 'vars' => array('email' => $email)))); 199 if (!$rcmail->check_email(rcube_idn_to_ascii($email))) { 200 $error = $rcmail->gettext(array('name' => 'emailformaterror', 'vars' => array('email' => $email))); 201 $this->set_error(self::ERROR_VALIDATE, $error); 199 202 return false; 200 203 } -
branches/devel-framework/roundcubemail/program/include/rcube_cache.php
r5305 r5822 195 195 if ($this->type == 'db' && $this->db) { 196 196 $this->db->query( 197 "DELETE FROM ". get_table_name('cache').197 "DELETE FROM ".$this->db->table_name('cache'). 198 198 " WHERE user_id = ?". 199 199 " AND cache_key LIKE ?". … … 272 272 $sql_result = $this->db->limitquery( 273 273 "SELECT cache_id, data, cache_key". 274 " FROM ". get_table_name('cache').274 " FROM ".$this->db->table_name('cache'). 275 275 " WHERE user_id = ?". 276 276 " AND cache_key = ?". … … 328 328 if ($data == 'N;') { 329 329 $this->db->query( 330 "DELETE FROM ". get_table_name('cache').330 "DELETE FROM ".$this->db->table_name('cache'). 331 331 " WHERE user_id = ?". 332 332 " AND cache_key = ?", … … 339 339 if ($key_exists) { 340 340 $result = $this->db->query( 341 "UPDATE ". get_table_name('cache').341 "UPDATE ".$this->db->table_name('cache'). 342 342 " SET created = ". $this->db->now().", data = ?". 343 343 " WHERE user_id = ?". … … 350 350 // so, no need to check if record exist (see rcube_cache::read_record()) 351 351 $result = $this->db->query( 352 "INSERT INTO ". get_table_name('cache').352 "INSERT INTO ".$this->db->table_name('cache'). 353 353 " (created, user_id, cache_key, data)". 354 354 " VALUES (".$this->db->now().", ?, ?, ?)", … … 414 414 415 415 $this->db->query( 416 "DELETE FROM ". get_table_name('cache').416 "DELETE FROM ".$this->db->table_name('cache'). 417 417 " WHERE user_id = ?" . $where, 418 418 $this->userid); -
branches/devel-framework/roundcubemail/program/include/rcube_config.php
r5758 r5822 71 71 // fix default imap folders encoding 72 72 foreach (array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox') as $folder) 73 $this->prop[$folder] = rcube_charset _convert($this->prop[$folder], RCMAIL_CHARSET, 'UTF7-IMAP');73 $this->prop[$folder] = rcube_charset::convert($this->prop[$folder], RCMAIL_CHARSET, 'UTF7-IMAP'); 74 74 75 75 if (!empty($this->prop['default_folders'])) 76 76 foreach ($this->prop['default_folders'] as $n => $folder) 77 $this->prop['default_folders'][$n] = rcube_charset _convert($folder, RCMAIL_CHARSET, 'UTF7-IMAP');77 $this->prop['default_folders'][$n] = rcube_charset::convert($folder, RCMAIL_CHARSET, 'UTF7-IMAP'); 78 78 79 79 // set PHP error logging according to config … … 347 347 } 348 348 else if (!empty($this->prop['mail_domain'])) 349 $domain = rc ube_parse_host($this->prop['mail_domain']);349 $domain = rcmail::parse_host($this->prop['mail_domain']); 350 350 351 351 if ($encode) -
branches/devel-framework/roundcubemail/program/include/rcube_contacts.php
r5708 r5822 150 150 151 151 $sql_result = $this->db->query( 152 "SELECT * FROM ". get_table_name($this->db_groups).152 "SELECT * FROM ".$this->db->table_name($this->db_groups). 153 153 " WHERE del<>1". 154 154 " AND user_id=?". … … 175 175 { 176 176 $sql_result = $this->db->query( 177 "SELECT * FROM ". get_table_name($this->db_groups).177 "SELECT * FROM ".$this->db->table_name($this->db_groups). 178 178 " WHERE del<>1". 179 179 " AND contactgroup_id=?". … … 211 211 212 212 if ($this->group_id) 213 $join = " LEFT JOIN ". get_table_name($this->db_groupmembers)." AS m".213 $join = " LEFT JOIN ".$this->db->table_name($this->db_groupmembers)." AS m". 214 214 " ON (m.contact_id = c.".$this->primary_key.")"; 215 215 216 216 $sql_result = $this->db->limitquery( 217 "SELECT * FROM ". get_table_name($this->db_name)." AS c" .217 "SELECT * FROM ".$this->db->table_name($this->db_name)." AS c" . 218 218 $join . 219 219 " WHERE c.del<>1" . … … 481 481 { 482 482 if ($this->group_id) 483 $join = " LEFT JOIN ". get_table_name($this->db_groupmembers)." AS m".483 $join = " LEFT JOIN ".$this->db->table_name($this->db_groupmembers)." AS m". 484 484 " ON (m.contact_id=c.".$this->primary_key.")"; 485 485 … … 487 487 $sql_result = $this->db->query( 488 488 "SELECT COUNT(c.contact_id) AS rows". 489 " FROM ". get_table_name($this->db_name)." AS c".489 " FROM ".$this->db->table_name($this->db_name)." AS c". 490 490 $join. 491 491 " WHERE c.del<>1". … … 529 529 530 530 $this->db->query( 531 "SELECT * FROM ". get_table_name($this->db_name).531 "SELECT * FROM ".$this->db->table_name($this->db_name). 532 532 " WHERE contact_id=?". 533 533 " AND user_id=?". … … 561 561 562 562 $sql_result = $this->db->query( 563 "SELECT cgm.contactgroup_id, cg.name FROM " . get_table_name($this->db_groupmembers) . " AS cgm" .564 " LEFT JOIN " . get_table_name($this->db_groups) . " AS cg ON (cgm.contactgroup_id = cg.contactgroup_id AND cg.del<>1)" .563 "SELECT cgm.contactgroup_id, cg.name FROM " . $this->db->table_name($this->db_groupmembers) . " AS cgm" . 564 " LEFT JOIN " . $this->db->table_name($this->db_groups) . " AS cg ON (cgm.contactgroup_id = cg.contactgroup_id AND cg.del<>1)" . 565 565 " WHERE cgm.contact_id=?", 566 566 $id … … 631 631 if (!$existing->count && !empty($a_insert_cols)) { 632 632 $this->db->query( 633 "INSERT INTO ". get_table_name($this->db_name).633 "INSERT INTO ".$this->db->table_name($this->db_name). 634 634 " (user_id, changed, del, ".join(', ', $a_insert_cols).")". 635 635 " VALUES (".intval($this->user_id).", ".$this->db->now().", 0, ".join(', ', $a_insert_values).")" … … 669 669 if (!empty($write_sql)) { 670 670 $this->db->query( 671 "UPDATE ". get_table_name($this->db_name).671 "UPDATE ".$this->db->table_name($this->db_name). 672 672 " SET changed=".$this->db->now().", ".join(', ', $write_sql). 673 673 " WHERE contact_id=?". … … 765 765 // flag record as deleted (always) 766 766 $this->db->query( 767 "UPDATE ". get_table_name($this->db_name).767 "UPDATE ".$this->db->table_name($this->db_name). 768 768 " SET del=1, changed=".$this->db->now(). 769 769 " WHERE user_id=?". … … 792 792 // clear deleted flag 793 793 $this->db->query( 794 "UPDATE ". get_table_name($this->db_name).794 "UPDATE ".$this->db->table_name($this->db_name). 795 795 " SET del=0, changed=".$this->db->now(). 796 796 " WHERE user_id=?". … … 812 812 $this->cache = null; 813 813 814 $this->db->query("UPDATE ". get_table_name($this->db_name).814 $this->db->query("UPDATE ".$this->db->table_name($this->db_name). 815 815 " SET del=1, changed=".$this->db->now(). 816 816 " WHERE user_id = ?", $this->user_id); … … 834 834 835 835 $this->db->query( 836 "INSERT INTO ". get_table_name($this->db_groups).836 "INSERT INTO ".$this->db->table_name($this->db_groups). 837 837 " (user_id, changed, name)". 838 838 " VALUES (".intval($this->user_id).", ".$this->db->now().", ".$this->db->quote($name).")" … … 856 856 // flag group record as deleted 857 857 $sql_result = $this->db->query( 858 "UPDATE ". get_table_name($this->db_groups).858 "UPDATE ".$this->db->table_name($this->db_groups). 859 859 " SET del=1, changed=".$this->db->now(). 860 860 " WHERE contactgroup_id=?". … … 882 882 883 883 $sql_result = $this->db->query( 884 "UPDATE ". get_table_name($this->db_groups).884 "UPDATE ".$this->db->table_name($this->db_groups). 885 885 " SET name=?, changed=".$this->db->now(). 886 886 " WHERE contactgroup_id=?". … … 910 910 // get existing assignments ... 911 911 $sql_result = $this->db->query( 912 "SELECT contact_id FROM ". get_table_name($this->db_groupmembers).912 "SELECT contact_id FROM ".$this->db->table_name($this->db_groupmembers). 913 913 " WHERE contactgroup_id=?". 914 914 " AND contact_id IN (".$this->db->array2list($ids, 'integer').")", … … 923 923 foreach ($ids as $contact_id) { 924 924 $this->db->query( 925 "INSERT INTO ". get_table_name($this->db_groupmembers).925 "INSERT INTO ".$this->db->table_name($this->db_groupmembers). 926 926 " (contactgroup_id, contact_id, created)". 927 927 " VALUES (?, ?, ".$this->db->now().")", … … 953 953 954 954 $sql_result = $this->db->query( 955 "DELETE FROM ". get_table_name($this->db_groupmembers).955 "DELETE FROM ".$this->db->table_name($this->db_groupmembers). 956 956 " WHERE contactgroup_id=?". 957 957 " AND contact_id IN ($ids)", … … 976 976 do { 977 977 $sql_result = $this->db->query( 978 "SELECT 1 FROM ". get_table_name($this->db_groups).978 "SELECT 1 FROM ".$this->db->table_name($this->db_groups). 979 979 " WHERE del<>1". 980 980 " AND user_id=?". -
branches/devel-framework/roundcubemail/program/include/rcube_html_page.php
r5658 r5822 181 181 182 182 // replace specialchars in content 183 $page_title = Q($this->title, 'show', FALSE);183 $page_title = rcube_ui::Q($this->title, 'show', FALSE); 184 184 $page_header = ''; 185 185 $page_footer = ''; … … 288 288 if (!$hook['abort']) { 289 289 if ($this->charset != RCMAIL_CHARSET) { 290 echo rcube_charset _convert($hook['content'], RCMAIL_CHARSET, $this->charset);290 echo rcube_charset::convert($hook['content'], RCMAIL_CHARSET, $this->charset); 291 291 } 292 292 else { -
branches/devel-framework/roundcubemail/program/include/rcube_imap.php
r5779 r5822 183 183 if ($pass && $user) { 184 184 $message = sprintf("Login failed for %s from %s. %s", 185 $user, rcmail _remote_ip(), $this->conn->error);185 $user, rcmail::rcmail_remote_ip(), $this->conn->error); 186 186 187 187 raise_error(array('code' => 403, 'type' => 'imap', … … 1452 1452 $string_offset = $m[1] + strlen($m[0]) + 4; // {}\r\n 1453 1453 $string = substr($str, $string_offset - 1, $m[0]); 1454 $string = rcube_charset _convert($string, $charset, $dest_charset);1454 $string = rcube_charset::convert($string, $charset, $dest_charset); 1455 1455 if ($string === false) { 1456 1456 continue; … … 1944 1944 } 1945 1945 else { 1946 $charset = rc _detect_encoding($filename_mime, $this->default_charset);1946 $charset = rcube_charset::detect($filename_mime, $this->default_charset); 1947 1947 } 1948 1948 … … 1956 1956 } 1957 1957 1958 $part->filename = rcube_charset _convert(urldecode($filename_encoded), $filename_charset);1958 $part->filename = rcube_charset::convert(urldecode($filename_encoded), $filename_charset); 1959 1959 } 1960 1960 } … … 2035 2035 } 2036 2036 } 2037 $body = rcube_charset _convert($body, $o_part->charset);2037 $body = rcube_charset::convert($body, $o_part->charset); 2038 2038 } 2039 2039 } … … 3670 3670 } 3671 3671 else { 3672 $folders[$folder] = rcube_charset _convert($folder, 'UTF7-IMAP');3672 $folders[$folder] = rcube_charset::convert($folder, 'UTF7-IMAP'); 3673 3673 } 3674 3674 } … … 3830 3830 public function debug_handler(&$imap, $message) 3831 3831 { 3832 write_log('imap', $message);3832 rcmail::write_log('imap', $message); 3833 3833 } 3834 3834 -
branches/devel-framework/roundcubemail/program/include/rcube_imap_cache.php
r5766 r5822 299 299 $sql_result = $this->db->query( 300 300 "SELECT uid, data, flags" 301 ." FROM ". get_table_name('cache_messages')301 ." FROM ".$this->db->table_name('cache_messages') 302 302 ." WHERE user_id = ?" 303 303 ." AND mailbox = ?" … … 359 359 $sql_result = $this->db->query( 360 360 "SELECT flags, data" 361 ." FROM ". get_table_name('cache_messages')361 ." FROM ".$this->db->table_name('cache_messages') 362 362 ." WHERE user_id = ?" 363 363 ." AND mailbox = ?" … … 427 427 if (!$force) { 428 428 $res = $this->db->query( 429 "UPDATE ". get_table_name('cache_messages')429 "UPDATE ".$this->db->table_name('cache_messages') 430 430 ." SET flags = ?, data = ?, changed = ".$this->db->now() 431 431 ." WHERE user_id = ?" … … 441 441 // insert new record 442 442 $this->db->query( 443 "INSERT INTO ". get_table_name('cache_messages')443 "INSERT INTO ".$this->db->table_name('cache_messages') 444 444 ." (user_id, mailbox, uid, flags, changed, data)" 445 445 ." VALUES (?, ?, ?, ?, ".$this->db->now().", ?)", … … 476 476 477 477 $this->db->query( 478 "UPDATE ". get_table_name('cache_messages')478 "UPDATE ".$this->db->table_name('cache_messages') 479 479 ." SET changed = ".$this->db->now() 480 480 .", flags = flags ".($enabled ? "+ $idx" : "- $idx") … … 497 497 if (!strlen($mailbox)) { 498 498 $this->db->query( 499 "DELETE FROM ". get_table_name('cache_messages')499 "DELETE FROM ".$this->db->table_name('cache_messages') 500 500 ." WHERE user_id = ?", 501 501 $this->userid); … … 510 510 511 511 $this->db->query( 512 "DELETE FROM ". get_table_name('cache_messages')512 "DELETE FROM ".$this->db->table_name('cache_messages') 513 513 ." WHERE user_id = ?" 514 514 ." AND mailbox = ".$this->db->quote($mailbox) … … 533 533 if ($remove) { 534 534 $this->db->query( 535 "DELETE FROM ". get_table_name('cache_index')535 "DELETE FROM ".$this->db->table_name('cache_index') 536 536 ." WHERE user_id = ".intval($this->userid) 537 537 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : "") … … 540 540 else { 541 541 $this->db->query( 542 "UPDATE ". get_table_name('cache_index')542 "UPDATE ".$this->db->table_name('cache_index') 543 543 ." SET valid = 0" 544 544 ." WHERE user_id = ".intval($this->userid) … … 566 566 { 567 567 $this->db->query( 568 "DELETE FROM ". get_table_name('cache_thread')568 "DELETE FROM ".$this->db->table_name('cache_thread') 569 569 ." WHERE user_id = ".intval($this->userid) 570 570 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : "") … … 604 604 $sql_result = $this->db->query( 605 605 "SELECT data, valid" 606 ." FROM ". get_table_name('cache_index')606 ." FROM ".$this->db->table_name('cache_index') 607 607 ." WHERE user_id = ?" 608 608 ." AND mailbox = ?", … … 641 641 $sql_result = $this->db->query( 642 642 "SELECT data" 643 ." FROM ". get_table_name('cache_thread')643 ." FROM ".$this->db->table_name('cache_thread') 644 644 ." WHERE user_id = ?" 645 645 ." AND mailbox = ?", … … 685 685 if ($exists) { 686 686 $sql_result = $this->db->query( 687 "UPDATE ". get_table_name('cache_index')687 "UPDATE ".$this->db->table_name('cache_index') 688 688 ." SET data = ?, valid = 1, changed = ".$this->db->now() 689 689 ." WHERE user_id = ?" … … 693 693 else { 694 694 $sql_result = $this->db->query( 695 "INSERT INTO ". get_table_name('cache_index')695 "INSERT INTO ".$this->db->table_name('cache_index') 696 696 ." (user_id, mailbox, data, valid, changed)" 697 697 ." VALUES (?, ?, ?, 1, ".$this->db->now().")", … … 716 716 if ($exists) { 717 717 $sql_result = $this->db->query( 718 "UPDATE ". get_table_name('cache_thread')718 "UPDATE ".$this->db->table_name('cache_thread') 719 719 ." SET data = ?, changed = ".$this->db->now() 720 720 ." WHERE user_id = ?" … … 724 724 else { 725 725 $sql_result = $this->db->query( 726 "INSERT INTO ". get_table_name('cache_thread')726 "INSERT INTO ".$this->db->table_name('cache_thread') 727 727 ." (user_id, mailbox, data, changed)" 728 728 ." VALUES (?, ?, ?, ".$this->db->now().")", … … 932 932 $sql_result = $this->db->query( 933 933 "SELECT uid" 934 ." FROM ". get_table_name('cache_messages')934 ." FROM ".$this->db->table_name('cache_messages') 935 935 ." WHERE user_id = ?" 936 936 ." AND mailbox = ?", … … 979 979 980 980 $this->db->query( 981 "UPDATE ". get_table_name('cache_messages')981 "UPDATE ".$this->db->table_name('cache_messages') 982 982 ." SET flags = ?, changed = ".$this->db->now() 983 983 ." WHERE user_id = ?" -
branches/devel-framework/roundcubemail/program/include/rcube_json_output.php
r5227 r5822 35 35 */ 36 36 private $config; 37 38 /** 39 * Browser object 40 * 41 * @var rcube_browser 42 */ 43 public $browser; 44 45 /** 46 * Framework object 47 * 48 * @var rcmail 49 */ 50 private $app; 51 37 52 private $charset = RCMAIL_CHARSET; 38 53 private $texts = array(); … … 41 56 private $message = null; 42 57 43 public $browser;44 58 public $env = array(); 45 59 public $type = 'js'; … … 50 64 * Constructor 51 65 */ 52 public function __construct($task=null) 53 { 54 $this->config = rcmail::get_instance()->config; 66 public function __construct($task = null) 67 { 68 $this->app = rcmail::get_instance(); 69 $this->config = $this->app->config; 55 70 $this->browser = new rcube_browser(); 56 71 } … … 157 172 158 173 foreach ($args as $name) { 159 $this->texts[$name] = rcube_label($name);174 $this->texts[$name] = $this->app->gettext($name); 160 175 } 161 176 } … … 175 190 { 176 191 if ($override || !$this->message) { 177 if ( rcube_label_exists($message)) {192 if ($this->app->text_exists($message)) { 178 193 if (!empty($vars)) 179 194 $vars = array_map('Q', $vars); 180 $msgtext = rcube_label(array('name' => $message, 'vars' => $vars));195 $msgtext = $this->app->gettext(array('name' => $message, 'vars' => $vars)); 181 196 } 182 197 else … … 239 254 if (!$s_header_sent) { 240 255 $s_header_sent = true; 241 send_nocacheing_headers();256 rcube_ui::send_nocacheing_headers(); 242 257 header('Content-Type: text/plain; charset=' . $this->get_charset()); 243 258 } … … 249 264 $response['action'] = $rcmail->action; 250 265 251 if ($unlock = get_input_value('_unlock', RCUBE_INPUT_GPC)) {266 if ($unlock = rcube_ui::get_input_value('_unlock', rcube_ui::INPUT_GPC)) { 252 267 $response['unlock'] = $unlock; 253 268 } … … 265 280 $response['callbacks'] = $this->callbacks; 266 281 267 echo json_serialize($response);282 echo rcube_ui::json_serialize($response); 268 283 } 269 284 … … 281 296 $method = array_shift($args); 282 297 foreach ($args as $i => $arg) { 283 $args[$i] = json_serialize($arg);298 $args[$i] = rcube_ui::json_serialize($arg); 284 299 } 285 300 -
branches/devel-framework/roundcubemail/program/include/rcube_ldap.php
r5704 r5822 174 174 foreach ($this->prop['hosts'] as $host) 175 175 { 176 $host = idn_to_ascii(rc ube_parse_host($host));176 $host = idn_to_ascii(rcmail::parse_host($host)); 177 177 $hostname = $host.($this->prop['port'] ? ':'.$this->prop['port'] : ''); 178 178 … … 1409 1409 private function _debug($str) 1410 1410 { 1411 if ($this->debug) 1412 write_log('ldap', $str); 1411 if ($this->debug) { 1412 rcmail::write_log('ldap', $str); 1413 } 1413 1414 } 1414 1415 -
branches/devel-framework/roundcubemail/program/include/rcube_mdb2.php
r5807 r5822 359 359 if ($this->db_provider == 'pgsql') 360 360 // find sequence name 361 $table = get_sequence_name($table);361 $table = $this->sequence_name($table); 362 362 else 363 363 // resolve table name 364 $table = get_table_name($table);364 $table = $this->table_name($table); 365 365 } 366 366 … … 801 801 $debug_output = sprintf('%s(%d): %s;', 802 802 $scope, $db->db_index, rtrim($message, ';')); 803 write_log('sql', $debug_output);803 rcmail::write_log('sql', $debug_output); 804 804 } 805 805 } -
branches/devel-framework/roundcubemail/program/include/rcube_message.php
r5758 r5822 94 94 'safe' => $this->is_safe, 95 95 'prefer_html' => $this->app->config->get('prefer_html'), 96 'get_url' => rc mail_url('get', array(96 'get_url' => rcube_ui::url('get', array( 97 97 '_mbox' => $this->storage->get_folder(), '_uid' => $uid)) 98 98 ); … … 360 360 $c->ctype_primary = 'text'; 361 361 $c->ctype_secondary = 'plain'; 362 $c->body = rcube_label('htmlmessage');362 $c->body = $this->app->gettext('htmlmessage'); 363 363 364 364 $this->parts[] = $c; … … 368 368 if ($html_part !== null && $structure->parts[$html_part] !== $print_part) { 369 369 $html_part = &$structure->parts[$html_part]; 370 $html_part->filename = rcube_label('htmlmessage');370 $html_part->filename = $this->app->gettext('htmlmessage'); 371 371 $html_part->mimetype = 'text/html'; 372 372 … … 380 380 $p->ctype_primary = 'text'; 381 381 $p->ctype_secondary = 'plain'; 382 $p->body = rcube_label('encryptedmessage');382 $p->body = $this->app->gettext('encryptedmessage'); 383 383 $p->size = strlen($p->body); 384 384 -
branches/devel-framework/roundcubemail/program/include/rcube_mime.php
r5716 r5822 151 151 if ($start != $pos) { 152 152 $substr = substr($input, $start, $pos-$start); 153 $out .= rcube_charset _convert($substr, $default_charset);153 $out .= rcube_charset::convert($substr, $default_charset); 154 154 $start = $pos; 155 155 } … … 192 192 } 193 193 194 $out .= rcube_charset _convert($text, $charset);194 $out .= rcube_charset::convert($text, $charset); 195 195 $tmp = array(); 196 196 } … … 198 198 // add the last part of the input string 199 199 if ($start != strlen($input)) { 200 $out .= rcube_charset _convert(substr($input, $start), $default_charset);200 $out .= rcube_charset::convert(substr($input, $start), $default_charset); 201 201 } 202 202 … … 206 206 207 207 // no encoding information, use fallback 208 return rcube_charset _convert($input, $default_charset);208 return rcube_charset::convert($input, $default_charset); 209 209 } 210 210 … … 467 467 $level = strlen($prefix); 468 468 $line = rtrim(substr($line, $level)); 469 $line = $prefix . rc_wordwrap($line, $length - $level - 2, " \r\n$prefix ");469 $line = $prefix . self::wordwrap($line, $length - $level - 2, " \r\n$prefix "); 470 470 } 471 471 else if ($line) { 472 $line = rc_wordwrap(rtrim($line), $length - 2, " \r\n");472 $line = self::wordwrap(rtrim($line), $length - 2, " \r\n"); 473 473 // space-stuffing 474 474 $line = preg_replace('/(^|\r\n)(From| |>)/', '\\1 \\2', $line); … … 482 482 } 483 483 484 485 /** 486 * Improved wordwrap function. 487 * 488 * @param string $string Text to wrap 489 * @param int $width Line width 490 * @param string $break Line separator 491 * @param bool $cut Enable to cut word 492 * 493 * @return string Text 494 */ 495 public static function wordwrap($string, $width=75, $break="\n", $cut=false) 496 { 497 $para = explode($break, $string); 498 $string = ''; 499 500 while (count($para)) { 501 $line = array_shift($para); 502 if ($line[0] == '>') { 503 $string .= $line.$break; 504 continue; 505 } 506 507 $list = explode(' ', $line); 508 $len = 0; 509 while (count($list)) { 510 $line = array_shift($list); 511 $l = mb_strlen($line); 512 $newlen = $len + $l + ($len ? 1 : 0); 513 514 if ($newlen <= $width) { 515 $string .= ($len ? ' ' : '').$line; 516 $len += (1 + $l); 517 } 518 else { 519 if ($l > $width) { 520 if ($cut) { 521 $start = 0; 522 while ($l) { 523 $str = mb_substr($line, $start, $width); 524 $strlen = mb_strlen($str); 525 $string .= ($len ? $break : '').$str; 526 $start += $strlen; 527 $l -= $strlen; 528 $len = $strlen; 529 } 530 } 531 else { 532 $string .= ($len ? $break : '').$line; 533 if (count($list)) { 534 $string .= $break; 535 } 536 $len = 0; 537 } 538 } 539 else { 540 $string .= $break.$line; 541 $len = $l; 542 } 543 } 544 } 545 546 if (count($para)) { 547 $string .= $break; 548 } 549 } 550 551 return $string; 552 } 553 484 554 } -
branches/devel-framework/roundcubemail/program/include/rcube_session.php
r5807 r5822 127 127 { 128 128 $sql_result = $this->db->query( 129 "SELECT vars, ip, changed FROM ". get_table_name('session')129 "SELECT vars, ip, changed FROM ".$this->db->table_name('session') 130 130 ." WHERE sess_id = ?", $key); 131 131 … … 175 175 $this->db->query( 176 176 sprintf("UPDATE %s SET vars=?, changed=%s WHERE sess_id=?", 177 get_table_name('session'), $now),177 $this->db->table_name('session'), $now), 178 178 base64_encode($newvars), $key); 179 179 } 180 180 else if ($ts - $this->changed > $this->lifetime / 2) { 181 $this->db->query("UPDATE ". get_table_name('session')." SET changed=$now WHERE sess_id=?", $key);181 $this->db->query("UPDATE ".$this->db->table_name('session')." SET changed=$now WHERE sess_id=?", $key); 182 182 } 183 183 } … … 186 186 sprintf("INSERT INTO %s (sess_id, vars, ip, created, changed) ". 187 187 "VALUES (?, ?, ?, %s, %s)", 188 get_table_name('session'), $now, $now),188 $this->db->table_name('session'), $now, $now), 189 189 $key, base64_encode($vars), (string)$this->ip); 190 190 } … … 226 226 { 227 227 $this->db->query( 228 sprintf("DELETE FROM %s WHERE sess_id = ?", get_table_name('session')),228 sprintf("DELETE FROM %s WHERE sess_id = ?", $this->db->table_name('session')), 229 229 $key); 230 230 … … 244 244 $this->db->query( 245 245 sprintf("DELETE FROM %s WHERE changed < %s", 246 get_table_name('session'), $this->db->fromunixtime(time() - $maxlifetime)));246 $this->db->table_name('session'), $this->db->fromunixtime(time() - $maxlifetime))); 247 247 248 248 $this->gc(); … … 622 622 return "S" . (function_exists('sha1') ? sha1($auth_string) : md5($auth_string)); 623 623 } 624 624 625 625 /** 626 626 * … … 629 629 { 630 630 if ($this->logging) 631 write_log('session', $line);631 rcmail::write_log('session', $line); 632 632 } 633 633 -
branches/devel-framework/roundcubemail/program/include/rcube_shared.inc
r5821 r5822 96 96 97 97 return floatval($bytes); 98 }99 100 101 /**102 * Wrapper function for wordwrap103 *104 * @param string $string Text to wrap105 * @param int $width Line width106 * @param string $break Line separator107 * @param bool $cut Enable to cut word108 *109 * @return string Text110 */111 function rcube_wordwrap($string, $width=75, $break="\n", $cut=false)112 {113 $para = explode($break, $string);114 $string = '';115 while (count($para)) {116 $line = array_shift($para);117 if ($line[0] == '>') {118 $string .= $line.$break;119 continue;120 }121 122 $list = explode(' ', $line);123 $len = 0;124 while (count($list)) {125 $line = array_shift($list);126 $l = mb_strlen($line);127 $newlen = $len + $l + ($len ? 1 : 0);128 129 if ($newlen <= $width) {130 $string .= ($len ? ' ' : '').$line;131 $len += (1 + $l);132 }133 else {134 if ($l > $width) {135 if ($cut) {136 $start = 0;137 while ($l) {138 $str = mb_substr($line, $start, $width);139 $strlen = mb_strlen($str);140 $string .= ($len ? $break : '').$str;141 $start += $strlen;142 $l -= $strlen;143 $len = $strlen;144 }145 }146 else {147 $string .= ($len ? $break : '').$line;148 if (count($list)) {149 $string .= $break;150 }151 $len = 0;152 }153 }154 else {155 $string .= $break.$line;156 $len = $l;157 }158 }159 }160 161 if (count($para)) {162 $string .= $break;163 }164 }165 166 return $string;167 98 } 168 99 -
branches/devel-framework/roundcubemail/program/include/rcube_smtp.php
r5498 r5822 72 72 )); 73 73 74 $smtp_host = rc ube_parse_host($CONFIG['smtp_server']);74 $smtp_host = rcmail::parse_host($CONFIG['smtp_server']); 75 75 // when called from Installer it's possible to have empty $smtp_host here 76 76 if (!$smtp_host) $smtp_host = 'localhost'; … … 336 336 public function debug_handler(&$smtp, $message) 337 337 { 338 write_log('smtp', preg_replace('/\r\n$/', '', $message));338 rcmail::write_log('smtp', preg_replace('/\r\n$/', '', $message)); 339 339 } 340 340 -
branches/devel-framework/roundcubemail/program/include/rcube_spellchecker.php
r5181 r5822 546 546 if (!empty($this->dict)) { 547 547 $this->rc->db->query( 548 "UPDATE ". get_table_name('dictionary')548 "UPDATE ".$this->rc->db->table_name('dictionary') 549 549 ." SET data = ?" 550 550 ." WHERE user_id " . ($plugin['userid'] ? "= ".$plugin['userid'] : "IS NULL") … … 555 555 else { 556 556 $this->rc->db->query( 557 "DELETE FROM " . get_table_name('dictionary')557 "DELETE FROM " . $this->rc->db->table_name('dictionary') 558 558 ." WHERE user_id " . ($plugin['userid'] ? "= ".$plugin['userid'] : "IS NULL") 559 559 ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?", … … 563 563 else if (!empty($this->dict)) { 564 564 $this->rc->db->query( 565 "INSERT INTO " . get_table_name('dictionary')565 "INSERT INTO " .$this->rc->db->table_name('dictionary') 566 566 ." (user_id, " . $this->rc->db->quoteIdentifier('language') . ", data) VALUES (?, ?, ?)", 567 567 $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary'])); … … 589 589 $dict = array(); 590 590 $this->rc->db->query( 591 "SELECT data FROM ". get_table_name('dictionary')591 "SELECT data FROM ".$this->rc->db->table_name('dictionary') 592 592 ." WHERE user_id ". ($plugin['userid'] ? "= ".$plugin['userid'] : "IS NULL") 593 593 ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?", -
branches/devel-framework/roundcubemail/program/include/rcube_sqlite.inc
r4410 r5822 72 72 function rcube_sqlite_debug($str) 73 73 { 74 // console($str);74 //rcmail::console($str); 75 75 } 76 76 -
branches/devel-framework/roundcubemail/program/include/rcube_storage.php
r5759 r5822 467 467 { 468 468 $headers = $this->get_message_headers($uid); 469 return rcube_charset _convert($this->get_message_part($uid, $part, null),469 return rcube_charset::convert($this->get_message_part($uid, $part, null), 470 470 $headers->charset ? $headers->charset : $this->default_charset); 471 471 } -
branches/devel-framework/roundcubemail/program/include/rcube_string_replacer.php
r5461 r5822 96 96 'href' => $url_prefix . $url, 97 97 'target' => '_blank' 98 ), Q($url)) . $suffix);98 ), rcube_ui::Q($url)) . $suffix); 99 99 } 100 100 … … 116 116 $i = $this->add(html::a(array( 117 117 'href' => 'mailto:' . $href, 118 'onclick' => "return ".JS_OBJECT_NAME.".command('compose','". JQ($href)."',this)",119 ), Q($href)) . $suffix);118 'onclick' => "return ".JS_OBJECT_NAME.".command('compose','".rcube_ui::JQ($href)."',this)", 119 ), rcube_ui::Q($href)) . $suffix); 120 120 121 121 return $i >= 0 ? $this->get_replacement($i) : ''; -
branches/devel-framework/roundcubemail/program/include/rcube_template.php
r5768 r5822 133 133 } 134 134 else if ($this->env['task'] == 'login') { 135 $title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name'])));135 $title = $this->app->gettext(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name']))); 136 136 } 137 137 else { … … 236 236 237 237 foreach ($args as $name) { 238 $this->js_labels[$name] = rcube_label($name);238 $this->js_labels[$name] = $this->app->gettext($name); 239 239 } 240 240 } … … 253 253 { 254 254 if ($override || !$this->message) { 255 if ( rcube_label_exists($message)) {255 if ($this->app->text_exists($message)) { 256 256 if (!empty($vars)) 257 257 $vars = array_map('Q', $vars); 258 $msgtext = rcube_label(array('name' => $message, 'vars' => $vars));258 $msgtext = $this->app->gettext(array('name' => $message, 'vars' => $vars)); 259 259 } 260 260 else … … 479 479 $out = ''; 480 480 if (!$this->framed && !empty($this->js_env)) { 481 $out .= JS_OBJECT_NAME . '.set_env('. json_serialize($this->js_env).");\n";481 $out .= JS_OBJECT_NAME . '.set_env('.rcube_ui::json_serialize($this->js_env).");\n"; 482 482 } 483 483 if (!empty($this->js_labels)) { … … 487 487 $method = array_shift($args); 488 488 foreach ($args as $i => $arg) { 489 $args[$i] = json_serialize($arg);489 $args[$i] = rcube_ui::json_serialize($arg); 490 490 } 491 491 $parent = $this->framed || preg_match('/^parent\./', $method); … … 524 524 private function parse_with_globals($input) 525 525 { 526 $GLOBALS['__version'] = Q(RCMAIL_VERSION);527 $GLOBALS['__comm_path'] = Q($this->app->comm_path);526 $GLOBALS['__version'] = rcube_ui::Q(RCMAIL_VERSION); 527 $GLOBALS['__comm_path'] = rcube_ui::Q($this->app->comm_path); 528 528 return preg_replace_callback('/\$(__[a-z0-9_\-]+)/', 529 529 array($this, 'globals_callback'), $input); … … 564 564 return $matches[0] . $this->parse_conditions($matches[3]); 565 565 } 566 $attrib = parse_attrib_string($matches[2]);566 $attrib = html::parse_attrib_string($matches[2]); 567 567 if (isset($attrib['condition'])) { 568 568 $condmet = $this->check_condition($attrib['condition']); … … 608 608 private function alter_form_tag($matches) 609 609 { 610 $out = $matches[0];611 $attrib =parse_attrib_string($matches[1]);610 $out = $matches[0]; 611 $attrib = html::parse_attrib_string($matches[1]); 612 612 613 613 if (strtolower($attrib['method']) == 'post') { … … 642 642 "\$this->app->config->get('\\1',get_boolean('\\3'))", 643 643 "\$this->env['\\1']", 644 " get_input_value('\\1', RCUBE_INPUT_GPC)",644 "rcube_ui::get_input_value('\\1', rcube_ui::INPUT_GPC)", 645 645 "\$_COOKIE['\\1']", 646 646 "\$this->browser->{'\\1'}", … … 676 676 { 677 677 $command = strtolower($matches[1]); 678 $attrib = parse_attrib_string($matches[2]);678 $attrib = html::parse_attrib_string($matches[2]); 679 679 680 680 // empty output if required condition is not met … … 697 697 $vars = $attrib + array('product' => $this->config['product_name']); 698 698 unset($vars['name'], $vars['command']); 699 $label = rcube_label($attrib + array('vars' => $vars));700 return !$attrib['noshow'] ? (get_boolean((string)$attrib['html']) ? $label : Q($label)) : '';699 $label = $this->app->gettext($attrib + array('vars' => $vars)); 700 return !$attrib['noshow'] ? (get_boolean((string)$attrib['html']) ? $label : rcube_ui::Q($label)) : ''; 701 701 } 702 702 break; … … 760 760 else if ($object == 'productname') { 761 761 $name = !empty($this->config['product_name']) ? $this->config['product_name'] : 'Roundcube Webmail'; 762 $content = Q($name);762 $content = rcube_ui::Q($name); 763 763 } 764 764 else if ($object == 'version') { … … 768 768 $ver .= ' [SVN r'.$regs[1].']'; 769 769 } 770 $content = Q($ver);770 $content = rcube_ui::Q($ver); 771 771 } 772 772 else if ($object == 'steptitle') { 773 $content = Q($this->get_pagetitle());773 $content = rcube_ui::Q($this->get_pagetitle()); 774 774 } 775 775 else if ($object == 'pagetitle') { … … 781 781 $title = ''; 782 782 $title .= $this->get_pagetitle(); 783 $content = Q($title);783 $content = rcube_ui::Q($title); 784 784 } 785 785 … … 791 791 case 'exp': 792 792 $value = $this->parse_expression($attrib['expression']); 793 return eval("return Q($value);");793 return eval("return rcube_ui::Q($value);"); 794 794 795 795 // return variable … … 810 810 break; 811 811 case 'request': 812 $value = get_input_value($name, RCUBE_INPUT_GPC);812 $value = rcube_ui::get_input_value($name, rcube_ui::INPUT_GPC); 813 813 break; 814 814 case 'session': … … 827 827 } 828 828 829 return Q($value);829 return rcube_ui::Q($value); 830 830 break; 831 831 } … … 890 890 // get localized text for labels and titles 891 891 if ($attrib['title']) { 892 $attrib['title'] = Q(rcube_label($attrib['title'], $attrib['domain']));892 $attrib['title'] = rcube_ui::Q($this->app->gettext($attrib['title'], $attrib['domain'])); 893 893 } 894 894 if ($attrib['label']) { 895 $attrib['label'] = Q(rcube_label($attrib['label'], $attrib['domain']));895 $attrib['label'] = rcube_ui::Q($this->app->gettext($attrib['label'], $attrib['domain'])); 896 896 } 897 897 if ($attrib['alt']) { 898 $attrib['alt'] = Q(rcube_label($attrib['alt'], $attrib['domain']));898 $attrib['alt'] = rcube_ui::Q($this->app->gettext($attrib['alt'], $attrib['domain'])); 899 899 } 900 900 … … 924 924 // make valid href to specific buttons 925 925 if (in_array($attrib['command'], rcmail::$main_tasks)) { 926 $attrib['href'] = rc mail_url(null, null, $attrib['command']);926 $attrib['href'] = rcube_ui::url(null, null, $attrib['command']); 927 927 $attrib['onclick'] = sprintf("%s.switch_task('%s');return false", JS_OBJECT_NAME, $attrib['command']); 928 928 } 929 929 else if ($attrib['task'] && in_array($attrib['task'], rcmail::$main_tasks)) { 930 $attrib['href'] = rc mail_url($attrib['command'], null, $attrib['task']);930 $attrib['href'] = rcube_ui::url($attrib['command'], null, $attrib['task']); 931 931 } 932 932 else if (in_array($attrib['command'], $a_static_commands)) { 933 $attrib['href'] = rc mail_url($attrib['command']);933 $attrib['href'] = rcube_ui::url($attrib['command']); 934 934 } 935 935 else if ($attrib['command'] == 'permaurl' && !empty($this->env['permaurl'])) { … … 1105 1105 1106 1106 // save original url 1107 $url = get_input_value('_url', RCUBE_INPUT_POST);1107 $url = rcube_ui::get_input_value('_url', rcube_ui::INPUT_POST); 1108 1108 if (empty($url) && !preg_match('/_(task|action)=logout/', $_SERVER['QUERY_STRING'])) 1109 1109 $url = $_SERVER['QUERY_STRING']; … … 1154 1154 $table = new html_table(array('cols' => 2)); 1155 1155 1156 $table->add('title', html::label('rcmloginuser', Q(rcube_label('username'))));1157 $table->add('input', $input_user->show( get_input_value('_user', RCUBE_INPUT_GPC)));1158 1159 $table->add('title', html::label('rcmloginpwd', Q(rcube_label('password'))));1156 $table->add('title', html::label('rcmloginuser', rcube_ui::Q($this->app->gettext('username')))); 1157 $table->add('input', $input_user->show(rcube_ui::get_input_value('_user', rcube_ui::INPUT_GPC))); 1158 1159 $table->add('title', html::label('rcmloginpwd', rcube_ui::Q($this->app->gettext('password')))); 1160 1160 $table->add('input', $input_pass->show()); 1161 1161 1162 1162 // add host selection row 1163 1163 if (is_object($input_host) && !$hide_host) { 1164 $table->add('title', html::label('rcmloginhost', Q(rcube_label('server'))));1165 $table->add('input', $input_host->show( get_input_value('_host', RCUBE_INPUT_GPC)));1164 $table->add('title', html::label('rcmloginhost', rcube_ui::Q($this->app->gettext('server')))); 1165 $table->add('input', $input_host->show(rcube_ui::get_input_value('_host', rcube_ui::INPUT_GPC))); 1166 1166 } 1167 1167 … … 1201 1201 return; 1202 1202 1203 $this->add_script('var images = ' . json_serialize($images) .';1203 $this->add_script('var images = ' . rcube_ui::json_serialize($images) .'; 1204 1204 for (var i=0; i<images.length; i++) { 1205 1205 img = new Image(); … … 1282 1282 1283 1283 $charsets = array( 1284 'UTF-8' => 'UTF-8 ('. rcube_label('unicode').')',1285 'US-ASCII' => 'ASCII ('. rcube_label('english').')',1286 'ISO-8859-1' => 'ISO-8859-1 ('. rcube_label('westerneuropean').')',1287 'ISO-8859-2' => 'ISO-8859-2 ('. rcube_label('easterneuropean').')',1288 'ISO-8859-4' => 'ISO-8859-4 ('. rcube_label('baltic').')',1289 'ISO-8859-5' => 'ISO-8859-5 ('. rcube_label('cyrillic').')',1290 'ISO-8859-6' => 'ISO-8859-6 ('. rcube_label('arabic').')',1291 'ISO-8859-7' => 'ISO-8859-7 ('. rcube_label('greek').')',1292 'ISO-8859-8' => 'ISO-8859-8 ('. rcube_label('hebrew').')',1293 'ISO-8859-9' => 'ISO-8859-9 ('. rcube_label('turkish').')',1294 'ISO-8859-10' => 'ISO-8859-10 ('. rcube_label('nordic').')',1295 'ISO-8859-11' => 'ISO-8859-11 ('. rcube_label('thai').')',1296 'ISO-8859-13' => 'ISO-8859-13 ('. rcube_label('baltic').')',1297 'ISO-8859-14' => 'ISO-8859-14 ('. rcube_label('celtic').')',1298 'ISO-8859-15' => 'ISO-8859-15 ('. rcube_label('westerneuropean').')',1299 'ISO-8859-16' => 'ISO-8859-16 ('. rcube_label('southeasterneuropean').')',1300 'WINDOWS-1250' => 'Windows-1250 ('. rcube_label('easterneuropean').')',1301 'WINDOWS-1251' => 'Windows-1251 ('. rcube_label('cyrillic').')',1302 'WINDOWS-1252' => 'Windows-1252 ('. rcube_label('westerneuropean').')',1303 'WINDOWS-1253' => 'Windows-1253 ('. rcube_label('greek').')',1304 'WINDOWS-1254' => 'Windows-1254 ('. rcube_label('turkish').')',1305 'WINDOWS-1255' => 'Windows-1255 ('. rcube_label('hebrew').')',1306 'WINDOWS-1256' => 'Windows-1256 ('. rcube_label('arabic').')',1307 'WINDOWS-1257' => 'Windows-1257 ('. rcube_label('baltic').')',1308 'WINDOWS-1258' => 'Windows-1258 ('. rcube_label('vietnamese').')',1309 'ISO-2022-JP' => 'ISO-2022-JP ('. rcube_label('japanese').')',1310 'ISO-2022-KR' => 'ISO-2022-KR ('. rcube_label('korean').')',1311 'ISO-2022-CN' => 'ISO-2022-CN ('. rcube_label('chinese').')',1312 'EUC-JP' => 'EUC-JP ('. rcube_label('japanese').')',1313 'EUC-KR' => 'EUC-KR ('. rcube_label('korean').')',1314 'EUC-CN' => 'EUC-CN ('. rcube_label('chinese').')',1315 'BIG5' => 'BIG5 ('. rcube_label('chinese').')',1316 'GB2312' => 'GB2312 ('. rcube_label('chinese').')',1284 'UTF-8' => 'UTF-8 ('.$this->app->gettext('unicode').')', 1285 'US-ASCII' => 'ASCII ('.$this->app->gettext('english').')', 1286 'ISO-8859-1' => 'ISO-8859-1 ('.$this->app->gettext('westerneuropean').')', 1287 'ISO-8859-2' => 'ISO-8859-2 ('.$this->app->gettext('easterneuropean').')', 1288 'ISO-8859-4' => 'ISO-8859-4 ('.$this->app->gettext('baltic').')', 1289 'ISO-8859-5' => 'ISO-8859-5 ('.$this->app->gettext('cyrillic').')', 1290 'ISO-8859-6' => 'ISO-8859-6 ('.$this->app->gettext('arabic').')', 1291 'ISO-8859-7' => 'ISO-8859-7 ('.$this->app->gettext('greek').')', 1292 'ISO-8859-8' => 'ISO-8859-8 ('.$this->app->gettext('hebrew').')', 1293 'ISO-8859-9' => 'ISO-8859-9 ('.$this->app->gettext('turkish').')', 1294 'ISO-8859-10' => 'ISO-8859-10 ('.$this->app->gettext('nordic').')', 1295 'ISO-8859-11' => 'ISO-8859-11 ('.$this->app->gettext('thai').')', 1296 'ISO-8859-13' => 'ISO-8859-13 ('.$this->app->gettext('baltic').')', 1297 'ISO-8859-14' => 'ISO-8859-14 ('.$this->app->gettext('celtic').')', 1298 'ISO-8859-15' => 'ISO-8859-15 ('.$this->app->gettext('westerneuropean').')', 1299 'ISO-8859-16' => 'ISO-8859-16 ('.$this->app->gettext('southeasterneuropean').')', 1300 'WINDOWS-1250' => 'Windows-1250 ('.$this->app->gettext('easterneuropean').')', 1301 'WINDOWS-1251' => 'Windows-1251 ('.$this->app->gettext('cyrillic').')', 1302 'WINDOWS-1252' => 'Windows-1252 ('.$this->app->gettext('westerneuropean').')', 1303 'WINDOWS-1253' => 'Windows-1253 ('.$this->app->gettext('greek').')', 1304 'WINDOWS-1254' => 'Windows-1254 ('.$this->app->gettext('turkish').')', 1305 'WINDOWS-1255' => 'Windows-1255 ('.$this->app->gettext('hebrew').')', 1306 'WINDOWS-1256' => 'Windows-1256 ('.$this->app->gettext('arabic').')', 1307 'WINDOWS-1257' => 'Windows-1257 ('.$this->app->gettext('baltic').')', 1308 'WINDOWS-1258' => 'Windows-1258 ('.$this->app->gettext('vietnamese').')', 1309 'ISO-2022-JP' => 'ISO-2022-JP ('.$this->app->gettext('japanese').')', 1310 'ISO-2022-KR' => 'ISO-2022-KR ('.$this->app->gettext('korean').')', 1311 'ISO-2022-CN' => 'ISO-2022-CN ('.$this->app->gettext('chinese').')', 1312 'EUC-JP' => 'EUC-JP ('.$this->app->gettext('japanese').')', 1313 'EUC-KR' => 'EUC-KR ('.$this->app->gettext('korean').')', 1314 'EUC-CN' => 'EUC-CN ('.$this->app->gettext('chinese').')', 1315 'BIG5' => 'BIG5 ('.$this->app->gettext('chinese').')', 1316 'GB2312' => 'GB2312 ('.$this->app->gettext('chinese').')', 1317 1317 ); 1318 1318 -
branches/devel-framework/roundcubemail/program/include/rcube_ui.php
r5807 r5822 173 173 /** 174 174 * Quote a given string. 175 * Shortcut function for rep_specialchars_output175 * Shortcut function for self::rep_specialchars_output() 176 176 * 177 177 * @return string HTML-quoted string … … 180 180 public static function Q($str, $mode = 'strict', $newlines = true) 181 181 { 182 return rep_specialchars_output($str, 'html', $mode, $newlines);182 return self::rep_specialchars_output($str, 'html', $mode, $newlines); 183 183 } 184 184 … … 186 186 /** 187 187 * Quote a given string for javascript output. 188 * Shortcut function for rep_specialchars_output188 * Shortcut function for self::rep_specialchars_output() 189 189 * 190 190 * @return string JS-quoted string … … 193 193 public static function JQ($str) 194 194 { 195 return rep_specialchars_output($str, 'js');195 return self::rep_specialchars_output($str, 'js'); 196 196 } 197 197 … … 234 234 } 235 235 236 return parse_input_value($value, $allow_html, $charset);237 } 238 239 /** 240 * Parse/validate input value. See get_input_value()236 return self::parse_input_value($value, $allow_html, $charset); 237 } 238 239 /** 240 * Parse/validate input value. See self::get_input_value() 241 241 * Performs stripslashes() and charset conversion if necessary 242 242 * … … 351 351 if (!$attrib['noheader']) { 352 352 foreach ($a_show_cols as $col) { 353 $table->add_header($col, Q(self::label($col)));353 $table->add_header($col, self::Q(self::label($col))); 354 354 } 355 355 } … … 362 362 // format each col 363 363 foreach ($a_show_cols as $col) { 364 $table->add($col, Q($sql_arr[$col]));364 $table->add($col, self::Q($sql_arr[$col])); 365 365 } 366 366 } … … 375 375 // format each col 376 376 foreach ($a_show_cols as $col) { 377 $table->add($col, Q(is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col]));377 $table->add($col, self::Q(is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col])); 378 378 } 379 379 } … … 453 453 454 454 // ignore the whole block if evil styles are detected 455 $source = rcmail_xss_entity_decode($source);455 $source = self::xss_entity_decode($source); 456 456 $stripped = preg_replace('/[^a-z\(:;]/i', '', $source); 457 457 $evilexpr = 'expression|behavior|javascript:|import[^a]' . (!$allow_remote ? '|url\(' : ''); … … 509 509 510 510 /** 511 * Convert a HTML attribute string attributes to an associative array (name => value)512 *513 * @param string $str Input string514 *515 * @return array Key-value pairs of parsed attributes516 */517 public static function parse_attrib_string($str)518 {519 $attrib = array();520 $regexp = '/\s*([-_a-z]+)=(["\'])??(?(2)([^\2]*)\2|(\S+?))/Ui';521 522 preg_match_all($regexp, stripslashes($str), $regs, PREG_SET_ORDER);523 524 // convert attributes to an associative array (name => value)525 if ($regs) {526 foreach ($regs as $attr) {527 $attrib[strtolower($attr[1])] = html_entity_decode($attr[3] . $attr[4]);528 }529 }530 531 return $attrib;532 }533 534 535 /**536 511 * Convert the given date to a human readable form 537 512 * This uses the date formatting properties from config … … 1052 1027 $quota = self::quota_content($attrib); 1053 1028 1054 $OUTPUT->add_script('rcmail.set_quota('. json_serialize($quota).');', 'docready');1029 $OUTPUT->add_script('rcmail.set_quota('.self::json_serialize($quota).');', 'docready'); 1055 1030 1056 1031 return html::span($attrib, ''); … … 1144 1119 * @return string CSS classes separated by space 1145 1120 */ 1146 public static function file type2classname($mimetype, $filename)1121 public static function file2class($mimetype, $filename) 1147 1122 { 1148 1123 list($primary, $secondary) = explode('/', $mimetype); … … 1300 1275 $_SERVER['REQUEST_URI'] . $post_query); 1301 1276 1302 if (! write_log('errors', $log_entry)) {1277 if (!rcmail::write_log('errors', $log_entry)) { 1303 1278 // send error to PHPs error handler if write_log didn't succeed 1304 1279 trigger_error($arg_arr['message']); … … 1539 1514 $out = html_entity_decode(html_entity_decode($content)); 1540 1515 $out = preg_replace_callback('/\\\([0-9a-f]{4})/i', 1541 array(self, ' rcmail_xss_entity_decode_callback'), $out);1516 array(self, 'xss_entity_decode_callback'), $out); 1542 1517 $out = preg_replace('#/\*.*\*/#Ums', '', $out); 1543 1518 … … 1547 1522 1548 1523 /** 1549 * preg_replace_callback callback for rcmail_xss_entity_decode_callback1550 * 1551 * @param array matches result from preg_replace_callback1552 * 1553 * @return string decoded entity1524 * preg_replace_callback callback for xss_entity_decode 1525 * 1526 * @param array $matches Result from preg_replace_callback 1527 * 1528 * @return string Decoded entity 1554 1529 */ 1555 1530 public static function xss_entity_decode_callback($matches) -
branches/devel-framework/roundcubemail/program/include/rcube_user.php
r5183 r5822 64 64 if ($id && !$sql_arr) { 65 65 $sql_result = $this->db->query( 66 "SELECT * FROM ". get_table_name('users')." WHERE user_id = ?", $id);66 "SELECT * FROM ".$this->db->table_name('users')." WHERE user_id = ?", $id); 67 67 $sql_arr = $this->db->fetch_assoc($sql_result); 68 68 } … … 171 171 172 172 $this->db->query( 173 "UPDATE ". get_table_name('users').173 "UPDATE ".$this->db->table_name('users'). 174 174 " SET preferences = ?". 175 175 ", language = ?". … … 230 230 231 231 $sql_result = $this->db->query( 232 "SELECT * FROM ". get_table_name('identities').232 "SELECT * FROM ".$this->db->table_name('identities'). 233 233 " WHERE del <> 1 AND user_id = ?". 234 234 ($sql_add ? " ".$sql_add : ""). … … 265 265 $query_params[] = $this->ID; 266 266 267 $sql = "UPDATE ". get_table_name('identities').267 $sql = "UPDATE ".$this->db->table_name('identities'). 268 268 " SET changed = ".$this->db->now().", ".join(', ', $query_cols). 269 269 " WHERE identity_id = ?". … … 299 299 $insert_values[] = $this->ID; 300 300 301 $sql = "INSERT INTO ". get_table_name('identities').301 $sql = "INSERT INTO ".$this->db->table_name('identities'). 302 302 " (changed, ".join(', ', $insert_cols).")". 303 303 " VALUES (".$this->db->now().", ".join(', ', array_pad(array(), sizeof($insert_values), '?')).")"; … … 322 322 323 323 $sql_result = $this->db->query( 324 "SELECT count(*) AS ident_count FROM ". get_table_name('identities').324 "SELECT count(*) AS ident_count FROM ".$this->db->table_name('identities'). 325 325 " WHERE user_id = ? AND del <> 1", 326 326 $this->ID); … … 333 333 334 334 $this->db->query( 335 "UPDATE ". get_table_name('identities').335 "UPDATE ".$this->db->table_name('identities'). 336 336 " SET del = 1, changed = ".$this->db->now(). 337 337 " WHERE user_id = ?". … … 353 353 if ($this->ID && $iid) { 354 354 $this->db->query( 355 "UPDATE ". get_table_name('identities').355 "UPDATE ".$this->db->table_name('identities'). 356 356 " SET ".$this->db->quoteIdentifier('standard')." = '0'". 357 357 " WHERE user_id = ?". … … 371 371 if ($this->ID) { 372 372 $this->db->query( 373 "UPDATE ". get_table_name('users').373 "UPDATE ".$this->db->table_name('users'). 374 374 " SET last_login = ".$this->db->now(). 375 375 " WHERE user_id = ?", … … 401 401 402 402 // query for matching user name 403 $query = "SELECT * FROM ". get_table_name('users')." WHERE mail_host = ? AND %s = ?";403 $query = "SELECT * FROM ".$dbh->table_name('users')." WHERE mail_host = ? AND %s = ?"; 404 404 $sql_result = $dbh->query(sprintf($query, 'username'), $host, $user); 405 405 … … 449 449 450 450 $dbh->query( 451 "INSERT INTO ". get_table_name('users').451 "INSERT INTO ".$dbh->table_name('users'). 452 452 " (created, last_login, username, mail_host, alias, language)". 453 453 " VALUES (".$dbh->now().", ".$dbh->now().", ?, ?, ?, ?)", … … 571 571 $sql_result = $this->db->query( 572 572 "SELECT search_id AS id, ".$this->db->quoteIdentifier('name') 573 ." FROM ". get_table_name('searches')573 ." FROM ".$this->db->table_name('searches') 574 574 ." WHERE user_id = ?" 575 575 ." AND ".$this->db->quoteIdentifier('type')." = ?" … … 605 605 .", ".$this->db->quoteIdentifier('data') 606 606 .", ".$this->db->quoteIdentifier('type') 607 ." FROM ". get_table_name('searches')607 ." FROM ".$this->db->table_name('searches') 608 608 ." WHERE user_id = ?" 609 609 ." AND search_id = ?", … … 636 636 637 637 $this->db->query( 638 "DELETE FROM ". get_table_name('searches')638 "DELETE FROM ".$this->db->table_name('searches') 639 639 ." WHERE user_id = ?" 640 640 ." AND search_id = ?", … … 666 666 $insert_values[] = serialize($data['data']); 667 667 668 $sql = "INSERT INTO ". get_table_name('searches')668 $sql = "INSERT INTO ".$this->db->table_name('searches') 669 669 ." (".join(', ', $insert_cols).")" 670 670 ." VALUES (".join(', ', array_pad(array(), sizeof($insert_values), '?')).")"; -
branches/devel-framework/roundcubemail/program/include/rcube_vcard.php
r5160 r5822 387 387 foreach ($subnode as $j => $value) { 388 388 if (is_numeric($j) && is_string($value)) 389 $card[$key][$i][$j] = rcube_charset _convert($value, $charset);389 $card[$key][$i][$j] = rcube_charset::convert($value, $charset); 390 390 } 391 391 unset($card[$key][$i]['charset']); … … 423 423 // detect charset and convert to utf-8 424 424 else if (($charset = self::detect_encoding($data)) && $charset != RCMAIL_CHARSET) { 425 $data = rcube_charset _convert($data, $charset);425 $data = rcube_charset::convert($data, $charset); 426 426 $data = preg_replace(array('/^[\xFE\xFF]{2}/', '/^\xEF\xBB\xBF/', '/^\x00+/'), '', $data); // also remove BOM 427 427 $charset = RCMAIL_CHARSET;
Note: See TracChangeset
for help on using the changeset viewer.
