1
0
mirror of synced 2024-12-14 15:16:04 +03:00

explode queries by any whitespaces, not only spaces

This commit is contained in:
monolit 2007-04-20 13:06:22 +00:00
parent 5990090652
commit 40b7b14fb7

View File

@ -1278,11 +1278,18 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
*/
public static function sqlExplode($str, $d = ' ', $e1 = '(', $e2 = ')')
{
if ($d == ' ') {
$d = array(' ', '\s');
}
if(is_array($d)) {
if (in_array(' ', $d)) {
$d[] = '\s';
}
$str = preg_split('/('.implode('|', $d).')/', $str);
$d = stripslashes($d[0]);
} else
} else {
$str = explode("$d",$str);
}
$i = 0;
$term = array();