CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • function.grep-replace Converter.php errors
Pages: [1]

Author Topic: function.grep-replace Converter.php errors  (Read 6436 times)

GSterr

  • Guest
function.grep-replace Converter.php errors
August 30, 2008, 12:09:33 am
Hi guys, bit of help required if possible. I am getting the errors pasted below at the top of each page in a pink box


    * warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 6 in /home/sites/mywebsite.org.uk/public_html/cms/sites/all/modules/civicrm/packages/IDS/Converter.php on line 571.
    * warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 6 in /home/sites/mywebsite.org.uk/public_html/cms/sites/all/modules/civicrm/packages/IDS/Converter.php on line 553.
    * warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 6 in /home/sites/mywebsite.org.uk/public_html/cms/sites/all/modules/civicrm/packages/IDS/Converter.php on line 571.
    * warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 6 in /home/sites/mywebsite.org.uk/public_html/cms/sites/all/modules/civicrm/packages/IDS/Converter.php on line 553.
    * warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 6 in /home/sites/mywebsite.org.uk/public_html/cms/sites/all/modules/civicrm/packages/IDS/Converter.php on line 571.


These appear on each CiviCRM page on the admin pages. There can be a list of 4 errors up to about 20, but they are the same 2 line numbers.
It doesn't seem to cause any noticeable interference with the admin side of things, although in the background there maybe something I have missed.

This is a completely clean Drupal installation. I reinstalled this for the second time as it had the same faults the first time round

CiviCRM:     2.1 Alpha 4
CMS:    Drupal 6.4
MySQL:    5.0.67
PHP:    5.2.5

Any suggestions would gratefully received :) Also, I am new to this with a little knowledge, and a little knowledge can be a dangerous thing!

Let me know if more detail is required.

Thanks

G
« Last Edit: August 30, 2008, 09:56:24 am by GSterr »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: function.grep-replace Converter.php errors
August 30, 2008, 12:55:39 am

can u please post a message here: http://forum.php-ids.org/. U might want to try using 2.1beta1 and ensure its not fixed there

we are using php-ids, v0.5.2

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

sypl

  • I post occasionally
  • **
  • Posts: 37
  • Karma: 1
Re: function.grep-replace Converter.php errors
October 07, 2008, 03:27:18 am
Like GSterr, I'm getting lots of errors, such as:

Code: [Select]
# warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 6 in /home/sites/ruralchina.org/public_html/rcef/sites/all/modules/civicrm/packages/IDS/Converter.php on line 553.

# warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 6 in /home/sites/ruralchina.org/public_html/rcef/sites/all/modules/civicrm/packages/IDS/Converter.php on line 571.

Which correspond to the following two lines in Converter.php:

Line 553:
Code: [Select]
$stripped_length = strlen(preg_replace('/[\w\s\p{L}.,\/><]*/ms', null, $tmp_value));
Line 571:
Code: [Select]
// Replace all non-special chars
$converted =  preg_replace('/[\w\s\p{L}]/', null, $value);

And it would seem the problem is that my version of the PCRE is very old: phpinfo tells me it's version 4.5 from 2003. As a consequence it doesn't support unicode characters, meaning \p{L} won't work. It would seem that I need PCRE version 5.1 at least to support this. I'll ask my hosting provider if they can upgrade, but I wouldn't bet on it...

My question is, is there another regular expression that I can use that would be "good enough" and let me run CiviCRM without these ugly error messages? I'm not familiar with regular expressions at all so don't have the know how to do it myself at the moment. And is it a good idea to fudge such a solution, as my site will undoubtedly be using unicode characters (Chinese).

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: function.grep-replace Converter.php errors
October 07, 2008, 05:38:25 am

can u please repost your message here: http://forum.php-ids.org/. They have a much better idea on what can / cannot be done etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

winnjewett

  • Guest
Re: function.grep-replace Converter.php errors
January 25, 2009, 03:47:11 pm
I am now using the production version 5.2.8, and am still experiencing the issues mentioned above.  Has there been any progress on this issue?

Thanks
-Winn

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: function.grep-replace Converter.php errors
January 25, 2009, 05:56:14 pm

can you please raise this issue on the php-ids site

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: function.grep-replace Converter.php errors
January 26, 2009, 04:58:08 am
If you're getting these errors, then the issue is about your installed version of PCRE (the perl regular expression library) not supporting unicode.

I think lobo's pointing you to that site because CiviCRM uses a third party package from them, which is what generates the errors.

The short answer is:

1. you can hack the library to make this work.

2. it's better to upgrade your pcre, though it might not be easier.

Here's a summary of my experience:

http://homeofficekernel.blogspot.com/2009/01/centos4-and-civicrm-21.html

selfuntitled

  • I’m new here
  • *
  • Posts: 16
  • Karma: 2
Re: function.grep-replace Converter.php errors
March 11, 2010, 12:48:15 pm
Here's a duplicate thread with more discussion of this issue.
http://forum.civicrm.org/index.php/topic,9316.0.html

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • function.grep-replace Converter.php errors

This forum was archived on 2017-11-26.