Permalink
Browse files

fixed preg_replace deprecated error in PHP 5.5

  • Loading branch information...
1 parent 3c6f046 commit 270ba79b39e93317e88260a162872ea48e8cfb2c @WanWizard WanWizard committed Aug 8, 2013
Showing with 3 additions and 1 deletion.
  1. +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))
{

0 comments on commit 270ba79

Please sign in to comment.