Page 1 of 1

Backslashes problem

Posted: Thu Feb 05, 2009 9:55 am
by Warlock
There is a backslash problem in the current version 2.0. I'm not really sure if it is really a bug, therefore I posted it as a new topic.

Here is an example from the knowlegdebase:
Assume you have an article about some LaTeX stuff which contains some keywords:

\if \@testmacro \@relax \@relax
Commands to use if the macro is undefined
\else
Commands to use if the macro IS defined
\fi

After saving the article for the first time, everything is fine. But, after editing the article, all backslashes '\' have vanished.

@Klemen, could you please point me to the place in the php code, where you do this removal of backslashes?
I think this phenomen also occurs in the tickets part, but I haven't tested it so far.

Best,
Warlock

Posted: Thu Feb 05, 2009 3:16 pm
by Klemen
Hi,

Ah, backslashes, a common problem with PHP "thanks" to the magic_quotes (which will be removed as of PHP 6)...

Try changing in admin/manage_knowledgebase.php line 512 from

Code: Select all

$article['content'] = htmlspecialchars(stripslashes($article['content']));
to

Code: Select all

$article['content'] = htmlspecialchars($article['content']);
and delete line 520

Code: Select all

$article['content'] = stripslashes($article['content']);

Posted: Thu Feb 05, 2009 4:07 pm
by Warlock
Thanks.

Are the ticket area textfields also affected by the stripslashes function?