public static function quote($value, $pdotype = PDO::PARAM_STR) { if ($pdotype == PDO::PARAM_INT) return (int)$value; return Db::pdo()->quote($value, $pdotype); }
According to PDO developers, this is a deliberate mistake in their code and in their documentation.
It seems that they do not plan to fix it, so you can do it yourself by wrapping your erroneous function and replacing it as necessary.
You really have no choice, since in some cases you need to have the correct quoting behavior for numbers, you cannot just use string quoting everywhere, because SQL may just not accept it.
As a side element, the above function will make 0 of any illegal data.
SQL injections are not possible, but this will not result in an error. If you want to catch errors, you can make "strlen" for both variables, and if this is different from what you know, a problem or attempted intrusion has occurred.
source share