Merge branch 'master' into next
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / page / AbstractArticlePage.class.php
index eac31b84cabe27c9194d8ccd3b53719a47daaed4..ea5675d33924d8c65e85f96fe70c5c4cf82ac518 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 namespace wcf\page;
 use wcf\data\article\category\ArticleCategory;
 use wcf\data\article\content\ViewableArticleContent;
@@ -19,7 +20,7 @@ use wcf\system\WCF;
  * Abstract implementation of the article page.
  *
  * @author     Marcel Werk
- * @copyright  2001-2017 WoltLab GmbH
+ * @copyright  2001-2018 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\Page
  * @since      3.0
@@ -77,6 +78,12 @@ abstract class AbstractArticlePage extends AbstractPage {
                if ($this->articleContent === null) {
                        throw new IllegalLinkException();
                }
+               
+               // check if the language has been disabled
+               if ($this->articleContent->languageID && LanguageFactory::getInstance()->getLanguage($this->articleContent->languageID) === null) {
+                       throw new IllegalLinkException();
+               }
+               
                $this->article = ViewableArticle::getArticle($this->articleContent->articleID, false);
                $this->category = $this->article->getCategory();