|
@@ -134,6 +134,20 @@ class Index extends Base |
|
@@ -134,6 +134,20 @@ class Index extends Base |
134
|
if(!is_dir(dirname($filename))){
|
134
|
if(!is_dir(dirname($filename))){
|
135
|
mkdir(dirname($filename),0775,true);
|
135
|
mkdir(dirname($filename),0775,true);
|
136
|
}
|
136
|
}
|
|
|
137
|
+
|
|
|
138
|
+ // 是否有第三方连接
|
|
|
139
|
+ if (
|
|
|
140
|
+ preg_match_all(
|
|
|
141
|
+ "/<a[\s\t]*href[\s\t]*=[\s\t]*\"[\s\t]*(http[s]?:\/\/.*)[\s\t]*\"/Ui",
|
|
|
142
|
+ $data['html'],
|
|
|
143
|
+ $urls)
|
|
|
144
|
+ ){
|
|
|
145
|
+ foreach ($urls[1] as $k=>$url){
|
|
|
146
|
+ $_url = str_replace($url,'/redirect-'.urlencode($url),$urls[0][$k]);
|
|
|
147
|
+ $data['html'] = str_replace($urls[0][$k],$_url,$data['html']);
|
|
|
148
|
+ }
|
|
|
149
|
+ }
|
|
|
150
|
+
|
137
|
@file_put_contents($filename,$data['html']);
|
151
|
@file_put_contents($filename,$data['html']);
|
138
|
|
152
|
|
139
|
}
|
153
|
}
|