Vladimir’s WordPress Forum


 
Current User: Guest
Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

it doesn't work for cyrillic

Add a New Topic Reply to Post
UserPost

5:30
3 August, 2009


Niki Koev

Guest

Hey Vladimir, it seems the smart links doesn't work with cyrilic letters… How much it will cost to modify that for me?
You did a great tool!
Cool10x!

21:09
21 November, 2010


Hristofor Lukanov

Guest

Hi there. I found out the problem with cyrilics. The problem is in the regular expression matching the keywords.

The problem is here:

$reg = $options['casesens'] ? '/(?!(?:[^<\[]+[>\]]|[^>\]]+<\/a>))\b($name)\b/msU' : '/(?!(?:[^<\[]+[>\]]|[^>\]]+<\/a>))($name)\b/imsU';

The \b matches at a position that is called a "word boundary". It is not designed to work with cyrilics, so you may replace the row with:

$reg = $options['casesens'] ? '/(?!(?:[^<\[]+[>\]]|[^>\]]+<\/a>)[^a-zA-Zа-яА-Я0-9_])($name)([^a-zA-Zа-яА-Я0-9_])/msU' : '/(?!(?:[^<\[]+[>\]]|[^>\]]+<\/a>)[^a-zA-Zа-яА-Я0-9_])($name)([^a-zA-Zа-яА-Я0-9_])/imsU';

You also need to change this row:

$replace="<a title=\"$1\" href=\"$url\">$1</a>";

to

$replace="<a title=\"$1\" href=\"$url\">$1</a>$2";

12:30
22 November, 2010


Vladimir

Admin

posts 707

Seo Smart Links2 will feature full support for UTF8, dont worry about it :)

15:19
18 February, 2011


Fking

Guest

Can someone confirm if the above fix works as supposed?
Any info on when to expect the update would be appreciated as well :)

22:53
19 February, 2011


Vladimir

Admin

posts 707

Yep this is added to the premium version as many others features too

http://www.prelovac.com/produc…..mart-links

Reply to Post

Reply to Topic:
it doesn't work for cyrillic

Guest Name (Required):

Guest Email (Required):

HTML Editor
Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
3 + 7