|
From: SourceForge.net <no...@so...> - 2005-06-30 07:52:54
|
Bugs item #1230190, was opened at 2005-06-30 09:50 Message generated for change (Settings changed) made by thevivi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430840&aid=1230190&group_id=41586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core - Core Group: XOOPS 2.0.x Status: Open Resolution: None >Priority: 2 Submitted By: {Vivi} (thevivi) Assigned to: Nobody/Anonymous (nobody) Summary: Criteria class Initial Comment: A little issue in criteria class. Here, the incrimined function function render() { if ( is_numeric($this->value) || strtoupper($this->operator) == 'IN') { $value = $this->value; } else { if ( '' === ($value = trim($this->value)) ) { return ''; } if ( (substr($value, 0, 1) != '`') && (substr($value, -1) != '`') ) { $value = "'$value'"; } } $clause = (!empty($this->prefix) ? "{$this->prefix}." : "") . $this->column; if ( !empty($this->function) ) { $clause = sprintf($this->function, $clause); } $clause .= " {$this->operator} $value"; return $clause; } And here the incrimined line if ( '' === ($value = trim($this->value)) ) { return ''; } This may cause little render fail every time value is === ''. But criteria may be : myField <> '' . So with this code these criteria are impossible. My suggestion if ( '' === ($value = trim($this->value)) ) { return ''; } replaced by $value = trim($this->value); because checking $this->value === '' will not bring additional features and it will not be more fast. Thanks for your attention, Vivi. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430840&aid=1230190&group_id=41586 |