-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnofollow.xml
29 lines (28 loc) · 1.07 KB
/
nofollow.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>vbgamer45:antibotjoin</id>
<version>1.0</version>
<file name="$sourcedir/Load.php">
<operation>
<search position="replace"><![CDATA[$profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);]]></search>
<add><![CDATA[$profile['signature'] = nofollow(parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']));]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[?>]]></search>
<add><![CDATA[
function nofollow($html, $skip = null) {
return preg_replace_callback(
"#(<a[^>]+?)>#is", function ($mach) use ($skip) {
return (
!($skip && strpos($mach[1], $skip) !== false) &&
strpos($mach[1], 'rel=') === false
) ? $mach[1] . ' rel="nofollow">' : $mach[0];
},
$html
);
}
?>]]></add>
</operation>
</file>
</modification>