Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix/2670' into develop

Forward port #2670
  • Loading branch information...
commit 8943900b8db3b65c8f767dca9c9bd3c0100200f1 2 parents a5632a4 + 83ca33c
@akrabat akrabat authored
View
6 library/Zend/Db/Adapter/Platform/Mysql.php
@@ -46,7 +46,7 @@ public function getQuoteIdentifierSymbol()
*/
public function quoteIdentifier($identifier)
{
- return '`' . str_replace('`', '\\' . '`', $identifier) . '`';
+ return '`' . str_replace('`', '``', $identifier) . '`';
}
/**
@@ -57,7 +57,7 @@ public function quoteIdentifier($identifier)
*/
public function quoteIdentifierChain($identifierChain)
{
- $identifierChain = str_replace('`', '\\`', $identifierChain);
+ $identifierChain = str_replace('`', '``', $identifierChain);
if (is_array($identifierChain)) {
$identifierChain = implode('`.`', $identifierChain);
}
@@ -134,7 +134,7 @@ public function quoteIdentifierInFragment($identifier, array $safeWords = array(
case 'as':
break;
default:
- $parts[$i] = '`' . str_replace('`', '\\' . '`', $part) . '`';
+ $parts[$i] = '`' . str_replace('`', '``', $part) . '`';
}
}
return implode('', $parts);
View
5 tests/ZendTest/Db/Adapter/Platform/MysqlTest.php
@@ -50,6 +50,7 @@ public function testGetQuoteIdentifierSymbol()
public function testQuoteIdentifier()
{
$this->assertEquals('`identifier`', $this->platform->quoteIdentifier('identifier'));
+ $this->assertEquals('`ident``ifier`', $this->platform->quoteIdentifier('ident`ifier'));
}
/**
@@ -60,6 +61,10 @@ public function testQuoteIdentifierChain()
$this->assertEquals('`identifier`', $this->platform->quoteIdentifierChain('identifier'));
$this->assertEquals('`identifier`', $this->platform->quoteIdentifierChain(array('identifier')));
$this->assertEquals('`schema`.`identifier`', $this->platform->quoteIdentifierChain(array('schema','identifier')));
+
+ $this->assertEquals('`ident``ifier`', $this->platform->quoteIdentifierChain('ident`ifier'));
+ $this->assertEquals('`ident``ifier`', $this->platform->quoteIdentifierChain(array('ident`ifier')));
+ $this->assertEquals('`schema`.`ident``ifier`', $this->platform->quoteIdentifierChain(array('schema','ident`ifier')));
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.