CMS integrations: editing pages addes extra "\" characters.

CMS integrations: editing pages addes extra "\" characters.

by Rick Hanzlik -
Number of replies: 9
I am trying to add new pages to the CMS module by pasting some existing HTML page code into the aontent Page editor. Everytime I open the page up to edit it, I have additional "\" escape characters added. I have seen this on other web based editors but don't remeber how to get around it. Anybody have a suggestion?

Thanks
Rick
Average of ratings: -
In reply to Rick Hanzlik

Re: CMS integrations: editing pages addes extra "\" characters.

by Gustav W Delius -
I think updating your Moodle to the latest stable version should remove this problem.
In reply to Gustav W Delius

Re: CMS integrations: editing pages addes extra "\" characters.

by Paul Perger -

Hi,

as I described in http://moodle.org/mod/forum/discuss.php?d=56048 I have exactly the same problem. I updated yesterday to the latest stable version, as you advised, but nothing changed.

<h1 class="frontblock">Headline</h1>
still becomes
<h1 class="\"frontblock\"">Headline</h1>
as soon as I reopen a page for editing.

Paul

In reply to Paul Perger

Re: CMS integrations: editing pages addes extra "\" characters.

by Paul Perger -

Hi again,

there is something else I find quite strange. When I want to create/edit a page the editor looks like the screenshots attached - either the vertical separators are out of place or they are missing. I could not make the editor look like that with any other module, block or activity. Maybe the two problems are connected?

Thanx for this plugin!
Paul

Attachment editor.jpg
In reply to Paul Perger

Απάντηση: Re: editing pages addes extra "\" characters.

by aggelos panagiotakis -
i also have the same problems after i have installed the "CMS Plugin" .... i have updated my version of moodle to 1.6.3+.
the editor still adds extra slashes when editing with the html editor. many of my pages now have many slashes. ///// and broken urls!!!!
i really dont know where to look for a solution. please tell me if you find a solution. is this problem in the backtracker ?? and if it is give a link

Thanks a lot.
agelos
In reply to aggelos panagiotakis

Re: Απάντηση: Re: editing pages addes extra "\" characters.

by Andrea Bicciolo -
The problem is confirmed also for me (1.6.3+). In my case the problems does not appears when the course is the front page course, all the other courses shows the problem.

I'm experimenting also another problem when using IMG, FORM and INPUT tags in CMS plugin: they are stripped off always but the front page. $ALLOWED_TAGS contains the above html tags.
In reply to Andrea Bicciolo

Re: Απάντηση: Re: editing pages addes extra "\" characters.

by aggelos panagiotakis -
i experimented with the code a litle bit
file : cms/pageadd.php
Line Code

65 //$page->body = addslashes($page->body); /add to a comment
66 $page->body = stripslashes($page->body); //change addslashes to stripslashes

file : cms/pageupdate.php
Line Code
129 $page->body = strip_tags($page->body, $ALLOWED_TAGS); //leave as is!
130 $page->body = stripslashes($page->body); //change addslashes to stripslashes
131
132 $oldbody = get_field('cmspages', 'body', 'id', $page->id);//remove the addslashes() in the beggining!

THESE CHANGES SEEM TO WORK FINE and do not add any extra slashes
In reply to aggelos panagiotakis

Re: Απάντηση: Re: editing pages addes extra "\" characters.

by Craig Hiebert -
Not working for me, mate. You're doing this with Moodle 1.6.3+, and latest CMS plugin from the downloads page? I'm still getting escaped characters.
In reply to Craig Hiebert

Re: Απάντηση: Re: editing pages addes extra "\" characters.

by aggelos panagiotakis -
Yes,
moodle version 1.6.3+ , and the latest CMS plug in.

I deleted the escaped characters from pages that were broken with previous use of the code. then with my code images , urls , divs etc were all working fine.
I hope you did that too.
Maybe i should send you my code in a zip file but right now my code is a mess as i am working to fix other problems too like the redirect problems of the cms plugin, when i am done i will post here a full solution. Can you wait a day or two?

soon,
aggelos

P.S.: TODAY IS MY NAME CELEBRATION!and i am very very happy!