X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=doc%2Fwebserver%2Factions%2Fstep2.php;h=9020ffdbfa2b222854885ae8dd373533eb1578a6;hb=3f1c58c1007431cb91537a50989c95adcdaecdc2;hp=635f1d11175e5fc1dd1f9c7adfbd2df8654015b9;hpb=273aaf5afed7e955586373e2e70fd23e29ce1514;p=privoxy.git diff --git a/doc/webserver/actions/step2.php b/doc/webserver/actions/step2.php index 635f1d11..9020ffdb 100644 --- a/doc/webserver/actions/step2.php +++ b/doc/webserver/actions/step2.php @@ -8,9 +8,12 @@ This file belongs in ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - $Id: step2.php,v 1.1 2002/03/30 03:20:30 oes Exp $ + $Id: step2.php,v 1.4 2002/04/01 19:13:47 oes Exp $ $Log: step2.php,v $ + Revision 1.4 2002/04/01 19:13:47 oes + Extended, fixed bugs, beefed up design, made IE-safe + Revision 1.1 2002/03/30 03:20:30 oes Added Feedback mechanism for actions file @@ -98,12 +101,9 @@ /* * For testing: */ -$base_url = "http://www.oesterhelt.org/actions"; -//$base_url = "http://privoxy.org/actions"; -//$base_url = "http://localhost/actions"; //phpinfo(); -//error_reporting(E_NONE); -error_reporting(E_ALL); +//error_reporting(E_ALL); +error_reporting(E_NONE); /* @@ -159,7 +159,8 @@ $ch = curl_init ($referrer_url); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_FAILONERROR, 1); -curl_setopt ($ch, CURLOPT_TIMEOUT, 15); +curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); +curl_setopt ($ch, CURLOPT_TIMEOUT, 20); ob_start(); $success = curl_exec ($ch); @@ -216,7 +217,7 @@ switch($problem)
-
+

@@ -242,7 +243,9 @@ else * in a table for the user to select */ preg_match_all('|]*?src=[\'"]?(.*?)[\'" >]|i', $page, $matches); - $count = count($matches[0]); + $image_urls = array_values(array_unique($matches[1])); + $count = count($image_urls); + if ($count > 0) { /* @@ -279,7 +282,7 @@ else */ for ($i=0; $i< $count; $i++) { - $image_url = $matches[1][$i]; + $image_url = $image_urls[$i]; /* * Make image URLs absolute: