Upgrade to xinha svn head to fix issues with xinha editors not appearing in Firefox 1.5

This commit is contained in:
Chris Morgan
2005-12-07 03:37:36 +00:00
committed by WineHQ
parent 369b40b046
commit 8786179180
175 changed files with 2371 additions and 1919 deletions

View File

@@ -1,15 +1,22 @@
<?php
// REVISION HISTORY:
//
// 2005-08-17 YmL:
// . security fix on unchecked variables. Original author missed quite a few
// holes.
umask(000);
$temptext = tempnam('/tmp', 'spell_');
if ((!isset($_POST['dictionary'])) || (strlen(trim($_POST['dictionary'])) < 1))
{
$lang = 'en_GB';
$lang = 'en_US';
}
else
{
$lang = $_POST['dictionary'];
}
}
$lang = preg_replace('/[^a-z0-9_]/i', '', $lang);
$aspell = 'aspell';
$aspell_args = '-a --lang=' . $lang;
@@ -34,7 +41,7 @@
// we should at least let it try.
preg_match('/really aspell ([0-9]+)\.([0-9]+)(?:\.([0-9]+))?/i', `$aspell version`, $aVer);
$aVer = array('major' => (int)$aVer[1], 'minor' => (int)$aVer[2], 'release' => (int)$aVer[3]);
$aVer = array('major' => (int)$aVer[1], 'minor' => (int)$aVer[2], 'release' => (int)@$aVer[3]);
if($aVer['major'] >= 0 && $aVer['minor'] >= 60)
{
$aspell_args .= ' -H --encoding=utf-8';
@@ -49,10 +56,7 @@
}
// Personal dictionaries
if(!isset($_REQUEST['p_dicts_path']))
{
$_REQUEST['p_dicts_path'] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'personal_dicts';
}
$p_dicts_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'personal_dicts';
if(file_exists($_REQUEST['p_dicts_path']) && is_writable($_REQUEST['p_dicts_path']))
{
@@ -67,11 +71,37 @@
$_REQUEST['p_dicts_name'] = uniqid('dict');
setcookie('SpellChecker_p_dicts_name', $_REQUEST['p_dicts_name'], time() + 60*60*24*365*10);
}
}
$p_dict_path = $_REQUEST['p_dicts_path'] . DIRECTORY_SEPARATOR . $_REQUEST['p_dicts_name'];
}
$p_dict_path = $_REQUEST['p_dicts_path'] . DIRECTORY_SEPARATOR . preg_replace('/[^a-z0-9_]/i', '', $_REQUEST['p_dicts_name']);
if(!file_exists($p_dict_path))
{
// since there is a single directory for all users this could end up containing
// quite a few subdirectories. To prevent a DOS situation we'll limit the
// total directories created to 2000 (arbitrary). Adjust to suit your installation.
$count = 0;
if( $dir = @opendir( $p_dicts_path ) )
{
while( FALSE !== ($file = readdir($dir)) )
{
$count++;
}
}
// TODO: make this a config value.
if ( $count > 2000 )
{
// either very heavy use or a DOS attempt
die();
}
mkdir($p_dict_path);
chmod($p_dict_path, 02770);
}
@@ -83,8 +113,11 @@
}
}
// as an additional precaution check the aspell_args for illegal
// characters
$aspell_args = preg_replace( "/[|><;\$]+/", '', $aspell_args );
$aspelldictionaries = "$aspell dump dicts";
$aspellcommand = "$aspell $aspell_args < $temptext";
?>
?>

View File

@@ -1,17 +1,6 @@
// I18N constants
// LANG: "cz", ENCODING: UTF-8
// Author: Jiri Löw, <jirilow@jirilow.com>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
{
"Please confirm that you want to open this link": "Prosím potvrďte otevření tohoto odkazu",
"Cancel": "Zrušit",
@@ -34,4 +23,4 @@
"Spell-check": "Kontrola správnosti slov",
"Suggestions": "Doporučení",
"One moment...": "strpení prosím ;-)"
}
};

View File

@@ -1,16 +1,6 @@
// I18N constants
// LANG: "da", ENCODING: UTF-8
// Author: Steen SÞnderup, <steen@soenderup.com>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
{
"Please confirm that you want to open this link": "Vil du fÞlge dette link?",
"Cancel": "Anuler",
@@ -33,4 +23,4 @@
"Spell-check": "Stavekontrol",
"Suggestions": "Forslag",
"One moment...": "Vent venligst"
}
};

View File

@@ -1,8 +1,6 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8
// Author: Broxx, <broxx@broxx.com>
{
"Please confirm that you want to open this link": "Wollen Sie diesen Link oeffnen",
"Cancel": "Abbrechen",
@@ -24,5 +22,5 @@
"Replace": "Ersetzen",
"Spell-check": "Ueberpruefung",
"Suggestions": "Vorschlag",
"One moment...": "bittsche wartn ;-)"
}
"One moment...": "Bitte warten..."
};

View File

@@ -1,17 +1,5 @@
// I18N constants
// LANG: "fr", ENCODING: UTF-8
// Author: Laurent Vilday, mokhet@mokhet.com
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
{
"Please confirm that you want to open this link": "Veuillez confirmer l'ouverture de ce lien",
"Cancel": "Annuler",
@@ -35,4 +23,4 @@
"Spell-check": "Correction",
"Suggestions": "Suggestions",
"One moment...": "Veuillez patienter"
}
};

View File

@@ -1,17 +1,6 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
{
"Please confirm that you want to open this link": "אנא אשר שברצונך לפתוח קישור זה",
"Cancel": "ביטול",
@@ -35,4 +24,4 @@
"Spell-check": "בדיקת איות",
"Suggestions": "הצעות",
"One moment...": "ענא המטן ;-)"
}
};

View File

@@ -1,17 +1,6 @@
// I18N constants
// LANG: "hu", ENCODING: UTF-8
// Author: Miklós Somogyi, <somogyine@vnet.hu>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
{
"Please confirm that you want to open this link": "Megerősítés",
"Cancel": "Mégsem",
@@ -34,4 +23,4 @@
"Spell-check": "Helyesírásellenőrzés",
"Suggestions": "Tippek",
"One moment...": "Kis türelmet ;-)"
}
};

View File

@@ -1,18 +1,6 @@
// I18N constants
// LANG: "nl", ENCODING: UTF-8
// Author: A.H van den Broek http://www.kontaktfm.nl
// Email : tonbroek@kontaktfm.nl
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
// Author: A.H van den Broek http://www.kontaktfm.nl, tonbroek@kontaktfm.nl
{
"Please confirm that you want to open this link": "Weet u zeker dat u deze link wilt openen?",
"Cancel": "Annuleer",
@@ -36,4 +24,4 @@
"Spell-check": "Spell-check",
"Suggestions": "Suggestie",
"One moment...": "Even wachten ;-)"
}
};

View File

@@ -1,7 +1,6 @@
// I18N constants
// LANG: "no", ENCODING: UTF-8
// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
{
"Please confirm that you want to open this link": "Ønsker du å åpne denne lenken",
"Cancel": "Avbryt",
@@ -24,4 +23,4 @@
"Spell-check": "Stavekontroll",
"Suggestions": "Forslag",
"One moment...": "Et øyeblikk..."
}
};

View File

@@ -1,17 +1,6 @@
// I18N constants
// LANG: "ro", ENCODING: UTF-8
// Author: Mihai Bazon, http://dynarch.com/mishoo
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
{
"Please confirm that you want to open this link": "Vă rog confirmaţi că vreţi să deschideţi acest link",
"Cancel": "Anulează",
@@ -34,4 +23,4 @@
"Spell-check": "Detectează greşeli",
"Suggestions": "Sugestii",
"One moment...": "va rog ashteptatzi ;-)"
}
};

View File

@@ -163,4 +163,4 @@ if(ereg(",$",$dictionaries))
echo '<div id="HA-spellcheck-dictionaries">'.$dictionaries.'</div>';
echo '</body></html>';
?>
?>

View File

@@ -104,7 +104,7 @@
</td>
<td>
<iframe src="about:blank" width="100%" height="100%"
<iframe src="../../popups/blank.html" width="100%" height="100%"
id="i_framecontent" name="framecontent"></iframe>
</td>
</tr>

View File

@@ -46,14 +46,14 @@ function makeCleanDoc(leaveFixed) {
// HTML to such extent that our poor Perl parser doesn't understand it
// anymore.
return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor);
};
}
function recheckClicked() {
document.getElementById("status").innerHTML = _lc("Please wait: changing dictionary to") + ': "' + document.getElementById("f_dictionary").value + '".';
var field = document.getElementById("f_content");
field.value = makeCleanDoc(true);
field.form.submit();
};
}
function saveClicked() {
if (modified) {
@@ -81,7 +81,7 @@ function saveClicked() {
window.close();
}
return false;
};
}
function cancelClicked() {
var ok = true;
@@ -92,7 +92,7 @@ function cancelClicked() {
window.close();
}
return false;
};
}
function replaceWord(el) {
var replacement = document.getElementById("v_replacement").value;
@@ -109,7 +109,7 @@ function replaceWord(el) {
}
to_r_list.push([el.innerHTML, replacement]);
el.innerHTML = replacement;
};
}
function replaceClicked() {
replaceWord(currentElement);
@@ -127,14 +127,14 @@ function replaceClicked() {
}
wrongWords[index].__msh_wordClicked(true);
return false;
};
}
function revertClicked() {
document.getElementById("v_replacement").value = currentElement.__msh_origWord;
replaceWord(currentElement);
currentElement.className = "HA-spellcheck-error HA-spellcheck-current";
return false;
};
}
function replaceAllClicked() {
var replacement = document.getElementById("v_replacement").value;
@@ -164,24 +164,24 @@ function replaceAllClicked() {
replaceClicked();
}
return false;
};
}
function ignoreClicked() {
document.getElementById("v_replacement").value = currentElement.__msh_origWord;
replaceClicked();
return false;
};
}
function ignoreAllClicked() {
document.getElementById("v_replacement").value = currentElement.__msh_origWord;
replaceAllClicked();
return false;
};
}
function learnClicked() {
to_p_dict.push(currentElement.__msh_origWord);
return ignoreAllClicked();
};
}
function internationalizeWindow() {
var types = ["div", "span", "button"];
@@ -196,7 +196,7 @@ function internationalizeWindow() {
}
}
}
};
}
function initDocument() {
internationalizeWindow();
@@ -238,7 +238,7 @@ function initDocument() {
}
else
{
document.getElementById("b_learn").parent.removeChild(document.getElementById("b_learn"));
document.getElementById("b_learn").parentNode.removeChild(document.getElementById("b_learn"));
}
document.getElementById("b_replall").onclick = replaceAllClicked;
document.getElementById("b_ignore").onclick = ignoreClicked;
@@ -254,7 +254,7 @@ function initDocument() {
select.onchange = function() {
document.getElementById("f_dictionary").value = this.value;
};
};
}
function getAbsolutePos(el) {
var r = { x: el.offsetLeft, y: el.offsetTop };
@@ -264,7 +264,7 @@ function getAbsolutePos(el) {
r.y += tmp.y;
}
return r;
};
}
function wordClicked(scroll) {
var self = this;
@@ -337,15 +337,15 @@ function wordClicked(scroll) {
select.style.display = "none";
select.style.display = "block";
return false;
};
}
function wordMouseOver() {
this.className += " HA-spellcheck-hover";
};
}
function wordMouseOut() {
this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
};
}
function displayInfo() {
var info = frame.contentWindow.spellcheck_info;
@@ -359,7 +359,7 @@ function displayInfo() {
alert(txt);
}
return false;
};
}
function finishedSpellChecking() {
// initialization of global variables
@@ -442,4 +442,4 @@ function finishedSpellChecking() {
return false;
};
}
};
}

View File

@@ -26,7 +26,7 @@ function SpellChecker(editor) {
});
cfg.addToolbarElement("SC-spell-check", "htmlmode", 1);
};
}
SpellChecker._pluginInfo = {
name : "SpellChecker",
@@ -41,7 +41,7 @@ SpellChecker._pluginInfo = {
SpellChecker.prototype._lc = function(string) {
return HTMLArea._lc(string, 'SpellChecker');
}
};
SpellChecker.btnList = [
null, // separator
@@ -70,4 +70,4 @@ SpellChecker.prototype.buttonPress = function(editor, id) {
};
// this needs to be global, it's accessed from spell-check-ui.html
SpellChecker.editor = null;
SpellChecker.editor = null;