bgultekin / laravel4-datatables-package

Server-side handler of DataTables Jquery Plugin for Laravel 4
267 stars 108 forks source link

Bug with wildcard method? #144

Closed phazei closed 10 years ago

phazei commented 10 years ago

Maybe I don't understand what the wildcard method should do, but currently it makes it do a wildcard search for every single individual character that's typed in the search. If that's intentional then disregard this.

Otherwise, it seems it would make more sense that it would do a wildcard for every word searched for.

If the whole function were replaced with:

public function wildcard_like_string($str, $lowercase = true)
{
    if ($lowercase)
        $str = lowercase($str);

    return preg_replace('\s+', '%', $str);
}

It would accomplish that.

ktunkiewicz commented 10 years ago

You are absolutly right about this... I'm not an author of this function and the funny is I never noticed that it works like this... I don't know what was the authors intention here. I'm just woried about that some people might have used to have a wildcard method like this, since this method was here from the begining... Can you make a pull request?