Fix SQL foreignKeys check, if the returning value is a string
authorJoshua Rüsweg <ruesweg@woltlab.com>
Tue, 27 Aug 2019 11:21:26 +0000 (13:21 +0200)
committerJoshua Rüsweg <ruesweg@woltlab.com>
Tue, 27 Aug 2019 11:21:34 +0000 (13:21 +0200)
Some compiled PHP versions do not return the correct type when you query the database. The explicit comparison then fails.

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

index cf1f535beecdba048d2730f57bc16401f08476d0..ceb4c7fa31859639441c2127676c0dc9a6492a82 100644 (file)
@@ -249,7 +249,7 @@ class SystemCheckPage extends AbstractPage {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditionBuilder->getParameters());
                
-               $this->results['mysql']['foreignKeys'] = $statement->fetchSingleColumn() === $expectedForeignKeyCount;
+               $this->results['mysql']['foreignKeys'] = $statement->fetchSingleColumn() == $expectedForeignKeyCount;
                
                // check search engine tables
                $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.searchableObjectType');