• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Regex for title to url

Robert9

Active member
#1
I have to show some links to the forum while i only knew the title and id of a thread;
i substitute " " with "-";
what else i have to regex, please?

What is the name of the function that makes our lunbks to threads?
I have to do this in perl, so i cant use the function itself, but i would like to know what i have to substitute.
May someone help me out, please?
 

Robert9

Active member
#3
I have translated it in a first step to:

Perl:
$title =~ s/^\s+|\s+$//g;
$title =~ s/\s+/-/g;
$title =~ tr/`!"'$%^&*()-+={}[]<>;:@#~,.\/?|//; 
$title =~ tr/\r\n\t\\//; 
$title =~ tr/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;