File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 3535use Product ;
3636use Shop ;
3737use Symfony \Component \Translation \TranslatorInterface ;
38+ use Validate ;
3839use WishList ;
3940
4041/**
@@ -167,7 +168,10 @@ private function getProductsOrCount(
167168
168169 if ('products ' === $ type ) {
169170 $ sortOrder = $ query ->getSortOrder ()->toLegacyOrderBy (true );
170- $ querySearch ->orderBy ($ sortOrder . ' ' . $ query ->getSortOrder ()->toLegacyOrderWay ());
171+ $ sortWay = $ query ->getSortOrder ()->toLegacyOrderWay ();
172+ if (Validate::isOrderBy ($ sortOrder ) && Validate::isOrderWay ($ sortWay )) {
173+ $ querySearch ->orderBy ($ sortOrder . ' ' . $ sortWay );
174+ }
171175 $ querySearch ->limit ((int ) $ query ->getResultsPerPage (), ((int ) $ query ->getPage () - 1 ) * (int ) $ query ->getResultsPerPage ());
172176 $ products = $ this ->db ->executeS ($ querySearch );
173177
You can’t perform that action at this time.
0 commit comments