修复后台无法删除的bug

This commit is contained in:
2012-11-28 16:57:22 +08:00
parent 545c03edd7
commit a89fc28bba
3 changed files with 30 additions and 14 deletions

View File

@@ -133,20 +133,21 @@ class lastRSS {
$results = '';
$context = stream_context_create(array(
'http' => array(
'timeout' => 3
'timeout' => 1
)
));
if (get_cfg_var('allow_url_fopen')) {
$f = fopen($url, 'r');
while (!feof($f)) {
if ($f = fopen($url, 'r', false, $context)) {
while (!feof($f)) {
$results .= fgets($f, 4096);
}
fclose($f);
}
} else if (extension_loaded('curl')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP Curl/xiaosong.org 1.0 BETA');
$results = curl_exec($ch);
curl_close($ch);