madcorp / zfdatagrid

Automatically exported from code.google.com/p/zfdatagrid
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Bug in Grid.php , line 1590 if (in_array(rtrim($fl[0], $this->getGridId()), $fields)) { #816

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi.

In Grid.php, 
line 1590 ,  
if (in_array(rtrim($fl[0], $this->getGridId()), $fields)) {
there is a bug. 
There you are trying to remove with function rtrim the id of the grid.
but rtrim is not doing that, it is removing all characters which are in string 
$this->getGridId()  from the right part of the string $fl[0] . 

Check here:
http://php.net/rtrim

string rtrim ( string $str [, string $charlist ] )

I think you should replace it with:
                    if (in_array(preg_replace("/(.*)".$this->getGridId()."$/","$1",$fl[0]), $fields)) {

Original issue reported on code.google.com by re...@bejenaru.com on 30 Jan 2012 at 11:45

GoogleCodeExporter commented 9 years ago
Also, at line 1232, in Grid.php , you have this line:

                $filter = urldecode($filter);
There are cases when $filter is an array, and urldecode expects a string there, 
so you should put something like:

 if(!is_array($filter)){
                        $filter = urldecode($filter);
                }

Original comment by re...@bejenaru.com on 30 Jan 2012 at 11:49

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1924.

Original comment by licentia...@gmail.com on 6 May 2012 at 6:06