Plugin Directory

Changeset 1319887


Ignore:
Timestamp:
01/02/2016 01:03:10 PM (10 years ago)
Author:
vividlteam
Message:

fix bug

Location:
thunder-port/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • thunder-port/trunk/simple_html_dom.php

    r1319827 r1319887  
    10991099    {
    11001100        $args = func_get_args();
    1101         $this->load(call_user_func_array('file_get_contents', $args), true);
     1101        // $this->load(call_user_func_array('file_get_contents', $args), true);
     1102        $this->load(call_user_func_array('file_get_contents_curl', $args), true);
     1103
    11021104        // Throw an error if we can't properly load the dom.
    11031105        if (($error=error_get_last())!==null) {
  • thunder-port/trunk/thunder_port.php

    r1319884 r1319887  
    1313add_action( 'admin_menu', 'thunderport_add_admin_menu' );
    1414add_action( 'admin_init', 'thunderport_settings_init' );
     15
     16function file_get_contents_curl($url) {
     17    $ch = curl_init();
     18
     19    curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
     20    curl_setopt($ch, CURLOPT_HEADER, 0);
     21    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     22    curl_setopt($ch, CURLOPT_URL, $url);
     23    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);       
     24
     25    $data = curl_exec($ch);
     26    curl_close($ch);
     27
     28    return $data;
     29}
     30
    1531
    1632function curl_file_get_html($base) {
Note: See TracChangeset for help on using the changeset viewer.