This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

URLs in comments messed up
#1

Hi there,

when one writes a link in a comment, the link is getting messed up.

From the beginning: User writes comment with link in it. In the preview, everything is allright. But when I approve the comment, the link is changed. Before approval, I see the comment in the approval form like

test<a href="http://www.test.de">http://www.test.de</a>

But when I approve it, it gets changed to

test<a href=\"http://www.test.de\">http://www.test.de</a>

which screws the whole thing up, because the link then ends in

http://www.realfragment.de/docs/reportag...t.de%5C%22 (realfragment.de is the URL of my site)

It makes no difference if one uses the html a tag or bb code or if i have link conversion activated. The only solution at the moment is to convert all links in plain text and let link conversion being deactivated.

Could it be this happens because i have the commentics script integrated in a php file? Anyone any idea?

An example page is http://www.realfragment.de/docs/reportag...erstag.php
If someone onts to write a test comment please keep in mind that I have to approve all comments, which may last some hours.

Thanks in advance and regards, Patrick
Reply
#2

Hi,

You have Magic Quotes enabled on your server. You can test it by previewing "Patrick's comment".

Have you completed the interview?
Reply
#3

Wow, thanks a lot. Yes, that was the error. Since disabling Magic Quotes in my php.ini did not work (I think my hoster is overriding this), I am now disabling Magic Quotes at runtime. To do so, I added
PHP Code:
<?php
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list(
$key, $val) = each($process)) {
foreach (
$val as $k => $v) {
unset(
$process[$key][$k]);
if (
is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset(
$process);
}
?>

in adm/includes/pages/edit_comment.php. Since this page is only accesible for admins I have no sorrow about security issues - apart from that, the security benefits of Magic Quotes seem not to be that high, and the developers say it is deprecated.

Thanks again and a good weekend, Patrick
Reply
#4

Hi,

I'm pleased you found a fix!

I couldn't help but notice that the RSS links are not clickable.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
06-Aug-2021, 06:50 PM
Last Post by Steven
27-Jul-2021, 07:12 PM
Last Post by clixcity
29-Jul-2020, 07:56 PM
Last Post by Steven
09-Jul-2018, 08:40 PM
Last Post by vkp
22-May-2017, 04:28 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)