Follow-up of changeset #28324: Quoting when part of CASE WHEN flow control
[Packages/TYPO3.CMS.git] / typo3 / sysext / dbal / class.ux_t3lib_db.php
index 77a9ad3..9ca75ff 100644 (file)
@@ -1055,8 +1055,13 @@ class ux_t3lib_DB extends t3lib_DB {
                        }
                        if (isset($select_fields[$k]['flow-control'])) {
                                        // Quoting flow-control statements
-                               if ($select_fields[$k]['flow-control']['type'] === 'CASE' && isset($select_fields[$k]['flow-control']['case_field'])) {
-                                       $select_fields[$k]['flow-control']['case_field'] = $this->quoteFieldNames($select_fields[$k]['flow-control']['case_field']); 
+                               if ($select_fields[$k]['flow-control']['type'] === 'CASE') {
+                                       if (isset($select_fields[$k]['flow-control']['case_field'])) {
+                                               $select_fields[$k]['flow-control']['case_field'] = $this->quoteFieldNames($select_fields[$k]['flow-control']['case_field']);
+                                       }
+                                       foreach ($select_fields[$k]['flow-control']['when'] as $key => $when) {
+                                               $select_fields[$k]['flow-control']['when'][$key]['when_value'] = $this->_quoteWhereClause($when['when_value']);
+                                       } 
                                }
                        }
                }