Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-17110 snoopy: imported new version 1.2.4; backported from HEAD

  • Loading branch information...
commit ebad4013c89b5941b96a8fc0ef91ef336980739f 1 parent c1eea39
authored November 03, 2008

Showing 1 changed file with 14 additions and 22 deletions. Show diff stats Hide diff stats

  1. 36  lib/snoopy/Snoopy.class.inc
36  lib/snoopy/Snoopy.class.inc
@@ -4,9 +4,8 @@
4 4
 
5 5
 Snoopy - the PHP net client
6 6
 Author: Monte Ohrt <monte@ispi.net>
7  
-Copyright (c): 1999-2000 ispi, all rights reserved
8  
-Version: 1.01
9  
-(Note: v1.2.3 - var $agent="Snoopy v1.2.3";// agent we masquerade as)
  7
+Copyright (c): 1999-2008 New Digital Group, all rights reserved
  8
+Version: 1.2.4
10 9
 
11 10
  * This library is free software; you can redistribute it and/or
12 11
  * modify it under the terms of the GNU Lesser General Public
@@ -23,13 +22,7 @@ Version: 1.01
23 22
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 23
 
25 24
 You may contact the author of Snoopy by e-mail at:
26  
-monte@ispi.net
27  
-
28  
-Or, write to:
29  
-Monte Ohrt
30  
-CTO, ispi
31  
-237 S. 70th suite 220
32  
-Lincoln, NE 68510
  25
+monte@ohrt.com
33 26
 
34 27
 The latest version of Snoopy can be obtained from:
35 28
 http://snoopy.sourceforge.net/
@@ -49,7 +42,7 @@ class Snoopy
49 42
     var $proxy_user        =    "";                    // proxy user to use
50 43
     var $proxy_pass        =    "";                    // proxy password to use
51 44
     
52  
-    var $agent            =    "Snoopy v1.2.3";    // agent we masquerade as
  45
+    var $agent            =    "Snoopy v1.2.4";    // agent we masquerade as
53 46
     var    $referer        =    "";                    // referer info to pass
54 47
     var $cookies        =    array();            // array of cookies to pass
55 48
                                                 // $cookies["username"]="joe";
@@ -259,7 +252,7 @@ class Snoopy
259 252
                 break;
260 253
             default:
261 254
                 // not a valid protocol
262  
-                $this->error    =    'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
  255
+                $this->error    =    'Invalid protocol "'.$URI_PARTS["scheme"]; // moodlefix
263 256
                 return false;
264 257
                 break;
265 258
         }        
@@ -425,7 +418,7 @@ class Snoopy
425 418
                 
426 419
             default:
427 420
                 // not a valid protocol
428  
-                $this->error    =    'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
  421
+                $this->error    =    'Invalid protocol "'.$URI_PARTS["scheme"]; //moodlefix
429 422
                 return false;
430 423
                 break;
431 424
         }        
@@ -720,13 +713,13 @@ class Snoopy
720 713
                             chr(176),
721 714
                             chr(39),
722 715
                             chr(128),
723  
-                            "ä",
724  
-                            "ö",
725  
-                            "ü",
726  
-                            "Ä",
727  
-                            "Ö",
728  
-                            "Ü",
729  
-                            "ß",
  716
+                            "�",
  717
+                            "�",
  718
+                            "�",
  719
+                            "�",
  720
+                            "�",
  721
+                            "�",
  722
+                            "�",
730 723
                         );
731 724
                     
732 725
         $text = preg_replace($search,$replace,$document);
@@ -1013,8 +1006,7 @@ class Snoopy
1013 1006
         
1014 1007
         $headerfile = tempnam($temp_dir, "sno");
1015 1008
 
1016  
-        $safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access
1017  
-        exec($this->curl_path." -D \"$headerfile\"".$cmdline_params." \"".$safer_URI."\"",$results,$return);
  1009
+        exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return);
1018 1010
         
1019 1011
         if($return)
1020 1012
         {

0 notes on commit ebad401

Please sign in to comment.
Something went wrong with that request. Please try again.