X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..78ff9d91a14da1f53bd3f1ffcab1264d92359b72:/wp-includes/class-snoopy.php diff --git a/wp-includes/class-snoopy.php b/wp-includes/class-snoopy.php index 9e60206d..2c59c481 100644 --- a/wp-includes/class-snoopy.php +++ b/wp-includes/class-snoopy.php @@ -1,11 +1,17 @@ -Copyright (c): 1999-2000 ispi, all rights reserved -Version: 1.01 +Copyright (c): 1999-2008 New Digital Group, all rights reserved +Version: 1.2.4 * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,20 +28,13 @@ Version: 1.01 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA You may contact the author of Snoopy by e-mail at: -monte@ispi.net - -Or, write to: -Monte Ohrt -CTO, ispi -237 S. 70th suite 220 -Lincoln, NE 68510 +monte@ohrt.com The latest version of Snoopy can be obtained from: http://snoopy.sourceforge.net/ *************************************************/ -if ( !in_array('Snoopy', get_declared_classes() ) ) : class Snoopy { /**** Public variables ****/ @@ -49,7 +48,7 @@ class Snoopy var $proxy_user = ""; // proxy user to use var $proxy_pass = ""; // proxy password to use - var $agent = "Snoopy v1.2.3"; // agent we masquerade as + var $agent = "Snoopy v1.2.4"; // agent we masquerade as var $referer = ""; // referer info to pass var $cookies = array(); // array of cookies to pass // $cookies["username"]="joe"; @@ -78,7 +77,7 @@ class Snoopy var $error = ""; // error messages sent here var $response_code = ""; // response code returned from server var $headers = array(); // headers returned from server sent here - var $maxlength = 8192; // max return data length (body) + var $maxlength = 500000; // max return data length (body) var $read_timeout = 0; // timeout on read operations, in seconds // supported only since PHP 4 Beta 4 // set to 0 to disallow timeouts @@ -720,13 +719,13 @@ class Snoopy chr(176), chr(39), chr(128), - "ä", - "ö", - "ü", - "Ä", - "Ö", - "Ü", - "ß", + chr(0xE4), // ANSI ä + chr(0xF6), // ANSI ö + chr(0xFC), // ANSI ü + chr(0xC4), // ANSI Ä + chr(0xD6), // ANSI Ö + chr(0xDC), // ANSI Ü + chr(0xDF), // ANSI ß ); $text = preg_replace($search,$replace,$document); @@ -911,7 +910,7 @@ class Snoopy return false; } - // check if there is a a redirect meta tag + // check if there is a redirect meta tag if(preg_match("']*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) @@ -1011,10 +1010,9 @@ class Snoopy if($this->read_timeout > 0) $cmdline_params .= " -m ".$this->read_timeout; - $headerfile = tempnam($temp_dir, "sno"); + $headerfile = tempnam($this->temp_dir, "sno"); - $safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access - exec(escapeshellcmd($this->curl_path." -D \"$headerfile\"".$cmdline_params." \"".$safer_URI."\""),$results,$return); + exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return); if($return) { @@ -1059,7 +1057,7 @@ class Snoopy $this->headers[] = $result_headers[$currentHeader]; } - // check if there is a a redirect meta tag + // check if there is a redirect meta tag if(preg_match("']*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) { @@ -1238,9 +1236,7 @@ class Snoopy if (!is_readable($file_name)) continue; $fp = fopen($file_name, "r"); - while (!feof($fp)) { - $file_content .= fread($fp, filesize($file_name)); - } + $file_content = fread($fp, filesize($file_name)); fclose($fp); $base_name = basename($file_name); @@ -1257,5 +1253,4 @@ class Snoopy } } endif; - ?>