public static function realEscape($string) { return preg_replace(array('/[\\r\\n]+/', '/(^ |[\\\\]|[,#+<>;"=*\\(\\)\\/]| $)/'), array('', '\\\\$1'), $string); }
/** * @test * @dataProvider providerRealEscape * @param string $input Input string * @param string $expected Expected string */ public function testRealEscape($input, $expected) { $this->assertEquals($expected, LdapClient::realEscape($input)); }