Skip to content

Commit

Permalink
fixed 500 error when accessing non-existing share and add a more comp…
Browse files Browse the repository at this point in the history
…lete error message when this happens
  • Loading branch information
moscicki committed Sep 30, 2015
1 parent beb45fa commit 90d8f19
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/templates/404.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<?php else: ?>
<ul>
<li class="error">
<?php p($l->t('File not found')); ?><br/>
<p class="hint"><?php p($l->t('The specified document has not been found on the server.')); ?></p>
<?php p($l->t('Resource not found.')); ?><br/>
<p class="hint"><?php p($l->t('Share may not longer exist: removed or expired. File or directory may have been deleted.')); ?></p>
<p class="hint"><a href="<?php p(OC_Helper::linkTo('', 'index.php')) ?>"><?php p($l->t('You can click here to return to %s.', array($theme->getName()))); ?></a></p>
</li>
</ul>
Expand Down
43 changes: 43 additions & 0 deletions lib/public/appframework/http/notfoundresponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* @author Lukas Reschke <lukas@owncloud.com>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

namespace OCP\AppFramework\Http;

use OCP\AppFramework\Http;
use OCP\Template;

/**
* A generic 404 response showing an 404 error page as well to the end-user
*/
class NotFoundResponse extends Response {

public function __construct() {
$this->setStatus(404);
}

/**
* @return string
*/
public function render() {
$template = new Template('core', '404', 'guest');
return $template->fetchPage();
}
}

0 comments on commit 90d8f19

Please sign in to comment.