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
Disallowed Charachters in Auto Linking Keywords
Avatar
jim
Here and Now
Member
Pro Subscribers
sp_UserOfflineSmall Offline
May 10, 2016 - 11:05 am

Consider this more of an FYI for anyone using the Auto Linking plugin, and a suggestion to edit the Help text on that admin pane...

I panicked when our forums imploded this morning with numerous preg_replace() warnings. Then I read the alert more closely and realized it must be related to the keywords I had just added for auto-linking: (CCRT/CCRP)

Thinking the parentheses were causing problems I removed those, unnecessary to link anyway. The Warning persisted, until I removed the slash. Changing the keyphrase to "CCRT or CCRP" (sans quotes) did the trick.

So, this got me thinking. There are obviously certain characters not allowable in keywords for the Auto Linking plugin. So I checked the Help text in the SP Auto Linking admin and there is no such list.

The easiest way to address this seems to simply edit the the Auto Linking details and/or Help text by adding a list of characters that users should not include in their keywords.

For now, out of curiosity, what might those characters be?

While I was editing the keywords I noticed the Case Sensitive details. It looks like we can now override case sensitivity with a % symbol. Cool! I don't recall seeing that before, as we had to create multiple variations of certain phrases (upper and lower case) to get them all auto linking. But I soon realized the whole phrase should be prefixed with % - not just the particular word within the phrase.

So, perhaps the edited details might include something like:

Keywords list - words to be replaced in post:

Enter keywords one per line - there must be a corresponding entry in replacement urls to right.

Keywords can be a single word or a multi-word string to be matched in post content. See Help text for list of disallowed characters.

Replacements are case-sensitive. For case insensitive replacements prefix word or phrase with a % symbol.

Hope this helps anyone researching that scary preg_replace warning. Gotta love it when the fix is as simple as this! cool

preg_replace-1.pngImage Enlargerpreg_replace-2.pngImage Enlarger

TripawdsSimple:Press powers the Tripawds Discussion Forums.

It's better to hop on three legs than to limp on four.

The Tripawds Blogs Community is made possible by The Tripawds Foundation.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2016 - 11:25 am

Oh well found Jim. Or perhaps I should say well-dealt with.

@mr-papa  is our regex guy. I just find it scary 🙂 I am going to open a ticket on this as there may well be other characters that could mess with this and t's a good point about dealign with it in some useful way. Thanks for the find and the help as always

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 10, 2016 - 4:55 pm

Color me scared too. And not sure how I got Labelled the regex guy!  🙂

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2016 - 5:03 pm

Someone has to be the 'Regex Guy' and it sure ain't me 🙂 You're the nearest we've got!

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 10, 2016 - 11:38 pm

embarassedeek

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: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625