Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fixed preg_replace deprecated error in PHP 5.5
- Loading branch information
Showing
with
3 additions
and
1 deletion.
-
+3
−1
classes/database/connection.php
|
@@ -635,8 +635,10 @@ public function quote_identifier($value) |
|
|
|
|
|
if (strpos($value, '"') !== false) |
|
|
{ |
|
|
// required for PHP 5.5- (no access to $this in closure) |
|
|
$that = $this; |
|
|
// Quote the column in FUNC("ident") identifiers |
|
|
return preg_replace('/"(.+?)"/e', '$this->quote_identifier("$1")', $value); |
|
|
return preg_replace_callback('/"(.+?)"/', function ($matches) use($that) { return $that->quote_identifier($matches[1]); }, $value); |
|
|
} |
|
|
elseif (preg_match("/^'(.*)?'$/", $value)) |
|
|
{ |
|
|