Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Ldap] Escape carriage returns in LDAP DNs.
- Loading branch information
1 parent
dd78303
commit 2243db4
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Ldap\Tests; | ||
|
||
use Symfony\Component\Ldap\LdapClient; | ||
use Symfony\Polyfill\Php56\Php56 as p; | ||
|
||
/** | ||
* @requires extension ldap | ||
*/ | ||
class LdapClientTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testLdapEscape() | ||
{ | ||
$ldap = new LdapClient(); | ||
|
||
$this->assertEquals('\20foo\3dbar\0d(baz)*\20', $ldap->escape(" foo=bar\r(baz)* ", null, p::LDAP_ESCAPE_DN)); | ||
} | ||
} |