Beispiel #1
0
 /**
  * Quote Trusted Value
  *
  * The ability to quote values without notices
  *
  * @param $value
  * @return mixed
  */
 public function quoteTrustedValue($value)
 {
     if ($this->resource instanceof \mysqli) {
         return '\'' . $this->resource->real_escape_string($value) . '\'';
     }
     if ($this->resource instanceof \PDO) {
         return $this->resource->quote($value);
     }
     return '\'' . addcslashes($value, "\n\r\\'\"") . '\'';
 }
Beispiel #2
0
 /**
  * Quote Trusted Value
  *
  * The ability to quote values without notices
  *
  * @param $value
  * @return mixed
  */
 public function quoteTrustedValue($value)
 {
     if ($this->resource instanceof DriverInterface) {
         $this->resource = $this->resource->getConnection()->getResource();
     }
     if ($this->resource instanceof \mysqli) {
         return '\'' . $this->resource->real_escape_string($value) . '\'';
     }
     if ($this->resource instanceof \PDO) {
         return $this->resource->quote($value);
     }
     return '\'' . addcslashes($value, "\n\r\\'\"") . '\'';
 }