Skip to content

Commit

Permalink
Ignore linebreaks in regexp for join where clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Nov 10, 2016
1 parent 403915d commit 0993d45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/fabrik_element/databasejoin/databasejoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ protected function buildQueryWhere($data = array(), $incWhere = true, $thisTable
$thisTableAlias = is_null($thisTableAlias) ? $join->table_join_alias : $thisTableAlias;

// $$$rob 11/10/2011 remove order by statements which will be re-inserted at the end of buildQuery()
if (preg_match('/(ORDER\s+BY)(.*)/i', $where, $matches))
if (preg_match('/(ORDER\s+BY)(.*)/is', $where, $matches))
{
$this->orderBy = $this->parseThisTable($matches[0], $join);
$where = str_replace($this->orderBy, '', $where);
Expand Down Expand Up @@ -1075,7 +1075,7 @@ protected function buildQueryWhere($data = array(), $incWhere = true, $thisTable
$filterWhere = trim($params->get('database_join_filter_where_sql', ''));
if (FArrayHelper::getValue($opts, 'mode', '') === 'filter' && !empty($filterWhere))
{
if (preg_match('/(ORDER\s+BY)(.*)/i', $filterWhere, $matches))
if (preg_match('/(ORDER\s+BY)(.*)/is', $filterWhere, $matches))
{
$this->orderBy = $this->parseThisTable($matches[0], $join);
$filterWhere = str_replace($this->orderBy, '', $filterWhere);
Expand Down

0 comments on commit 0993d45

Please sign in to comment.