Search Results for 'code'
-
Search Results
-
Topic: Keeping spam out of forums
I’m currently using PHPBB for my forum software but I get SO MUCH spam. I’m considering either putting a recaptcha code on there for each post, or I’m looking into other software like bbPress. I love WordPress and so I would really like to use bbPress but I see there is no code that must be entered before posting so I wonder if spam will again be a problem.
What are your thoughts people? How do you control spam in your forums? I’ve had to lock my forums until I get a good solution.
Hi!
I was trying to integrate a bbpress-1.0.2 forum with my existing WP installation and I found a funny bug.
If I open a topic and use the interface right to the title to add a russian-language tag, only the first half of a tag is actually added.
If I try to add a tag “mama” (written in russian, of course. I write here in english just for the english speaking people being able to read the post) only the first half of a tag (“ma”) is actually added. It happens everytime I add a tag with an even number of letters (2, 4, 6, etc). Tags with an odd number of letters are added correctly.
BTW every russian letter in UTF-8 is encoded using exactly two bytes.
Unfortunatelly, I don’t fully understand what the code does and the below is just my guess.
I guess the problem is in file /bb-includes/functions.bb-formatting.php either in function seems_utf8() or in bb_utf8_cut().
Traditionally, strlen() returned 8 for utf-8-encoded “mama”. In such case bb_utf8_cut() would work correct (althought I haven’t actually checked). But if one use php.ini mbstring.func_overload option to overload str* functions by mb_str* ones, then strlen(“mama”) returns 4 and bb_utf8_cut() thinks this’s is non-utf-8-encoded string length and assumes that the “actual” string length would be 2. That’s wrong.
So, my general suggestions is to fix somehow one of those functions to work correctly with mbstring.func_overload both set and unset.
The quick-fix for people having the option set is to add the following line at the very start of bb_utf8_cut() function:
return $utf8_string;1. Am I correct or should I search for the problem in another piece of the system?
2. Would this “fix” break anything else?
