| 1 |
--- ../../php-openid-2.1.0/examples/detect.php 2008-06-06 15:53:44.000000000 -0700 |
|---|
| 2 |
+++ detect.php 2008-06-07 22:10:31.000000000 -0700 |
|---|
| 3 |
@@ -395,6 +395,21 @@ |
|---|
| 4 |
} |
|---|
| 5 |
} |
|---|
| 6 |
|
|---|
| 7 |
+function detect_query_corruption($r, &$out) |
|---|
| 8 |
+{ |
|---|
| 9 |
+ $out .= $r->h2('Query Corruption'); |
|---|
| 10 |
+ if ($_SERVER["QUERY_STRING"]!="test_query=a%26b") |
|---|
| 11 |
+ { |
|---|
| 12 |
+ $out.=$r->p("Your web server seems to corrupt queries. Received ".$_SERVER["QUERY_STRING"].", expected a=%26b. Check for mod_encoding."); |
|---|
| 13 |
+ return false; |
|---|
| 14 |
+ } |
|---|
| 15 |
+ else |
|---|
| 16 |
+ { |
|---|
| 17 |
+ $out.=$r->p("Your web server does not corrupt queries. Good."); |
|---|
| 18 |
+ return true; |
|---|
| 19 |
+ } |
|---|
| 20 |
+} |
|---|
| 21 |
+ |
|---|
| 22 |
function detect_fetcher($r, &$out) |
|---|
| 23 |
{ |
|---|
| 24 |
$out .= $r->h2('HTTP Fetching'); |
|---|
| 25 |
@@ -467,8 +482,12 @@ |
|---|
| 26 |
} |
|---|
| 27 |
|
|---|
| 28 |
header('Content-Type: ' . $r->contentType() . '; charset=us-ascii'); |
|---|
| 29 |
- |
|---|
| 30 |
-$title = 'OpenID Library Support Report'; |
|---|
| 31 |
+if (!$_GET["test_query"]) |
|---|
| 32 |
+{ |
|---|
| 33 |
+ header("Location: ".$_SERVER['PHP_SELF']."?test_query=a%26b"); |
|---|
| 34 |
+} |
|---|
| 35 |
+ |
|---|
| 36 |
+ $title = 'OpenID Library Support Report'; |
|---|
| 37 |
$out = $r->start($title) . |
|---|
| 38 |
$r->h1($title) . |
|---|
| 39 |
$r->p('This script checks your PHP installation to determine if you ' . |
|---|
| 40 |
@@ -492,7 +511,7 @@ |
|---|
| 41 |
$status[] = detect_stores($r, $body); |
|---|
| 42 |
$status[] = detect_fetcher($r, $body); |
|---|
| 43 |
$status[] = detect_xml($r, $body); |
|---|
| 44 |
- |
|---|
| 45 |
+ $status[] = detect_query_corruption($r, $body); |
|---|
| 46 |
$result = true; |
|---|
| 47 |
|
|---|
| 48 |
foreach ($status as $v) { |
|---|