HeyMan
HeyMan
2008 5 0

关于外链

我看了下common的url有对连接 加了rel="nofollow" 和新窗口打开的代码 ,但是发现实际好像没有效果 的?
不知道主站会不会这样
https://www.youbbs.org/newpost/1

0

See Also

Nearby


Discussion (5)

HeyMan
HeyMan 2017-10-31 08:54

这里不会,好奇怪 .
文件原始代码为

  if(strpos($text, 'http') !== false){
		$text = ' ' . $text;
        $text = preg_replace(
            '`([^"=\'>])((http|https|ftp)://[^\s<]+[^\s<\.)])`i',
            '$1<a href="$2" target="_blank" rel="nofollow">$2</a>',
            $text
        );
        $text = substr($text, 1);
0
ego008
ego008 2017-10-31 11:25

正常替换

0
HeyMan
HeyMan 2017-10-31 15:47

@ego008 正常替换?什么意思 ?

0
ego008
ego008 2017-11-01 01:00

@HeyMan 如果网址能匹配上就会变成带rel、target属性的链接。

0
HeyMan
HeyMan 2017-11-01 01:31

@ego008 换一个虚拟空间就好了,阿里云空间问题

0
Login Topics