Follow-up of changeset #28324: Quoting when part of CASE WHEN flow control
authorXavier Perseguers <typo3@perseguers.ch>
Mon, 4 Jan 2010 22:12:12 +0000 (22:12 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Mon, 4 Jan 2010 22:12:12 +0000 (22:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@28377 735d13b6-9817-0410-8766-e36946ffe9aa

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']);
+                                       } 
                                }
                        }
                }