summaryrefslogtreecommitdiff
path: root/archives
diff options
context:
space:
mode:
authorMhonarc archives guy2012-01-05 13:41:14 +0000
committerAlvaro Herrera2012-01-16 20:42:37 +0000
commit8dc76c9f0397c1cbf888dd3ed65eab606cdfd6a8 (patch)
tree79d90f084cbb88d08e5cb2ec77d67028aa188d6f /archives
parent3feadce0e7865251af875232ce9bb412309a3600 (diff)
Return error code 404 in certain cases
Diffstat (limited to 'archives')
-rw-r--r--archives/html/msgtxt.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/archives/html/msgtxt.php b/archives/html/msgtxt.php
index 86f7a9d3..639c1dfd 100644
--- a/archives/html/msgtxt.php
+++ b/archives/html/msgtxt.php
@@ -7,6 +7,12 @@ $parts = split("@", $id, 2);
header("Content-type: text/plain");
+if (strlen($parts[1]) < 4 || strlen($parts[0]) < 4) {
+ header("Status: 404 probably unindexed message");
+ print "maybe this message is valid, but we don't have it\n";
+ exit;
+}
+
$dir = substr($parts[1], 0, 2) .
"/" .
substr($parts[1], 2, 2) .
@@ -20,6 +26,7 @@ $dir = substr($parts[1], 0, 2) .
$filename= $_SERVER['DOCUMENT_ROOT'] . "/../messages/" . $dir . "/" . $id;
if (!file_exists($filename)) {
+ header("Status: 404 No such Message-Id");
print "No message with Message-Id " . $_GET["id"] ." found\n";
exit;
}