X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=doc%2Fwebserver%2Factions%2Fstep2.php;h=9020ffdbfa2b222854885ae8dd373533eb1578a6;hb=3f1c58c1007431cb91537a50989c95adcdaecdc2;hp=0a4d36bc17e047200730761665fe5739079f13f8;hpb=d9c1527acf72a0e83fe3dccaf2fe8467b41a5e49;p=privoxy.git diff --git a/doc/webserver/actions/step2.php b/doc/webserver/actions/step2.php index 0a4d36bc..9020ffdb 100644 --- a/doc/webserver/actions/step2.php +++ b/doc/webserver/actions/step2.php @@ -1,95 +1,166 @@ - + + + + + + + + + +Invalid Feedback Submission - - -

Invalid Feedback Submission

-

When submitting your feedback please start with - step 1.

- - "); + echo (" Invalid Feedback Submission + + +
Invalid Feedback Submission
+
+
When submitting your feedback please start with + step 1. +
+
+ + \n"); exit; } + /* * Cannot work on unknown problem: */ if (!isset($problem) || $problem == "INVALID") { - echo ("Invalid Feedback Submission - - -

Invalid Feedback Submission

-

You need to select the nature of the problem in - step 1.

- - "); + echo (" Invalid Feedback Submission + + +
Invalid Feedback Submission
+
+
You need to select the nature of the problem in + step 1. +
+
+ + \n"); exit; } /* * Check if URL really exists and buffer its contents: + * + * FIXME: Curl is not installed on SF; Filed as Alexandria + * Feature Request #537014. + * PHP's fopen() supports URLs, but it seems that + * curls options for Timeouts and HTTP error handling + * are not supported by fopen(). */ - $ch = curl_init ($referrer_url); + curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_FAILONERROR, 1); +curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); +curl_setopt ($ch, CURLOPT_TIMEOUT, 20); ob_start(); $success = curl_exec ($ch); @@ -100,20 +171,25 @@ curl_close ($ch); if (!$success) { - echo ("Invalid Feedback Submission - - -

Invalid Feedback Submission

-

The URL that you entered ($referrer_url) -
could not be retrieved.

-

Make sure the URL is correct and publicly accessible.

-

Back to step 1

- - - "); + echo (" Invalid Feedback Submission + + +
Invalid Feedback Submission
+
+
+

The URL that you entered ($referrer_url) +
could not be retrieved. +

+

Make sure the URL is correct and publicly accessible.

+

Back to step 1

+
+
+ + \n"); exit; } + /* * Create description from problem code: */ @@ -129,47 +205,88 @@ switch($problem) ?> - - - Privoxy Action List Feedback - Step 2 of 2 - - - -

Privoxy Action List Feedback - Step 2 of 2

-

-You are about to report that -
on . -

+ Privoxy Action List Feedback - Step 2 of 2 + + +
Privoxy Action List Feedback - Step 2 of 2
-

-

+
+ You are about to report that on + . +
- - +
+ +

+ + +

-
+
]*?src=[\'"]?(.*?)[\'" >]|i', $page, $matches); - $count = count($matches[0]); + $image_urls = array_values(array_unique($matches[1])); + $count = count($image_urls); + if ($count > 0) { - $referrer_base = substr($referrer_url, 0, -strpos(strrev($referrer_url), '/')); + /* + * Base URL ends in slash: don't touch. + */ + if (strpos(strrev($referrer_url), '/') == 0) + { + $referrer_base = $referrer_url; + } + /* + * Else grab URL up to last slash as base. + */ + else + { + $referrer_base = substr($referrer_url, 0, -strpos(strrev($referrer_url), '/')); + } + + /* + * Get the protocol + host info for relative links + * that start with slash. FIXME: Cut trailing slash off! + */ $referrer_host = "http://".strrev(strrchr(strrev(substr($referrer_url, 7)), "/")); - echo ("
Choose the images to be blocked from the following list:

\n"); - echo ("\n"); - echo ("\n"); - for ($i=0; $i< $count; $i++) { - $image_url = $matches[1][$i]; + /* + * Open section in
; Open table: + */ + echo ("
Choose the images you want blocked from the following list:
+
+

+ +

\n"); + /* + * Print one table row for each image found: + */ + for ($i=0; $i< $count; $i++) + { + $image_url = $image_urls[$i]; + + /* + * Make image URLs absolute: + */ if (strncmp("http://", $image_url, 7)) { if ($image_url{0} == "/") @@ -181,66 +298,105 @@ else $image_url = $referrer_base.$image_url; } } - echo ("\n"); - echo ("\n"); - echo ("\n"); - echo ("\n"); + + /* + * Print the row(s): + */ + echo (" + + + + + + + \n"); } - echo ("
$image_url:
+ + + $image_url: + + +
+ \"banner +

If the banner that you saw is not listed above, enter the URL here\n"); + echo (" + + +
+ If the banner that you saw is not listed above, enter the URL here\n"); } else { - echo ("
URL of the advertisment image:\n"); + echo ("
+ URL of the advertisment image:\n"); } } ?> -
Hint: right-click the image, select "Copy image location" and paste the URL here.
-
-

-
+
Hint: right-click the image, select "Copy image location" and paste the URL here. + +
+

+ +

+
+ ") ?> -
URL of the innocent image: -
Hint: right-click the image, select "Copy image location" and paste the URL here. -
This may not work if the image was blocked by size or if +image-blocker is set to redirect.
-
-

-
-") ?> +
+

URL of the innocent image: +
Hint: right-click the image, select "Copy image location" and paste the URL here. +
This may not work if the image was blocked by size or if +image-blocker is set to redirect.
+

+
+
+

+ +

+
+ +") ?> -
Severity:
-
-

- -

-
- -
Remarks: (optional)
-
-

-
- -
Your Name: (optional)
-
-

-
- -
 
-
- -
- -
- -

- - +
Severity:
+
+

+ +

+
+ +
+ Remarks: (optional) +
+
+

+ +

+
+ +
+ Your Name: (optional) +
+
+

+ +

+
+ +
 
+
+ +
+ +
+ +
+ +