1
Finally I got it. I have implemented my idea that I explained above.
If anyone is interested in my aproach here is the hack (pretty rough though, but well... let's clean it up together). In the file 'include/comment_post.php' at the line about 240 make the code to look close to this:
The addition is actually this:
I have been using it for a month. So far no spam at all. And users have not noticed any change in the interface. Even the anonymous ones. They're happy and so am I.
If anyone is interested in my aproach here is the hack (pretty rough though, but well... let's clean it up together). In the file 'include/comment_post.php' at the line about 240 make the code to look close to this:
if (!empty($com_id)) {
// [ skipped ]
} else {
// [ skipped ]
if (is_object($xoopsUser)) {
// [ skipped ]
} else {
$dohtml = 0;
$uid = 0;
if ($xoopsModuleConfig['com_anonpost'] != 1) {
redirect_header($redirect_page.'='.$com_itemid.'&com_id='.$com_id.'&com_mode='.$com_mode.'&com_order='.$com_order, 1, _NOPERM);
exit();
}
$myts =& MyTextSanitizer::getInstance();
if (eregi('<A ',$myts->sanitizeForPreview($com_text,1))) {
redirect_header($redirect_page.'='.$com_itemid.'&com_id='.$com_id.'&com_mode='.$com_mode.'&com_order='.$com_order, 1, "No URLs permitted for unregistered users");
exit();
};
}
The addition is actually this:
$myts =& MyTextSanitizer::getInstance();
if (eregi('<A ',$myts->sanitizeForPreview($com_text,1))) {
redirect_header($redirect_page.'='.$com_itemid.'&com_id='.$com_id.'&com_mode='.$com_mode.'&com_order='.$com_order, 1, "No URLs permitted for unregistered users");
exit();
};
I have been using it for a month. So far no spam at all. And users have not noticed any change in the interface. Even the anonymous ones. They're happy and so am I.