git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
page: api attribute indicate index requests
[minimedit.git]
/
error.inc.php
diff --git
a/error.inc.php
b/error.inc.php
index faa71905a3dc3d7061570f963d6b6ce0b9bac91a..a9669c4fc85d60152e4768fd107aac403b0f1c8d 100644
(file)
--- a/
error.inc.php
+++ b/
error.inc.php
@@
-1,9
+1,16
@@
<?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;
+ }
+ }
print "$body\n";
exit;
}
print "$body\n";
exit;
}