use the response
authorMichael Wallner <mike@php.net>
Tue, 5 Nov 2013 14:22:29 +0000 (15:22 +0100)
committerMichael Wallner <mike@php.net>
Tue, 5 Nov 2013 14:22:29 +0000 (15:22 +0100)
index.php

index 1e09d32ae1a2993beaad7aec0547a3829fe1e366..8bc11f7adbcdb36bc7d99f75d2696d8a23cd3706 100644 (file)
--- a/index.php
+++ b/index.php
@@ -189,7 +189,7 @@ function ml($file) {
        }
 }
 
-function md($file) {
+function md($file, $res) {
        $file = rtrim($file, "/");
        if (is_file($file) || is_file($file .= ".md")) {
                $pi = pathinfo($file);
@@ -209,7 +209,7 @@ function md($file) {
                        break;
                }
        } else {
-               http\Env::setResponseCode(404);
+               $res->setResponseCode(404);
                printf("<h1>Not Found</h1>\n");
                printf("<blockquote><p>Sorry, I could not find <code>%s/%s</code>.</p></blockquote>", dirname($file), basename($file, ".md"));
        }
@@ -267,7 +267,7 @@ ob_start($s);
                        ob_end_flush();
                ?></pre>
        <?php else: ?>
-               <?php if (!md($p)): ?>
+               <?php if (!md($p, $s)): ?>
                <?php endif; ?>
        <?php endif; ?>
        <footer>