-
Notifications
You must be signed in to change notification settings - Fork 368
Closed
Milestone
Description
Issue
When logging is on:
ORM::configure('logging', true);
Queries containing the "%":
$many = Model::factory('user')->where("active",1)->where_raw('username like "ben%"')->find_many();
Raise PHP warning:
Warning: vsprintf() : Too few arguments in idiorm.php on line 267
Because % must be escaped in the query for vsprintf.
Fix
In idiorm.php, line 264:
$query = str_replace("?", "%s", $query);
should be:
$query = str_replace("?", "%s", str_replace("%","%%",$query));
This fixes the problem for the "%" chars.
Second issue
The problem remains with the "?" char inside the query:
$many = Model::factory('book')->where("active",1)->where_raw('comments like "has been released?%"')->find_many();
vsprintf raises the same error.
— Ben
Metadata
Metadata
Assignees
Labels
No labels