Update webpagetool.php

This commit is contained in:
Namhyeon Go 2018-03-11 02:06:05 +09:00 committed by GitHub
parent 72f0bad418
commit f73baa6165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,7 @@ if(!function_exists("get_web_json")) {
$doc = array(); $doc = array();
$raw = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out); $raw = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out);
if($doc['size'] > 0) { if($raw['size'] > 0) {
$doc = json_decode($raw); $doc = json_decode($raw);
} }
@ -81,9 +81,9 @@ if(!function_exists("get_web_dom")) {
$raw = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out); $raw = get_web_page($url, $method, $data, $proxy, $ua, $ct_out, $t_out);
// load simple_html_dom // load simple_html_dom
loadHelper("simple_html_dom"); if($raw['size'] > 0) {
if(function_exists("str_get_html")) { loadHelper("simple_html_dom");
$html = str_get_html($raw); $html = function_exists("str_get_html") ? str_get_html($raw) : $html;
} }
return $html; return $html;