| 
...
 | 
...
 | 
@@ -134,6 +134,20 @@ class Index extends Base | 
| 
 | 
 | 
             if(!is_dir(dirname($filename))){
 | 
| 
 | 
 | 
                 mkdir(dirname($filename),0775,true);
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             // 是否有第三方连接
 | 
| 
 | 
 | 
             if (
 | 
| 
 | 
 | 
             preg_match_all(
 | 
| 
 | 
 | 
                 "/<a[\s\t]*href[\s\t]*=[\s\t]*\"[\s\t]*(http[s]?:\/\/.*)[\s\t]*\"/Ui",
 | 
| 
 | 
 | 
                 $data['html'],
 | 
| 
 | 
 | 
                 $urls)
 | 
| 
 | 
 | 
             ){
 | 
| 
 | 
 | 
                 foreach ($urls[1] as $k=>$url){
 | 
| 
 | 
 | 
                     $_url = str_replace($url,'/redirect-'.urlencode($url),$urls[0][$k]);
 | 
| 
 | 
 | 
                     $data['html'] = str_replace($urls[0][$k],$_url,$data['html']);
 | 
| 
 | 
 | 
                 }
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             @file_put_contents($filename,$data['html']);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         }
 | 
...
 | 
...
 | 
 |