If, however, upgrading is not an option, then you can override those
class files. Here's what worked for me and my unhelpful host.
Before we get started, doing this means any updates to the files in /
system do not carry over to your new copies. After each update you do
to /system you may need to delete and redo these files.
Any time you encounter that sort of PCRE error, copy the file
mentioned from /system/classes to /user/classes.
So what you'd do would be to copy feedbackhandler.php. I've needed to
tweak that one in the past (my host won't update past the 2003
version, leaving me out of the wonderful world of Unicode), and my
tweak was to comment that entire if statement.
/* if ( preg_match( '/^\p{Z}*$/u', $this-
>handler_vars['content'] ) ) {
Session::error( _t( 'Comment contains only
whitespace/empty comment' ) );
Utils::redirect( $post->permalink );
exit();
}
*/
If you're better versed in the regex options, it should be easy enough
to massage that statement. Make sure to comment what you do, so it's
easier to duplicate later.
Here's a better example, perhaps. Because of my aforementioned Unicode
troubles, I also need to tweak posts.php and utils.php (try doing any
search to see if this affects your site), and
posts.php:
/* working line */
preg_match_all( '/(?<=")(\\w[^"]*)(?=")|(\\w+)/',
$paramset['criteria'], $matches );
// /* non working line */
preg_match_all( '/(?<=")([\p{L}\p{N}]+[^"]*)(?=")|([\p{L}\p{N}]+)/u',
$paramset['criteria'], $matches );
utils.php:
/* working line */ $slug= rtrim( strtolower( preg_replace( '/[^a-
z0-9%_\-]+/i', $separator, $string ) ), $separator );
// /* non working line */ $slug=
rtrim( MultiByte::strtolower( preg_replace( '/[^\p{L}\p{N}%_\-]+/u',
$separator, $string ) ), $separator );
You'll either want to use /* comments around the entire old statement
*/ or make sure it doesn't wrap like this probably did here. The rest
of the file leave alone.
It's not exactly elegant, but it's a nice option to have and I'm glad
ringmaster steered me toward it many revisions ago, lest I stop being
able to update.
mikelietz
On Sep 22, 5:56 pm, Chris Meller <[EMAIL PROTECTED]> wrote:
> You still need to upgrade your version of PCRE on the server. Your
> phpinfo still says you're using version 6.
>
> Sent from my iPhone
>
> On Sep 22, 2008, at 4:10 PM, "Michael Heilemann" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > I think I might've brought this up before, but I can't find the
> > answer, so...
> > I activated comments on my site today, and tried a test comments;
> > which yielded this wonderful error:
>
> > Warning: preg_match() [function.preg-match]: Compilation failed:
> > support for \P, \p, and \X has not been compiled at offset 2 in
> > system/classes/feedbackhandler.php line 85
>
> > system/classes/feedbackhandler.php line 85:
> > preg_match( ...1 args... )
> > system/classes/actionhandler.php line 33:
> > FeedbackHandler->act_add_comment( )
> > system/classes/controller.php line 167:
> > ActionHandler->act( ...1 arg... )
> > index.php line 221:
> > Controller::dispatch_request( )
>
> > Any ideas?
> > --
> > Michael Heilemann
> >http://binarybonsai.com
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---