From: Alexander Ebert Date: Fri, 24 Apr 2015 14:28:33 +0000 (+0200) Subject: Sending 404 when there is no actual content X-Git-Tag: 2.1.4~58 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=87671357792e999bd5b0bb903255f71f93c86c27;p=GitHub%2FWoltLab%2FWCF.git Sending 404 when there is no actual content --- diff --git a/wcfsetup/install/files/lib/form/SearchForm.class.php b/wcfsetup/install/files/lib/form/SearchForm.class.php index 4aff50893b..9119a4753c 100644 --- a/wcfsetup/install/files/lib/form/SearchForm.class.php +++ b/wcfsetup/install/files/lib/form/SearchForm.class.php @@ -286,6 +286,8 @@ class SearchForm extends AbstractCaptchaForm { * Throws a NamedUserException on search failure. */ public function throwNoMatchesException() { + @header('HTTP/1.0 404 Not Found'); + if (empty($this->query)) { throw new NamedUserException(WCF::getLanguage()->get('wcf.search.error.user.noMatches')); } diff --git a/wcfsetup/install/files/lib/page/MembersListPage.class.php b/wcfsetup/install/files/lib/page/MembersListPage.class.php index 88f1355fea..6873bc1a10 100644 --- a/wcfsetup/install/files/lib/page/MembersListPage.class.php +++ b/wcfsetup/install/files/lib/page/MembersListPage.class.php @@ -160,5 +160,9 @@ class MembersListPage extends SortablePage { 'sidebarName' => 'com.woltlab.wcf.user.MembersListPage', 'allowSpidersToIndexThisPage' => true )); + + if (count($this->objectList) === 0) { + @header('HTTP/1.0 404 Not Found'); + } } } diff --git a/wcfsetup/install/files/lib/page/TaggedPage.class.php b/wcfsetup/install/files/lib/page/TaggedPage.class.php index fdcfbddb89..3325d97057 100644 --- a/wcfsetup/install/files/lib/page/TaggedPage.class.php +++ b/wcfsetup/install/files/lib/page/TaggedPage.class.php @@ -154,5 +154,9 @@ class TaggedPage extends MultipleLinkPage { 'resultListApplication' => $this->objectType->getProcessor()->getApplication(), 'allowSpidersToIndexThisPage' => true )); + + if (count($this->objectList) === 0) { + @header('HTTP/1.0 404 Not Found'); + } } }