From 7c09e5d507ca7d8d0ca192b496611439d6ef9e37 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 3 Nov 2008 07:59:06 +0000 Subject: [PATCH] MDL-17110 snoopy: imported new version 1.2.4; backported from HEAD --- lib/snoopy/Snoopy.class.inc | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/lib/snoopy/Snoopy.class.inc b/lib/snoopy/Snoopy.class.inc index 394a3c676d699..9ab7d8e1a268c 100644 --- a/lib/snoopy/Snoopy.class.inc +++ b/lib/snoopy/Snoopy.class.inc @@ -4,9 +4,8 @@ Snoopy - the PHP net client Author: Monte Ohrt -Copyright (c): 1999-2000 ispi, all rights reserved -Version: 1.01 -(Note: v1.2.3 - var $agent="Snoopy v1.2.3";// agent we masquerade as) +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 @@ -23,13 +22,7 @@ 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/ @@ -49,7 +42,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"; @@ -259,7 +252,7 @@ class Snoopy break; default: // not a valid protocol - $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"]; // moodlefix return false; break; } @@ -425,7 +418,7 @@ class Snoopy default: // not a valid protocol - $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"]; //moodlefix return false; break; } @@ -720,13 +713,13 @@ class Snoopy chr(176), chr(39), chr(128), - "ä", - "ö", - "ü", - "Ä", - "Ö", - "Ü", - "ß", + "�", + "�", + "�", + "�", + "�", + "�", + "�", ); $text = preg_replace($search,$replace,$document); @@ -1013,8 +1006,7 @@ class Snoopy $headerfile = tempnam($temp_dir, "sno"); - $safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access - exec($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) {