Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-6667 now.

Word censoring doesn't support unicode strings. (fix completed in vcs)

For now there's no 3.0.0 version in the list, so I post the ticket as for RC8 ;)
Word censorind for UTF-8 doesnt't work properly because of the following string in includes/utf/utf_tools.php
Code: Select all
setlocale(LC_CTYPE, 'C');


Ugly example script with latin and russian words is in attachment (претест is the russian for pretest).
censor.php (623 Bytes)

Comments / History

Edited ticket

Action performed by rxu (Development Team Member) on Dec 14th 2007, 13:47

Edited ticket

Action performed by rxu (Development Team Member) on Dec 14th 2007, 13:48

Edited ticket

Action performed by rxu (Development Team Member) on Dec 14th 2007, 14:33

Posted by rxu (Development Team Member) on Dec 14th 2007, 15:47

Thanks to DavidMJ, the things is clear now.

Posted by rxu (Development Team Member) on Mar 16th 2008, 13:45

We could at least to make the things better for users having PHP version between 4.4.0 and 5.0.0-dev and 5.1.0 or higher ;)
Code: Select all
OPEN
includes/cache.php

FIND
            $censors['match'][] = '#(?<!\w)(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')(?!\w)#i';

REPLACE WITH
      if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false)
            {
               $censors['match'][] = '#(?<!\p{L})(' . str_replace('\*', '\p{L}*?', preg_quote($row['word'], '#')) . ')(?!\p{L})#u';
            }
            else
            {
            $censors['match'][] = '#(?<!\w)(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')(?!\w)#i';
            }

Assigned ticket to user "rxu"

Action performed by rxu (Development Team Member) on Jun 17th 2009, 16:47

Changed ticket status from "New" to "Fix in progress"

Action performed by rxu (Development Team Member) on Jun 17th 2009, 16:47

Linked ticket with changeset: r9624

Action performed by rxu (Development Team Member) on Jun 18th 2009, 23:21

Changed ticket status from "Fix in progress" to "Fix completed in SVN"

Action performed by rxu (Development Team Member) on Jun 18th 2009, 23:22

Ticket details

Related SVN changesets