HTML editor image link corrupt

HTML editor image link corrupt

by Armand van der merwe -
Number of replies: 1

Using HTML editor. I select a file previously uploaded and select save. The image appears 100%. The moment I edit the HTML page and add any text to the page the link to the image corrupts.

Correct link

<img title="blackboard" height="152" alt="blackboard" hspace="0" src="http://localhost/moodle/file.php?file=/1/blackboard.jpg" width="107" align="left" border="0" />

Corrupted link

<img title="\"blackboard\"" height="1" alt="\"blackboard\"" src="http://localhost/%22http://localhost/moodle/file.php?file=/1/blackboard.jpg\"" width="1" border="0" /> ggg

I have created a new database and installed a new moodle 1.7.1 version. Same problem re-occurs. I made sure that all java script options in IE7 is enabled.  I have also disabled slasharguments.

I am running IE7, IIS5 on MS SQL 2005. The rest of Moodle runs 100%.

The closest other post with more or less the same problem was the following:

http://moodle.org/mod/forum/discuss.php?d=62197

have created my first course in Moodle. When I go in to edit the course, strange things happen...

I have a page that contains a number of hyperlinks. On of the hyperlinked words is the word "Acronyms", which is to open up a new browser window and take the user to
http://www.example.com.acronyms.html.

I have created the page, but when I edit it, the link changes from "http://www.example.com.acronyms.html" to "http://www.example.com/%22http://www.example.com.acronyms.html/%22".

Any idea why this is being added to the correct url? is this a setting that I have overlooked? Any help would be greatly appreciated.

I have set up a test account in case anyone would like to see the problem first hand. My development installation of moodle is at
http://www.moptac.net/moodle. You can log in with username: moodle and password: moodle. Try editing any of the pages in the course "Plant Bio Security Management. - specifically, try changing any of the hyperlinks. Feel free to poke around, as this is a test account on a development server.

Again, any assistance would be welcomed.

Picture of Steve Garcia
Re: 1.7 Inserting url and slashes when editing a web page resource
by Steve Garcia - Friday, 19 January 2007, 07:48 AM
  It looks like your multi-link page is now a separate HTML file, non-editable from the HTML editor.

However, I added a couple of links to the bottom of your "Welcome" page, and I see your problem. This looks suspiciously like a problem with the
database. *Something* is trying to "escape" the quotes in your strings, and then the next time you edit the page it tries to "escape" both the backslashes and the quotes from the previous round.

Escaping means to add a backslash before each character to be escaped. This is necessary because when the string is fed to the
database, it will interpret any quotes or backslashes as part of its own commands and not as data to be added.

The code *does* have to do the escapes, but it looks like it's being done twice.

Any suggestions will really be appreciated.

Average of ratings: -
In reply to Armand van der merwe

Re: HTML editor image link corrupt

by Armand van der merwe -

Feeling like I am having a monologue. Anyway, after spending three days strugling along, changing installations to Mysql, installing Apache, doing this, doing that and going happily and merrily around in circles without achieving anything I stumbled accross the answer,

The famous PHP.INI

magic_quotes_sybase = on

and remember to restart the IIS server.

Anyway, hope this little bit of trivia will help some other lost soul in this strange, strange galaxy of information technology that we are travelling in.

Obviously there is the likelyhood that I failed to  read the user installation manual properly (as usual the case) and will be informed by some wise guy that is printed in BIG BOLD CAPITAL LETTERS on page one of the "You MUST read this section first". What fun is there anyway in a man's life if he read the installation manual first before he try to assemble anything. It's like asking for directions when you are lost and your wife is sitting next to you, a definitedly NO, NO.