Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
68b3de5b
Commit
68b3de5b
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
NEW ckeditor accept a parameter to disable all html filtering
parent
8a323911
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/class/doleditor.class.php
+11
-6
11 additions, 6 deletions
htdocs/core/class/doleditor.class.php
htdocs/websites/index.php
+1
-1
1 addition, 1 deletion
htdocs/websites/index.php
with
12 additions
and
7 deletions
htdocs/core/class/doleditor.class.php
+
11
−
6
View file @
68b3de5b
...
@@ -142,19 +142,23 @@ class DolEditor
...
@@ -142,19 +142,23 @@ class DolEditor
*
*
* @param int $noprint 1=Return HTML string instead of printing it to output
* @param int $noprint 1=Return HTML string instead of printing it to output
* @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });"
* @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });"
* @param boolean $disallowAnyContent Disallow to use any content. true=restrict to a predefined list of allowed elements.
* @return void|string
* @return void|string
*/
*/
function
Create
(
$noprint
=
0
,
$morejs
=
''
)
function
Create
(
$noprint
=
0
,
$morejs
=
''
,
$disallowAnyContent
=
true
)
{
{
global
$conf
,
$langs
;
global
$conf
,
$langs
;
$fullpage
=
False
;
$fullpage
=
False
;
if
(
isset
(
$conf
->
global
->
FCKEDITOR_ALLOW_ANY_CONTENT
))
{
$disallowAnyContent
=
empty
(
$conf
->
global
->
FCKEDITOR_ALLOW_ANY_CONTENT
);
// Only predefined list of html tags are allowed
$disallowAnyContent
=
empty
(
$conf
->
global
->
FCKEDITOR_ALLOW_ANY_CONTENT
);
// Only predefined list of html tags are allowed
}
$found
=
0
;
$found
=
0
;
$out
=
''
;
$out
=
''
;
if
(
$this
->
tool
==
'fckeditor'
)
if
(
$this
->
tool
==
'fckeditor'
)
// not used anymore
{
{
$found
=
1
;
$found
=
1
;
$this
->
editor
->
Create
();
$this
->
editor
->
Create
();
...
@@ -179,6 +183,7 @@ class DolEditor
...
@@ -179,6 +183,7 @@ class DolEditor
$htmlencode_force
=
preg_match
(
'/_encoded$/'
,
$this
->
toolbarname
)
?
'true'
:
'false'
;
$htmlencode_force
=
preg_match
(
'/_encoded$/'
,
$this
->
toolbarname
)
?
'true'
:
'false'
;
$out
.
=
'<!-- Output ckeditor $disallowAnyContent='
.
$disallowAnyContent
.
' toolbarname='
.
$this
->
toolbarname
.
' -->'
.
"
\n
"
;
$out
.
=
'<script type="text/javascript">
$out
.
=
'<script type="text/javascript">
$(document).ready(function () {
$(document).ready(function () {
/* if (CKEDITOR.loadFullCore) CKEDITOR.loadFullCore(); */
/* if (CKEDITOR.loadFullCore) CKEDITOR.loadFullCore(); */
...
...
This diff is collapsed.
Click to expand it.
htdocs/websites/index.php
+
1
−
1
View file @
68b3de5b
...
@@ -904,7 +904,7 @@ if ($action == 'editcontent')
...
@@ -904,7 +904,7 @@ if ($action == 'editcontent')
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/doleditor.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/doleditor.class.php'
;
$doleditor
=
new
DolEditor
(
'PAGE_CONTENT'
,
$contentforedit
,
''
,
500
,
'Full'
,
''
,
true
,
true
,
true
,
5
,
60
);
$doleditor
=
new
DolEditor
(
'PAGE_CONTENT'
,
$contentforedit
,
''
,
500
,
'Full'
,
''
,
true
,
true
,
true
,
5
,
60
);
$doleditor
->
Create
();
$doleditor
->
Create
(
0
,
''
,
false
);
}
}
print
'</div></form>'
;
print
'</div></form>'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment