hey, right after the escaping update, some queries and models dont work anymore.
1. problem : first query after session is loaded ( DatabaseHandler )
2. problem : model stores escaping info twice
insert & update throw exception
-> my current workaround is to disable escaping at all ( before & after every query )
-> but cant use it in production without escaping -> need to wait for fix
1. problem : first query after session is loaded ( DatabaseHandler )
PHP Code:
Services::session()->start();
Database::connect()->query( 'SELECT A FROM B WHERE C=?', [ '2' ] );
2. problem : model stores escaping info twice
PHP Code:
class ExampleEntity extends Entity
{
protected $id;
protected $timestamp;
}
class ExampleModel extends Model
{
protected $table = 'sessions';
protected $primaryKey = 'id';
protected $returnType = '\App\Models\ExampleEntity';
}
$Model = new ExampleModel();
$Entity = $Model->find( '0' );
$New = $Entity === null;
if( $New ) $Entity = new ExampleEntity( ['id' => '0' ] );
Database::connect()->setEscapeFlags( true );
$Entity->timestamp = 0;
if( $New ) $Model->protect(false)->insert( $Entity, false );
else $Model->protect(false)->update( '0', $Entity );
insert & update throw exception
-> my current workaround is to disable escaping at all ( before & after every query )
-> but cant use it in production without escaping -> need to wait for fix