Merging fixes and enhancements into trunk.

Revision: [2092]
Added fix for = not being added the conditions.
Corrected paths for test suite.
  Test are now located in app/test/

Revision: [2090]
Added fix to DboSource::conditions() that will check for the escaped single quotes.
Before this fix any matching single quote pair could cause failure

Revision: [2089]
Fixed duplicate WHERE being added to the sql string

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@2093 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-02-22 18:35:41 +00:00
parent 8ab148a598
commit e16bb286e0
3 changed files with 9 additions and 6 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
0.10.8.2088
0.10.8.2093

View file

@ -139,7 +139,7 @@ define('SCRIPTS', CAKE.'scripts'.DS);
/**
* Path to the tests directory.
*/
define ('TESTS', ROOT.DS.'tests'.DS);
define ('TESTS', APP.'tests'.DS);
/**
* Path to the controller test directory.

View file

@ -1019,7 +1019,7 @@ class DboSource extends DataSource
{
if (!preg_match('/^WHERE\\x20|^GROUP\\x20BY\\x20|^HAVING\\x20|^ORDER\\x20BY\\x20/i', $conditions, $match))
{
$clause = ' WHERE ';
$clause = 'WHERE ';
}
}
if (is_string($conditions))
@ -1041,7 +1041,7 @@ class DboSource extends DataSource
{
$end = '\\\\'.$this->endQuote.'\\\\';
}
preg_match_all('/(\'{1}[-\\w\\s~`!@#$%^&*()_+={[}|:;"<,>.?\/*|\\]\\\]*\'{1})|(?P<field>[a-z0-9_'.$start.$end.']*\\.[a-z0-9_'.$start.$end.']*)/i', $conditions, $match, PREG_PATTERN_ORDER);
preg_match_all('/(\'[^\'\\\]*(?:\\\.[^\'\\\]*)*\')|(?P<field>[a-z0-9_'.$start.$end.']*\\.[a-z0-9_'.$start.$end.']*)/i', $conditions, $match, PREG_PATTERN_ORDER);
if(isset($match['field'][0]))
{
@ -1059,7 +1059,7 @@ class DboSource extends DataSource
}
else
{
$clause = ' WHERE ';
$clause = 'WHERE ';
$out = array();
$count = 0;
$operator = null;
@ -1089,7 +1089,10 @@ class DboSource extends DataSource
$operator = $regs['conditional'];
$key = preg_replace('/'.$regs['conditional'].'/', '', $key);
}
if(empty($match['operator']))
{
$match['operator'] = ' = ';
}
if (strpos($match['value'], '--return') === 0)
{
$match['value'] = str_replace('--return', '', $match['value']);