Page 1 of 1

[RESOLVED] Customfield dropdown adding \\\ to options?

Posted: Thu Oct 29, 2009 2:21 am
by Raven
Hi, I have noticed that when adding a list of options to a customfield for a dropdown menu that if I have an option like this: Don't Know then save, then edit again it has been changed to read Don\'t Know.

No big deal as it does not show when viewingoptions on the customer side. However, if I edit again then it shows like: Don\\\'t Know... This then shows the extra \ for the customer when viewing the drop down.

Any ideas on how to prevent this from happening or at least check that any ' have an \ next to them before simply adding more and more each time?

I hope you see what I mean.

Posted: Thu Oct 29, 2009 7:04 pm
by Klemen
You're right, it's another PHP "magic quotes" issue. I'm so glad they are disabling this feature in PHP 6.

Anyway, try adding

Code: Select all

$query = stripslashes($query);
just below

Code: Select all

$maxlen = hesk_input($_GET['m']) or $maxlen = 255;
in file admin/options.php

Then go to the settings, fix all values, save changes and it should work fine from now on.

Posted: Fri Oct 30, 2009 1:16 am
by Raven
Nice one :) That fixed it!

Thank you for your help (again hehe) - Quick question, are all of these little bug fixes being carried over to the next version of HESK by chance?

Cheers

Posted: Fri Oct 30, 2009 7:41 am
by Klemen
No, all the bugs are fixed of course in the next version and new bugs are added so I have more work for the future 8) :lol:

Posted: Fri Oct 30, 2009 8:55 pm
by Raven
As is always the case with any code hehe

Thanks for all your hard work 8) We all appreciate the time and effort you have put in to this and it shows.

Thank you