Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 590cde7

Browse files
committed
Correctly handle OR queries in the listing module (see #6344)
1 parent 75c7078 commit 590cde7

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

system/docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Contao Open Source CMS changelog
44
Version 3.2.9 (2014-XX-XX)
55
--------------------------
66

7+
### Fixed
8+
Correctly handle OR queries in the listing module (see #6344).
9+
710
### Fixed
811
Use a monospaced font for the plain text newsletter preview (see #6790).
912

system/modules/listing/dca/tl_module.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
'label' => &$GLOBALS['TL_LANG']['tl_module']['list_search'],
5454
'exclude' => true,
5555
'inputType' => 'text',
56-
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
56+
'eval' => array('decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
5757
'sql' => "varchar(255) NOT NULL default ''"
5858
);
5959

@@ -71,7 +71,7 @@
7171
'label' => &$GLOBALS['TL_LANG']['tl_module']['list_info'],
7272
'exclude' => true,
7373
'inputType' => 'text',
74-
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
74+
'eval' => array('decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
7575
'sql' => "varchar(255) NOT NULL default ''"
7676
);
7777

system/modules/listing/modules/ModuleListing.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function generate()
8080

8181
$this->strTemplate = $this->list_layout;
8282
$this->list_where = $this->replaceInsertTags($this->list_where);
83+
$this->list_info_where = $this->replaceInsertTags($this->list_info_where);
8384

8485
return parent::generate();
8586
}
@@ -137,7 +138,7 @@ protected function compile()
137138

138139
if ($this->list_where)
139140
{
140-
$strQuery .= " WHERE " . $this->list_where;
141+
$strQuery .= " WHERE (" . $this->list_where . ")";
141142
}
142143

143144
$strQuery .= $strWhere;
@@ -177,7 +178,7 @@ protected function compile()
177178

178179
if ($this->list_where)
179180
{
180-
$strQuery .= " WHERE " . $this->list_where;
181+
$strQuery .= " WHERE (" . $this->list_where . ")";
181182
}
182183

183184
$strQuery .= $strWhere;
@@ -366,7 +367,7 @@ protected function listSingleRecord($id)
366367
$this->list_info = deserialize($this->list_info);
367368
$this->list_info_where = $this->replaceInsertTags($this->list_info_where);
368369

369-
$objRecord = $this->Database->prepare("SELECT " . $this->list_info . " FROM " . $this->list_table . " WHERE " . (($this->list_info_where != '') ? $this->list_info_where . " AND " : "") . $this->strPk . "=?")
370+
$objRecord = $this->Database->prepare("SELECT " . $this->list_info . " FROM " . $this->list_table . " WHERE " . (($this->list_info_where != '') ? "(" . $this->list_info_where . ") AND " : "") . $this->strPk . "=?")
370371
->limit(1)
371372
->execute($id);
372373

0 commit comments

Comments
 (0)