• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Censor error

When I set up some censor words and try to start a new thread I get an error message along the lines of:

"Server error please try again later".

When I view the error log I see:

ErrorException: preg_replace(): Compilation failed: unknown option bit(s) set at offset 0 - library/XenForo/Helper/String.php:109

#0 [internal function]: XenForo_Application::handlePhpError(2, 'preg_replace():...', '/var/www/html/l...', 109, Array)
#1 /var/www/html/library/XenForo/Helper/String.php(109): preg_replace(Array, Array, 'This is a test ...')
#2 /var/www/html/library/XenForo/BbCode/Formatter/Base.php(692): XenForo_Helper_String::censorString('This is a test ...')
#3 /var/www/html/library/XenForo/BbCode/Formatter/Base.php(488): XenForo_BbCode_Formatter_Base->filterString('This is a test ...', Array)
#4 /var/www/html/library/XenForo/BbCode/Formatter/Base.php(467): XenForo_BbCode_Formatter_Base->renderString('This is a test ...', Array, 0)
#5 /var/www/html/library/XenForo/BbCode/Formatter/Base.php(444): XenForo_BbCode_Formatter_Base->renderTreeElement('This is a test ...', Array, 0)
#6 /var/www/html/library/XenForo/BbCode/Formatter/Base.php(424): XenForo_BbCode_Formatter_Base->renderSubTree(Array, Array)
#7 /var/www/html/library/XenForo/BbCode/Parser.php(503): XenForo_BbCode_Formatter_Base->renderTree(Array, Array)
#8 /var/www/html/library/XenForo/DataWriter/DiscussionMessage.php(361): XenForo_BbCode_Parser->render('This is a test ...')
#9 /var/www/html/library/XenForo/DataWriter/DiscussionMessage.php(321): XenForo_DataWriter_DiscussionMessage->_checkMessageValidity()
#10 /var/www/html/library/XenForo/DataWriter.php(1422): XenForo_DataWriter_DiscussionMessage->_preSave()
#11 /var/www/html/library/XenForo/DataWriter/Discussion.php(323): XenForo_DataWriter->preSave()
#12 /var/www/html/library/XenForo/DataWriter/Discussion.php(291): XenForo_DataWriter_Discussion->_preSaveFirstMessageDw()
#13 /var/www/html/library/XenForo/DataWriter.php(1422): XenForo_DataWriter_Discussion->_preSave()
#14 /var/www/html/library/XenForo/ControllerPublic/Forum.php(442): XenForo_DataWriter->preSave()
#15 /var/www/html/library/XenForo/FrontController.php(310): XenForo_ControllerPublic_Forum->actionAddThread()
#16 /var/www/html/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#17 /var/www/html/index.php(13): XenForo_FrontController->run()
#18 {main}
I deleted my censor words and all was well. Perhaps censorship, even of hate words and profanity is a bad thing but if anyone can suggest a solution to this error I would be grateful as there are some things I want to asterix out.


Jake Bunce

XenForo moderator
Staff member
What censored words?

It could be a problem with your PCRE version. I found several Google results to this effect. So a fix you can try is to upgrade your PCRE library in PHP.
Yum says:
Package pcre-7.8-4.el6.x86_64 already installed and latest version

I'm just going to look at my Nginx config files following a post on another thread by Floren.

Hi Jake,

If I put anything in options>>censoring I get this error.
I have Nginx and php-fpm installed. php-fpm has PCRE support and I have the latest PCRE libraries. I'm starting to think that the PCRE location is not being found.

I feel like I keep climbing ladders and then slipping down geasy poles on this server setup.

info.php reports

PHP 5.3.14
PCRE Library Version 7.8 2008-09-05

I see that 8.11 is bundled with PHP 5.3.6. I'll investigate further tomorrow.

Many thanks
Hi Jake,

Just to close this off. The yum repo's latest version of the PCRE libraries was 7.8
I searched the axivo repo and found there's was 8.2.1 and I was able to install that. Everything works fine now.