Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- //open mailman.class.php
- /*
- find this function below:
- function fetch ($url) {^M
- return file_get_contents($url);^M
- }
- replace with the following functon: */
- function fetch($url)
- {
- if (function_exists('curl_init') AND $c=curl_init())
- {
- curl_setopt($c, CURLOPT_URL, $url );
- curl_setopt($c, CURLOPT_HEADER, false );
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true );
- curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 6 ); //wait 4 seconds, or use CURLOPT_CONNECTTIMEOUT_MS
- curl_setopt($c, CURLOPT_TIMEOUT, 8 ); //maximum execution time for the CURL function
- curl_setopt($c, CURLOPT_FORBID_REUSE, true );
- curl_setopt($c, CURLOPT_FRESH_CONNECT, true );
- curl_setopt($c, CURLOPT_USERAGENT, filter_input(
- INPUT_SERVER,
- 'HTTP_USER_AGENT',
- FILTER_SANITIZE_STRING,
- FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH
- ));
- curl_setopt($c, CURLOPT_HTTPHEADER, array(
- 'http_x_forwarded_for: '.
- filter_input(
- INPUT_SERVER,
- 'REMOTE_ADDR',
- FILTER_VALIDATE_IP
- )
- ));
- curl_setopt($c, CURLOPT_CUSTOMREQUEST, 'GET' );
- $data = curl_exec($c);
- curl_close($c);
- if (is_string($data))
- return $data;
- else
- return false;
- }
- elseif
- ( //for security reasons, many people disable url_fopen (some disable complete
- //functions in php.ini via disable_functions = ....).
- function_exists('file_get_contents') AND
- function_exists('ini_get') AND //some security DICKS disable
- //this function. so annoying..
- ini_get('allow_url_fopen')=='on' //file_get_contents only works
- //when url_fopen is allowed
- )
- {
- return file_get_contents($url);
- }
- else
- {
- return false;
- }
- }
- //below is a test function
- //echo fetch('http://www.facebook.com');
- /* DONE!!!!!
- Now it should be possible to access the MM
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment