Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

[Solution] Newsletter Can't Be Sent Due To Php Error Rate Topic   - - - - -

 
  • TurabG
  • Member
  • Members
  • Join Date: 05-Apr 17
  • 47 posts

Posted 08 February 2020 - 03:13 PM #1

Hi,

 

I haven't been able to send newsletters for some time and upgraded the store from 4.6.x to 4.9.3 but the problem didn't go away. I checked the error logs and saw this;

PHP Warning: preg_replace_callback(): Compilation failed: invalid range in character class at offset 37 in /var/www/vhosts/example.com/httpdocs/app/addons/newsletters/func.php on line 117

Appearently, PCRE version has changed in PHP 7.3 and some regular expressions were rendered invalid thereafter.

 

I opened the mentioned file, found this line;

$regex = "/href=('|\")((?:http|ftp|https):\/\/[\w-\.]+[?]?[-\w:\+?\/?\.\=%&;~\[\]]+)/i";

Replaced with;

$regex = "/href=('|\")((?:http|ftp|https):\/\/[\w\-\.]+[?]?[-\w:\+?\/?\.\=%&;~\[\]]+)/i";

As you will notice, I escaped the dash ( - ) because after PHP 7.3, dashes that don't define a range needs to be escaped. Now I can send newsletters.

 

By the way, the same problem effects some other places in CS Cart as well.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21072 posts

Posted 10 February 2020 - 05:36 AM #2

Please post this to the bug tracker so that CS-Cart team pay attention to the issue


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 835 posts

Posted 12 February 2020 - 06:41 PM #3

PHP 7.3 isn't supported by CS-Cart yet


CS-Cart Ultimate ver 4.11.3


 
  • TurabG
  • Member
  • Members
  • Join Date: 05-Apr 17
  • 47 posts

Posted 14 February 2020 - 11:17 AM #4

Seems so; I thought I saw it in the changelog and it turns out that CS Cart supported PHP 7.2 in version 4.9.2 and not PHP 7.3. But it also seems that 4.10.x versions support PHP 7.3. Haven't checked if this compatibility issue is present in 4.10.x yet but according to the 4.10.1 changelog, PHP 7.3 is de facto supported already.