diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-03-24 13:37:47 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-03-24 13:37:47 +0100 |
commit | 302c19067a5ba81c0aa76ac93733049a2bba374b (patch) | |
tree | cb8fec84ab5c09436cfe88078a6798a95e918b49 /lib | |
parent | 83580d08ebb5efd212cef1dc61e3c4427a556786 (diff) | |
parent | d46b7d73e74acb3bb7df653a89dd5300c706c3fa (diff) | |
download | nextcloud-server-302c19067a5ba81c0aa76ac93733049a2bba374b.tar.gz nextcloud-server-302c19067a5ba81c0aa76ac93733049a2bba374b.zip |
Merge pull request #15145 from owncloud/fix-15097-master
Properly catch whether a share is `null`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/appframework/http/notfoundresponse.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/public/appframework/http/notfoundresponse.php b/lib/public/appframework/http/notfoundresponse.php new file mode 100644 index 00000000000..21f0461f5e6 --- /dev/null +++ b/lib/public/appframework/http/notfoundresponse.php @@ -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(); + } +} |