Skip to content

Commit

Permalink
- Add missing part to make colon in parameter binding optional
Browse files Browse the repository at this point in the history
  • Loading branch information
helly25 committed Jul 22, 2005
1 parent e4b07b3 commit d8eece2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ext/pdo/pdo_stmt.c
Expand Up @@ -303,7 +303,14 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
}

if (param->name) {
param->name = estrndup(param->name, param->namelen);
if (is_param && param->name[0] != ':') {
char *temp = emalloc(++param->namelen + 1);
temp[0] = ':';
memmove(temp+1, param->name, param->namelen);
param->name = temp;
} else {
param->name = estrndup(param->name, param->namelen);
}
zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), (void**)&pparam);
} else {
zend_hash_index_update(hash, param->paramno, param, sizeof(*param), (void**)&pparam);
Expand Down

0 comments on commit d8eece2

Please sign in to comment.