Hide notice for missing phrases on ACP index page if file is empty
authorMatthias Schmidt <gravatronics@live.com>
Sat, 27 Jul 2019 07:24:07 +0000 (09:24 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 27 Jul 2019 07:24:07 +0000 (09:24 +0200)
See #2983

wcfsetup/install/files/lib/acp/page/IndexPage.class.php

index f36432cd9851c6dc832f59de8c9ed706c3b2fd32..f696acf23b6a480212ded50e8a8e66bb67c4f256 100755 (executable)
@@ -7,6 +7,7 @@ use wcf\system\io\RemoteFile;
 use wcf\system\package\PackageInstallationDispatcher;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
+use wcf\util\StringUtil;
 
 /**
  * Shows the welcome page in admin control panel.
@@ -114,7 +115,12 @@ class IndexPage extends AbstractPage {
                }
                
                $missingLanguageItemsMTime = 0;
-               if (ENABLE_DEBUG_MODE && ENABLE_DEVELOPER_TOOLS && file_exists(WCF_DIR . 'log/missingLanguageItems.txt')) {
+               if (
+                       ENABLE_DEBUG_MODE
+                       && ENABLE_DEVELOPER_TOOLS
+                       && file_exists(WCF_DIR . 'log/missingLanguageItems.txt')
+                       && mb_strlen(StringUtil::trim(file_get_contents(WCF_DIR . 'log/missingLanguageItems.txt'))) > 0
+               ) {
                        $missingLanguageItemsMTime = filemtime(WCF_DIR . 'log/missingLanguageItems.txt');
                }