Backslashes problem

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Warlock
Posts: 10
Joined: Thu Jan 29, 2009 12:06 pm

Backslashes problem

Post 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
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post 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']);
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Warlock
Posts: 10
Joined: Thu Jan 29, 2009 12:06 pm

Post by Warlock »

Thanks.

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