summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/legacy/files.php6
-rw-r--r--lib/private/legacy/template.php4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php
index 00cd5fbfe51..f4474197d86 100644
--- a/lib/private/legacy/files.php
+++ b/lib/private/legacy/files.php
@@ -198,18 +198,18 @@ class OC_Files {
OC::$server->getLogger()->logException($ex);
$l = \OC::$server->getL10N('core');
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : '';
- \OC_Template::printErrorPage($l->t('File is currently busy, please try again later'), $hint);
+ \OC_Template::printErrorPage($l->t('File is currently busy, please try again later'), $hint, 200);
} catch (\OCP\Files\ForbiddenException $ex) {
self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
OC::$server->getLogger()->logException($ex);
$l = \OC::$server->getL10N('core');
- \OC_Template::printErrorPage($l->t('Can\'t read file'), $ex->getMessage());
+ \OC_Template::printErrorPage($l->t('Can\'t read file'), $ex->getMessage(), 200);
} catch (\Exception $ex) {
self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
OC::$server->getLogger()->logException($ex);
$l = \OC::$server->getL10N('core');
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : '';
- \OC_Template::printErrorPage($l->t('Can\'t read file'), $hint);
+ \OC_Template::printErrorPage($l->t('Can\'t read file'), $hint, 200);
}
}
diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php
index 3cca8245af0..4e89b18c144 100644
--- a/lib/private/legacy/template.php
+++ b/lib/private/legacy/template.php
@@ -306,7 +306,7 @@ class OC_Template extends \OC\Template\Base {
* @param string $hint An optional hint message - needs to be properly escape
* @suppress PhanAccessMethodInternal
*/
- public static function printErrorPage( $error_msg, $hint = '' ) {
+ public static function printErrorPage( $error_msg, $hint = '', $statusCode = \OC_Response::STATUS_INTERNAL_SERVER_ERROR ) {
if (\OC::$server->getAppManager()->isEnabledForUser('theming') && !\OC_App::isAppLoaded('theming')) {
\OC_App::loadApp('theming');
}
@@ -317,6 +317,7 @@ class OC_Template extends \OC\Template\Base {
$hint = '';
}
+ http_response_code($statusCode);
try {
$content = new \OC_Template( '', 'error', 'error', false );
$errors = array(array('error' => $error_msg, 'hint' => $hint));
@@ -327,7 +328,6 @@ class OC_Template extends \OC\Template\Base {
$logger->error("$error_msg $hint", ['app' => 'core']);
$logger->logException($e, ['app' => 'core']);
- header(self::getHttpProtocol() . ' 500 Internal Server Error');
header('Content-Type: text/plain; charset=utf-8');
print("$error_msg $hint");
}