git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
issue/activity: group replies by message topic
[minimedit.git]
/
error.inc.php
diff --git
a/error.inc.php
b/error.inc.php
index faa71905a3dc3d7061570f963d6b6ce0b9bac91a..4dbdbe45604dcb7ff43556f86dc07b9c43e2c657 100644
(file)
--- a/
error.inc.php
+++ b/
error.inc.php
@@
-1,9
+1,17
@@
<?php
# custom error handling for MinimEdit
<?php
# custom error handling for MinimEdit
-function abort($body, $status = NULL)
+function abort($body,
string
$status = NULL)
{
{
- if ($status) header("HTTP/1.1 $status");
+ if ($status) {
+ header("HTTP/1.1 $status");
+ if ($status[0] === '3') {
+ # redirection (body specifies target)
+ header("Location: $body");
+ exit;
+ }
+ }
+ header('Content-Type: text/plain; charset=utf-8');
print "$body\n";
exit;
}
print "$body\n";
exit;
}