Bug fix for compatibility of db classes with php 4.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9167 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-09-15 16:07:25 +00:00
parent 36190f9521
commit cb8e8cbccb
4 changed files with 17 additions and 13 deletions

View file

@ -61,13 +61,15 @@
function parseExpression($column_name){
$functions = preg_split('/([\+\-\*\/\ ])/', $column_name, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
foreach($functions as &$function){
foreach($functions as $k => $v){
$function = &$functions[$k];
if(strlen($function)==1) continue; // skip delimiters
$pos = strrpos("(", $function);
$matches = preg_split('/([a-zA-Z0-9_*]+)/', $function, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
$total_brackets = substr_count($function, "(");
$brackets = 0;
foreach($matches as &$match){
foreach($matches as $i => $j){
$match = &$matches[$i];
if($match == '(') {$brackets++; continue;}
if(strpos($match,')') !== false) continue;
if(in_array($match, array(',', '.'))) continue;