From 967d4223c64b3bf1d4e423536af2a178198ad5bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2020 16:15:48 +0100 Subject: [PATCH] FIX #13277 --- htdocs/compta/facture/card.php | 1 - htdocs/core/class/doleditor.class.php | 41 ++------------------------- htdocs/core/lib/functions.lib.php | 27 ++++++++++++------ 3 files changed, 21 insertions(+), 48 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 43e62d4b3a9..8d2de29ca21 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -141,7 +141,6 @@ $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isd - /* * Actions */ diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index a38c25f7614..de5ef1f2e9f 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -85,44 +85,6 @@ class DolEditor if ($okforextendededitor === 'ace') $this->tool = 'ace'; //if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // ckeditor and ace seems ok with mobile - // Define content and some properties - if ($this->tool == 'ckeditor') - { - $content = dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. - } - /*if ($this->tool == 'fckeditor') - { - require_once DOL_DOCUMENT_ROOT.'/includes/fckeditor/fckeditor.php'; - - $content = dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. - - $this->editor = new FCKeditor($htmlname); - $this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/'; - $this->editor->Value = $content; - $this->editor->Height = $height; - if (!empty($width)) $this->editor->Width = $width; - $this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js - $this->editor->Config['AutoDetectLanguage'] = 'true'; // Language of user (browser) - $this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In'; - $this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded; - - // Rem: Le forcage de ces 2 parametres ne semble pas fonctionner. - // Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart. - // Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ? - $modulepart = 'fckeditor'; - $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file='; - $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/'; - - $this->editor->Config['LinkBrowser'] = ($uselocalbrowser ? 'true' : 'false'); - $this->editor->Config['ImageBrowser'] = ($uselocalbrowser ? 'true' : 'false'); - - if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js')) - { - $this->editor->Config['CustomConfigurationsPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js'; - $this->editor->Config['SkinPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/'; - } - }*/ - // Define some properties if (in_array($this->tool, array('textarea', 'ckeditor', 'ace'))) { @@ -172,7 +134,8 @@ class DolEditor { $found = 1; //$out.= ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f7665511efe..d7c2e505b84 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -987,23 +987,32 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0) /** * Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields. * - * @param string $stringtoescape String to escape - * @param int $keepb 1=Preserve b tags (otherwise, remove them) - * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value). Set to 1 when escaping for a