GX-Bug #44520 » Janolaw404Fix.patch
src/gm/classes/GMJanolaw.php (revision ) | ||
---|---|---|
172 | 172 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
173 | 173 |
curl_setopt($ch, CURLOPT_TIMEOUT, 2); |
174 | 174 |
$t_content = curl_exec($ch); |
175 |
$info = curl_getinfo($ch); |
|
176 |
$http_status = $info['http_status']; |
|
175 | 177 |
curl_close($ch); |
176 | 178 |
} |
177 | 179 |
elseif(function_exists('file_get_contents')) |
178 | 180 |
{ |
181 |
$headers = get_headers($t_source_url); |
|
182 |
$http_status = substr($headers[0], 9, 3); |
|
179 | 183 |
$t_content = @file_get_contents($t_source_url); |
180 | 184 |
} |
181 | 185 |
|
182 | 186 |
# looking for success |
183 |
if($t_content != false || strlen($t_content) > 100)
|
|
187 |
if($t_content != false || (strlen($t_content) > 100 && $http_status != 200))
|
|
184 | 188 |
{ |
185 | 189 |
# write page content to cache file on success |
186 | 190 |
$fp = fopen($p_cache_file, 'w+'); |