开源DIGG软件PBDigg2.0的修改(六):让“内容原文地址”可以输入别的内容

把 include/postnew.inc.php里的
preg_match('#^(https?|ftp|gopher|news|telnet|mms|rtsp):\/\/([^\/]*)#i', $fsession['source'], $linkhost);
$linkhost = addslashes(HConvert($linkhost[2]));
改成
//preg_match('#^(https?|ftp|gopher|news|telnet|mms|rtsp):\/\/([^\/]*)#i', $fsession['source'], $linkhost);
$linkhost = HConvert($fsession['source']);

然后把
$source && ($ck = checkURL($source)) && showMsg($ck);
改成
//$source && ($ck = checkURL($source)) && showMsg($ck);

这样子,提交的“内容原地址”就可以输入别的内容,不限于只能输入网址了。

不过这里没有加入安全过滤(就是这句 $linkhost = $fsession['source']; ),我不知道怎么加,这个有请管理员给我们补充一下吧。

posted @ 2011-12-25 17:54  忧国忧铭  Views(241)  Comments(0Edit  收藏  举报