Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 3b045d0

Browse files
committed
Fixed the unit test for Validate/StringLength
1 parent 206479c commit 3b045d0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

library/Zend/Validate/StringLength.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ public function setEncoding($encoding = null)
203203
? iconv_get_encoding('internal_encoding')
204204
: ini_get('default_charset');
205205
if (PHP_VERSION_ID < 50600) {
206-
$result = iconv_set_encoding('internal_encoding', $encoding);
206+
if ($encoding) {
207+
$result = iconv_set_encoding('internal_encoding', $encoding);
208+
} else {
209+
$result = false;
210+
}
207211
} else {
208212
ini_set('default_charset', $encoding);
209213
$result = ini_get('default_charset');
@@ -219,7 +223,6 @@ public function setEncoding($encoding = null)
219223
ini_set('default_charset', $orig);
220224
}
221225
}
222-
223226
$this->_encoding = $encoding;
224227
return $this;
225228
}

0 commit comments

Comments
 (0)