[BUGFIX] Hide unsafe extensions in EM TER list
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Domain / Repository / ExtensionRepository.php
index 939f65c..2114dcc 100644 (file)
@@ -109,7 +109,11 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
         */
        public function findOneByExtensionKeyAndVersion($extensionKey, $version) {
                $query = $this->createQuery();
-               $query->matching($query->logicalAnd($query->equals('extensionKey', $extensionKey), $query->equals('version', $version)));
+               $query->matching($query->logicalAnd(
+                       $query->equals('extensionKey', $extensionKey),
+                       $query->equals('version', $version),
+                       $query->greaterThanOrEqual('reviewState', 0)
+               ));
                return $query->setLimit(1)->execute()->getFirst();
        }
 
@@ -143,7 +147,7 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
                                        OR
                                        title LIKE ' . $quotedSearchStringForLike . '
                                )
-                               AND current_version=1
+                               AND current_version=1 AND review_state >= 0
                                HAVING position > 0';
                $order = 'position desc';
                $result = $this->databaseConnection->exec_SELECTgetRows($select, $from, $where, '', $order);
@@ -254,9 +258,16 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
         */
        protected function addDefaultConstraints(\TYPO3\CMS\Extbase\Persistence\Generic\Query $query) {
                if ($query->getConstraint()) {
-                       $query->matching($query->logicalAnd($query->getConstraint(), $query->equals('current_version', TRUE)));
+                       $query->matching($query->logicalAnd(
+                               $query->getConstraint(),
+                               $query->equals('current_version', TRUE),
+                               $query->greaterThanOrEqual('reviewState', 0)
+                       ));
                } else {
-                       $query->matching($query->equals('current_version', TRUE));
+                       $query->matching($query->logicalAnd(
+                               $query->equals('current_version', TRUE),
+                               $query->greaterThanOrEqual('reviewState', 0)
+                       ));
                }
                return $query;
        }