Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Problem with output_filter
  • Hi,

    I have this problem. I enabled output_filtering, like this:

    'output_filter'  => array('Security::htmlentities'),

    'whitelisted_classes' => array(

    But now I get errors when loading query data...

    $query = \DB::select()
                ->where('user_id', '=', $user_id)
                ->order_by('date', 'DESC')

            return $query;

    I get this error: Database results are read-only
  • When I do this:

    $query = \DB::select()
                ->where('user_id', '=', $user_id)
                ->order_by('date', 'DESC')

    it seems to work...  But I want to use objects...
  • The DB driver does:

                if ($as_object === false)
                    $result = $result->fetchAll(\PDO::FETCH_ASSOC);
                elseif (is_string($as_object))
                    $result = $result->fetchAll(\PDO::FETCH_CLASS, $as_object);
                    $result = $result->fetchAll(\PDO::FETCH_CLASS, 'stdClass');

                // Return an iterator of results
                return new \Database_Result_Cached($result, $sql, $as_object);

    so ->as_object() should return a collection of stdClass objects.

    It is Database_Result_Cached which is read-only, and should be excluded in the whitelist, not stdClass.
  • Ok... I will try. I use mysqli btw
  • mmm doesn't seem to work... if I whitelist Database_Result_Cached...

    What I noticed is when I select the current() record, it works...
  • Or is it only possible to pass arrays to my view?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion