Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/3324'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Converter/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Converter
*/
public static function ascToHex32($string)
{
for ($i = 0; $i < strlen($string); $i++) {
for ($i = 0, $len = strlen($string); $i < $len; $i++) {
$char = substr($string, $i, 1);
if (ord($char) < 32) {
$hex = dechex(ord($char));
Expand Down
4 changes: 2 additions & 2 deletions src/Dn.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,10 @@ public static function escapeValue($values = array())
// Convert all leading and trailing spaces to sequences of \20.
if (preg_match('/^(\s*)(.+?)(\s*)$/', $val, $matches)) {
$val = $matches[2];
for ($i = 0; $i < strlen($matches[1]); $i++) {
for ($i = 0, $len = strlen($matches[1]); $i < $len; $i++) {
$val = '\20' . $val;
}
for ($i = 0; $i < strlen($matches[3]); $i++) {
for ($i = 0, $len = strlen($matches[3]); $i < $len; $i++) {
$val = $val . '\20';
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ldif/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected function encodeString($string, &$base64 = null)
$unsafe_char = array(0, 10, 13);

$base64 = false;
for ($i = 0; $i < strlen($string); $i++) {
for ($i = 0, $len = strlen($string); $i < $len; $i++) {
$char = ord(substr($string, $i, 1));
if ($char >= 127) {
$base64 = true;
Expand Down

0 comments on commit 99a6970

Please sign in to comment.