mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-20 16:56:02 +00:00
Full fix for internal expansion of named parameters.
This commit is contained in:
parent
d667b39702
commit
2d47ed519f
@ -344,20 +344,14 @@ class AwlQuery
|
||||
global $c;
|
||||
|
||||
if ( isset($this->sth) ) return; // Already prepared
|
||||
if ( isset($c->expand_pdo_parameters) && $c->expand_pdo_parameters ) return; // No-op if we're expanding internally
|
||||
|
||||
if ( !isset($this->connection) ) {
|
||||
_awl_connect_configured_database();
|
||||
$this->connection = $GLOBALS['_awl_dbconn'];
|
||||
}
|
||||
|
||||
if ( isset($c->expand_pdo_parameters) && $c->expand_pdo_parameters
|
||||
&& isset($this->bound_parameters) ) {
|
||||
$this->bound_querystring = $this->connection->ReplaceParameters($this->querystring,$this->bound_parameters);
|
||||
$this->sth = true;
|
||||
}
|
||||
else {
|
||||
$this->sth = $this->connection->prepare( $this->querystring );
|
||||
}
|
||||
$this->sth = $this->connection->prepare( $this->querystring );
|
||||
|
||||
if ( ! $this->sth ) {
|
||||
$this->error_info = $this->connection->errorInfo();
|
||||
@ -377,19 +371,21 @@ class AwlQuery
|
||||
$this->connection = $GLOBALS['_awl_dbconn'];
|
||||
}
|
||||
|
||||
if (
|
||||
!isset($this->bound_querystring)
|
||||
&& isset($c->expand_pdo_parameters) && $c->expand_pdo_parameters
|
||||
&& isset($this->bound_parameters)
|
||||
) {
|
||||
$this->bound_querystring = $this->connection->ReplaceParameters($this->querystring,$this->bound_parameters);
|
||||
if ( isset($c->expand_pdo_parameters) && $c->expand_pdo_parameters ) {
|
||||
if ( isset($this->bound_parameters) ) {
|
||||
$this->bound_querystring = $this->connection->ReplaceParameters($this->querystring,$this->bound_parameters);
|
||||
// printf( "\n=============================================================== OQ\n%s\n", $this->querystring);
|
||||
// printf( "\n=============================================================== QQ\n%s\n", $this->bound_querystring);
|
||||
// print_r( $this->bound_parameters );
|
||||
}
|
||||
else {
|
||||
$this->bound_querystring = $this->querystring;
|
||||
}
|
||||
}
|
||||
|
||||
$t1 = microtime(true); // get start time
|
||||
if ( isset($this->bound_querystring) || !isset($this->bound_parameters) ) {
|
||||
if ( ! isset($this->bound_querystring) ) $this->bound_querystring = $this->querystring;
|
||||
if ( isset($this->bound_querystring) ) {
|
||||
$this->sth = $this->connection->query($this->bound_querystring);
|
||||
// printf( "\n=============================================================== QQ\n%s\n", $this->bound_querystring);
|
||||
$this->bound_querystring = null;
|
||||
if ( ! $this->sth ) {
|
||||
$this->error_info = $this->connection->errorInfo();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user