Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Error in the Apache Log: Mentions plugin
Avatar
Blaise F
Rookie
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 4, 2019 - 11:24 am

Hi,

I am getting the following error in my apache error log:

mod_fcgid: stderr: PHP Warning - preg_match_all(): Compilation failed: invalid range in character class at offset 7 - file: /forum-plugins/mentions/library/sp-mentions-components.php - line: 18 - function: preg_match_all.

Line 18 in bold below:

function sp_mentions_find_mentions($content) {
preg_match_all('/\B@([\w-\.]+)\b/', $content, $matches);
if ($matches) {
$names = $matches[1];
} else {
$names = array();
}

return $names;
}

Avatar
Blaise F
Rookie
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 4, 2019 - 11:25 am

This is due to php 7.3

I had this problem in different areas of my site.

I solved this with your plugin by changing line 18 as follows (there is 1 tiny change hard to spot: an extra /)

preg_match_all('/\B@([\w\-\.]+)\b/', $content, $matches);

Avatar
Simple Press
Admin
sp_UserOfflineSmall Offline
Nov 4, 2019 - 11:52 am

Hi:

Thanks - we'll take a look at it and push an update if necessary.

One thing to look for is to see if the change causes a "compilation failed: invalid range" message.  

Thanks.

Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Mar 24, 2020 - 10:19 am

Hi,

Has my fix been integrated in the plugin? The fix solves the errors in the logs and does not create additional errors.

thanks

Avatar
SP Community Support
SP Moderator
sp_UserOfflineSmall Offline
Mar 25, 2020 - 1:17 pm

Hi:

Version 3.1.1 should have resolved this issue. If you install the premium installer (available from your account downloads if you don't already have it), it should give you the latest version automatically.

Thanks.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17344
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79600