mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
8ab148a598
commit
e16bb286e0
3 changed files with 9 additions and 6 deletions
|
@ -6,4 +6,4 @@
|
||||||
// +---------------------------------------------------------------------------------------------------+ //
|
// +---------------------------------------------------------------------------------------------------+ //
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
0.10.8.2088
|
0.10.8.2093
|
|
@ -139,7 +139,7 @@ define('SCRIPTS', CAKE.'scripts'.DS);
|
||||||
/**
|
/**
|
||||||
* Path to the tests directory.
|
* Path to the tests directory.
|
||||||
*/
|
*/
|
||||||
define ('TESTS', ROOT.DS.'tests'.DS);
|
define ('TESTS', APP.'tests'.DS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to the controller test directory.
|
* Path to the controller test directory.
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ class DboSource extends DataSource
|
||||||
{
|
{
|
||||||
$end = '\\\\'.$this->endQuote.'\\\\';
|
$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]))
|
if(isset($match['field'][0]))
|
||||||
{
|
{
|
||||||
|
@ -1089,7 +1089,10 @@ class DboSource extends DataSource
|
||||||
$operator = $regs['conditional'];
|
$operator = $regs['conditional'];
|
||||||
$key = preg_replace('/'.$regs['conditional'].'/', '', $key);
|
$key = preg_replace('/'.$regs['conditional'].'/', '', $key);
|
||||||
}
|
}
|
||||||
|
if(empty($match['operator']))
|
||||||
|
{
|
||||||
|
$match['operator'] = ' = ';
|
||||||
|
}
|
||||||
if (strpos($match['value'], '--return') === 0)
|
if (strpos($match['value'], '--return') === 0)
|
||||||
{
|
{
|
||||||
$match['value'] = str_replace('--return', '', $match['value']);
|
$match['value'] = str_replace('--return', '', $match['value']);
|
||||||
|
|
Loading…
Reference in a new issue