Linux sagir-us1.hostever.us 5.14.0-570.51.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 8 09:41:34 EDT 2025 x86_64
LiteSpeed
Server IP : 104.247.108.91 & Your IP : 216.73.216.26
Domains : 74 Domain
User : georgeto
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
webuzo-data /
roundcube /
program /
lib /
Roundcube /
Delete
Unzip
Name
Size
Permission
Date
Action
cache
[ DIR ]
drwxr-xr-x
2026-02-08 09:33
db
[ DIR ]
drwxr-xr-x
2026-02-08 09:33
session
[ DIR ]
drwxr-xr-x
2026-02-08 09:33
spellchecker
[ DIR ]
drwxr-xr-x
2026-02-08 09:33
README.md
3.72
KB
-rw-r--r--
2026-02-08 09:33
bootstrap.php
11.94
KB
-rw-r--r--
2026-02-08 09:33
html.php
28.33
KB
-rw-r--r--
2026-02-08 09:33
rcube.php
56.49
KB
-rw-r--r--
2026-02-08 09:33
rcube_addressbook.php
30.71
KB
-rw-r--r--
2026-02-08 09:33
rcube_addresses.php
13.24
KB
-rw-r--r--
2026-02-08 09:33
rcube_base_replacer.php
3.63
KB
-rw-r--r--
2026-02-08 09:33
rcube_browser.php
4.09
KB
-rw-r--r--
2026-02-08 09:33
rcube_cache.php
19
KB
-rw-r--r--
2026-02-08 09:33
rcube_charset.php
24.98
KB
-rw-r--r--
2026-02-08 09:33
rcube_config.php
31.87
KB
-rw-r--r--
2026-02-08 09:33
rcube_contacts.php
35.47
KB
-rw-r--r--
2026-02-08 09:33
rcube_content_filter.php
2.05
KB
-rw-r--r--
2026-02-08 09:33
rcube_csv2vcard.php
24.52
KB
-rw-r--r--
2026-02-08 09:33
rcube_db.php
44.35
KB
-rw-r--r--
2026-02-08 09:33
rcube_enriched.php
5.31
KB
-rw-r--r--
2026-02-08 09:33
rcube_html2text.php
26.82
KB
-rw-r--r--
2026-02-08 09:33
rcube_image.php
18.24
KB
-rw-r--r--
2026-02-08 09:33
rcube_imap.php
152.15
KB
-rw-r--r--
2026-02-08 09:33
rcube_imap_cache.php
39.08
KB
-rw-r--r--
2026-02-08 09:33
rcube_imap_generic.php
138.47
KB
-rw-r--r--
2026-02-08 09:33
rcube_imap_search.php
8.92
KB
-rw-r--r--
2026-02-08 09:33
rcube_ldap.php
81.01
KB
-rw-r--r--
2026-02-08 09:33
rcube_ldap_generic.php
9.64
KB
-rw-r--r--
2026-02-08 09:33
rcube_message.php
46.62
KB
-rw-r--r--
2026-02-08 09:33
rcube_message_header.php
8.73
KB
-rw-r--r--
2026-02-08 09:33
rcube_message_part.php
3.04
KB
-rw-r--r--
2026-02-08 09:33
rcube_mime.php
33.51
KB
-rw-r--r--
2026-02-08 09:33
rcube_mime_decode.php
14.47
KB
-rw-r--r--
2026-02-08 09:33
rcube_output.php
13
KB
-rw-r--r--
2026-02-08 09:33
rcube_plugin.php
13.27
KB
-rw-r--r--
2026-02-08 09:33
rcube_plugin_api.php
28.06
KB
-rw-r--r--
2026-02-08 09:33
rcube_result_index.php
12.93
KB
-rw-r--r--
2026-02-08 09:33
rcube_result_multifolder.php
9.89
KB
-rw-r--r--
2026-02-08 09:33
rcube_result_set.php
3.88
KB
-rw-r--r--
2026-02-08 09:33
rcube_result_thread.php
20.92
KB
-rw-r--r--
2026-02-08 09:33
rcube_session.php
21.11
KB
-rw-r--r--
2026-02-08 09:33
rcube_smtp.php
20.41
KB
-rw-r--r--
2026-02-08 09:33
rcube_spellchecker.php
12.89
KB
-rw-r--r--
2026-02-08 09:33
rcube_spoofchecker.php
2.69
KB
-rw-r--r--
2026-02-08 09:33
rcube_storage.php
30.1
KB
-rw-r--r--
2026-02-08 09:33
rcube_string_replacer.php
11.07
KB
-rw-r--r--
2026-02-08 09:33
rcube_text2html.php
10.88
KB
-rw-r--r--
2026-02-08 09:33
rcube_tnef_decoder.php
27.38
KB
-rw-r--r--
2026-02-08 09:33
rcube_user.php
31.67
KB
-rw-r--r--
2026-02-08 09:33
rcube_utils.php
58.74
KB
-rw-r--r--
2026-02-08 09:33
rcube_vcard.php
36.16
KB
-rw-r--r--
2026-02-08 09:33
rcube_washtml.php
38.15
KB
-rw-r--r--
2026-02-08 09:33
Save
Rename
<?php /** +-----------------------------------------------------------------------+ | This file is part of the Roundcube Webmail client | | | | Copyright (C) The Roundcube Dev Team | | Copyright (C) Kolab Systems AG | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | | See the README file for a full license statement. | | | | PURPOSE: | | Spellchecking using different backends | +-----------------------------------------------------------------------+ | Author: Aleksander Machniak <machniak@kolabsys.com> | | Author: Thomas Bruederli <roundcube@gmail.com> | +-----------------------------------------------------------------------+ */ /** * Helper class for spellchecking with GoogieSpell and PSpell support. * * @package Framework * @subpackage Utils */ class rcube_spellchecker { private $matches = []; private $options = []; private $content; private $engine; private $backend; private $lang; private $rc; private $error; private $dict; private $have_dict; /** * Constructor * * @param string $lang Language code */ function __construct($lang = 'en') { $this->rc = rcube::get_instance(); $this->engine = $this->rc->config->get('spellcheck_engine', 'googie'); $this->lang = $lang ?: 'en'; $this->options = [ 'ignore_syms' => $this->rc->config->get('spellcheck_ignore_syms'), 'ignore_nums' => $this->rc->config->get('spellcheck_ignore_nums'), 'ignore_caps' => $this->rc->config->get('spellcheck_ignore_caps'), 'dictionary' => $this->rc->config->get('spellcheck_dictionary'), ]; $class = 'rcube_spellchecker_' . $this->engine; if (class_exists($class)) { $this->backend = new $class($this, $this->lang, $this->options); } else { $this->error = "Unknown spellcheck engine '$this->engine'"; } } /** * Return a list of supported languages */ function languages() { // trust configuration $configured = $this->rc->config->get('spellcheck_languages'); if (!empty($configured) && is_array($configured) && empty($configured[0])) { return $configured; } $langs = []; if (!empty($configured)) { $langs = (array) $configured; } else if ($this->backend) { $langs = $this->backend->languages(); } // load index $rcube_languages = []; $rcube_language_aliases = []; @include(RCUBE_LOCALIZATION_DIR . 'index.inc'); // add correct labels $languages = []; foreach ($langs as $lang) { $langc = strtolower(substr($lang, 0, 2)); $alias = !empty($rcube_language_aliases[$langc]) ? $rcube_language_aliases[$langc] : null; if (!$alias) { $alias = $langc.'_'.strtoupper($langc); } if (!empty($rcube_languages[$lang])) { $languages[$lang] = $rcube_languages[$lang]; } else if (!empty($rcube_languages[$alias])) { $languages[$lang] = $rcube_languages[$alias]; } else { $languages[$lang] = ucfirst($lang); } } // remove possible duplicates (#1489395) $languages = array_unique($languages); asort($languages); return $languages; } /** * Set content and check spelling * * @param string $text Text content for spellchecking * @param bool $is_html Enables HTML-to-Text conversion * * @return bool True when no misspelling found, otherwise false */ function check($text, $is_html = false) { // convert to plain text if ($is_html) { $this->content = $this->html2text($text); } else { $this->content = $text; } // ignore links (#8527) $callback = function ($matches) { // replace the link with a dummy string that has the same length // we can't just remove the link return str_repeat(' ', strlen($matches[0])); }; $this->content = preg_replace_callback('~(^|\s)(www.\S+|[a-z]+://\S+)~', $callback, $this->content); if ($this->backend) { $this->matches = $this->backend->check($this->content); } return $this->found() == 0; } /** * Number of misspellings found (after check) * * @return int Number of misspellings */ function found() { return count($this->matches); } /** * Returns suggestions for the specified word * * @param string $word The word * * @return array Suggestions list */ function get_suggestions($word) { if ($this->backend) { return $this->backend->get_suggestions($word); } return []; } /** * Returns misspelled words * * @param string $text The content for spellchecking. If empty content * used for check() method will be used. * * @return array List of misspelled words */ function get_words($text = null, $is_html=false) { if ($is_html) { $text = $this->html2text($text); } if ($this->backend) { return $this->backend->get_words($text); } return []; } /** * Returns checking result in XML (Googiespell) format * * @return string XML content */ function get_xml() { // send output $out = '<?xml version="1.0" encoding="'.RCUBE_CHARSET.'"?><spellresult charschecked="'.mb_strlen($this->content).'">'; foreach ((array) $this->matches as $item) { $out .= '<c o="'.$item[1].'" l="'.$item[2].'">'; $out .= is_array($item[4]) ? implode("\t", $item[4]) : $item[4]; $out .= '</c>'; } $out .= '</spellresult>'; return $out; } /** * Returns checking result (misspelled words with suggestions) * * @return array Spellchecking result. An array indexed by word. */ function get() { $result = []; foreach ((array) $this->matches as $item) { if ($this->engine == 'pspell') { $word = $item[0]; } else { $word = mb_substr($this->content, $item[1], $item[2], RCUBE_CHARSET); } if (is_array($item[4])) { $suggestions = $item[4]; } else if (empty($item[4])) { $suggestions = []; } else { $suggestions = explode("\t", $item[4]); } $result[$word] = $suggestions; } return $result; } /** * Returns error message * * @return string Error message */ function error() { return $this->error ?: ($this->backend ? $this->backend->error() : false); } private function html2text($text) { $h2t = new rcube_html2text($text, false, false, 0); return $h2t->get_text(); } /** * Check if the specified word is an exception according to the spellcheck options. * * @param string $word The word * * @return bool True if the word is an exception, False otherwise */ public function is_exception($word) { // Contain only symbols (e.g. "+9,0", "2:2") if (!$word || preg_match('/^[0-9@#$%^&_+~*<>=:;?!,.-]+$/', $word)) { return true; } // Contain symbols (e.g. "g@@gle"), all symbols excluding separators if (!empty($this->options['ignore_syms']) && preg_match('/[@#$%^&_+~*=-]/', $word)) { return true; } // Contain numbers (e.g. "g00g13") if (!empty($this->options['ignore_nums']) && preg_match('/[0-9]/', $word)) { return true; } // Blocked caps (e.g. "GOOGLE") if (!empty($this->options['ignore_caps']) && $word == mb_strtoupper($word)) { return true; } // Use exceptions from dictionary if (!empty($this->options['dictionary'])) { $this->load_dict(); // @TODO: should dictionary be case-insensitive? if (!empty($this->dict) && in_array($word, $this->dict)) { return true; } } return false; } /** * Add a word to dictionary * * @param string $word The word to add */ public function add_word($word) { $this->load_dict(); foreach (explode(' ', $word) as $word) { // sanity check if (strlen($word) < 512) { $this->dict[] = $word; $valid = true; } } if (!empty($valid)) { $this->dict = array_unique($this->dict); $this->update_dict(); } } /** * Remove a word from dictionary * * @param string $word The word to remove */ public function remove_word($word) { $this->load_dict(); if (($key = array_search($word, $this->dict)) !== false) { unset($this->dict[$key]); $this->update_dict(); } } /** * Update dictionary row in DB */ private function update_dict() { $userid = null; if (strcasecmp($this->options['dictionary'], 'shared') != 0) { $userid = $this->rc->get_user_id(); } $plugin = $this->rc->plugins->exec_hook('spell_dictionary_save', [ 'userid' => $userid, 'language' => $this->lang, 'dictionary' => $this->dict]); if (!empty($plugin['abort'])) { return; } if ($this->have_dict) { if (!empty($this->dict)) { $this->rc->db->query( "UPDATE " . $this->rc->db->table_name('dictionary', true) ." SET `data` = ?" ." WHERE `user_id` " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL") ." AND `language` = ?", implode(' ', $plugin['dictionary']), $plugin['language']); } // don't store empty dict else { $this->rc->db->query( "DELETE FROM " . $this->rc->db->table_name('dictionary', true) ." WHERE `user_id` " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL") ." AND `language` = ?", $plugin['language']); } } else if (!empty($this->dict)) { $this->rc->db->query( "INSERT INTO " . $this->rc->db->table_name('dictionary', true) ." (`user_id`, `language`, `data`) VALUES (?, ?, ?)", $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary'])); } } /** * Get dictionary from DB */ private function load_dict() { if (is_array($this->dict)) { return $this->dict; } $userid = null; if (strcasecmp($this->options['dictionary'], 'shared') != 0) { $userid = $this->rc->get_user_id(); } $plugin = $this->rc->plugins->exec_hook('spell_dictionary_get', [ 'userid' => $userid, 'language' => $this->lang, 'dictionary' => []]); if (empty($plugin['abort'])) { $dict = []; $sql_result = $this->rc->db->query( "SELECT `data` FROM " . $this->rc->db->table_name('dictionary', true) ." WHERE `user_id` ". ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL") ." AND `language` = ?", $plugin['language']); if ($sql_arr = $this->rc->db->fetch_assoc($sql_result)) { $this->have_dict = true; if (!empty($sql_arr['data'])) { $dict = explode(' ', $sql_arr['data']); } } $plugin['dictionary'] = array_merge((array)$plugin['dictionary'], $dict); } if (!empty($plugin['dictionary']) && is_array($plugin['dictionary'])) { $this->dict = $plugin['dictionary']; } else { $this->dict = []; } return $this->dict; } }