| @@ 189-198 (lines=10) @@ | ||
| 186 | * @return string The escaped string |
|
| 187 | * @throws DatabaseException If an error was encountered during server-side escape |
|
| 188 | */ |
|
| 189 | public function escape($value) |
|
| 190 | { |
|
| 191 | $this->ping(); |
|
| 192 | ||
| 193 | if (($value = $this->getConnection()->real_escape_string((string) $value)) === false) { |
|
| 194 | throw new DatabaseException($this->getConnection()->error, $this->getConnection()->errno); |
|
| 195 | } |
|
| 196 | ||
| 197 | return "'".$value."'"; |
|
| 198 | } |
|
| 199 | } |
|
| 200 | ||
| @@ 177-188 (lines=12) @@ | ||
| 174 | * @return string The escaped string |
|
| 175 | * @throws DatabaseException If an error was encountered during server-side escape |
|
| 176 | */ |
|
| 177 | public function escape($value) |
|
| 178 | { |
|
| 179 | $this->ensureConnection(); |
|
| 180 | ||
| 181 | if (($value = $this->getConnection()->real_escape_string((string) $value)) === false) { |
|
| 182 | // @codeCoverageIgnoreStart |
|
| 183 | throw new DatabaseException($this->getConnection()->error, $this->getConnection()->errno); |
|
| 184 | // @codeCoverageIgnoreEnd |
|
| 185 | } |
|
| 186 | ||
| 187 | return "'".$value."'"; |
|
| 188 | } |
|
| 189 | ||
| 190 | /** |
|
| 191 | * Enter UTF-8 multi-byte workaround mode. |
|