[b]问题:[/b]
在后以添加新闻资讯时有一个填写外部链接,但是如果填写了url地址后,有些字符会被转义了,比如在后台新闻添加链接http://www.ziyou001.com/home/space.php?do=event&id=70之后呢,地址中的&会被自动转义成了&于是点击新闻就进入了http://www.ziyou001.com/home/space.php?do=event&id=70
[b]解决方法:[/b]
根目录下viewnews.php中查找
if(!empty($news['newsurl'])) {
sheader($news['newsurl']);
}
更改为:
if(!empty($news['newsurl'])) {
//sheader(shtmlspecialchars($news['newsurl']));//该函数不能用
sheader(html_entity_decode($news['newsurl']));
// 还有一个函数htmlspecialchars_decode() 没测试 ()两个函数用来将html实体转换成字符
}
==================================================================
==================================================================
以下内容未测试
改进supesite开启简短url链接时转义非本站url的方法
介绍一下,改进supesite开启简短url链接时转义非本站url的方法
问题描述:
当supesite开启简短url链接时,supesite程序会转义页面中所有合乎规则的url
例如页面中包含的链接
http://www.xxx.com/?action-viewnews-itemid-63 转义为 http://www.xxx.com/?viewnews-63
http://www.abc.com/?aaa=bbb 转义为 http://www.xxx.com/?aaa=bbb (这不是我们所期望的结果)
改进方法:
修改function/common_func.php文件
查找$preg_searchs[] = "/href\=\"\S*?\/(index\.php)?\?(\S+?)\"/ie"; 替换为//http:\/\/www\.xxx\.com 替换为您网站相应的名字
$preg_searchs[] = "/href\=\"\http:\/\/www\.xxx\.com\/(index\.php)?\?(\S+?)\"/ie"; ok,这样就supesite就只会替换自身网站的内容了
在后以添加新闻资讯时有一个填写外部链接,但是如果填写了url地址后,有些字符会被转义了,比如在后台新闻添加链接http://www.ziyou001.com/home/space.php?do=event&id=70之后呢,地址中的&会被自动转义成了&于是点击新闻就进入了http://www.ziyou001.com/home/space.php?do=event&id=70
[b]解决方法:[/b]
根目录下viewnews.php中查找
if(!empty($news['newsurl'])) {
sheader($news['newsurl']);
}
更改为:
if(!empty($news['newsurl'])) {
//sheader(shtmlspecialchars($news['newsurl']));//该函数不能用
sheader(html_entity_decode($news['newsurl']));
// 还有一个函数htmlspecialchars_decode() 没测试 ()两个函数用来将html实体转换成字符
}
==================================================================
==================================================================
以下内容未测试
改进supesite开启简短url链接时转义非本站url的方法
介绍一下,改进supesite开启简短url链接时转义非本站url的方法
问题描述:
当supesite开启简短url链接时,supesite程序会转义页面中所有合乎规则的url
例如页面中包含的链接
http://www.xxx.com/?action-viewnews-itemid-63 转义为 http://www.xxx.com/?viewnews-63
http://www.abc.com/?aaa=bbb 转义为 http://www.xxx.com/?aaa=bbb (这不是我们所期望的结果)
改进方法:
修改function/common_func.php文件
查找$preg_searchs[] = "/href\=\"\S*?\/(index\.php)?\?(\S+?)\"/ie"; 替换为//http:\/\/www\.xxx\.com 替换为您网站相应的名字
$preg_searchs[] = "/href\=\"\http:\/\/www\.xxx\.com\/(index\.php)?\?(\S+?)\"/ie"; ok,这样就supesite就只会替换自身网站的内容了