Commit 40b7b14f authored by monolit's avatar monolit

explode queries by any whitespaces, not only spaces

parent 59900906
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment