Skip to content

Commit

Permalink
Fixed the unit test for Validate/StringLength
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Apr 13, 2016
1 parent 206479c commit 3b045d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/Zend/Validate/StringLength.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ public function setEncoding($encoding = null)
? iconv_get_encoding('internal_encoding')
: ini_get('default_charset');
if (PHP_VERSION_ID < 50600) {
$result = iconv_set_encoding('internal_encoding', $encoding);
if ($encoding) {
$result = iconv_set_encoding('internal_encoding', $encoding);
} else {
$result = false;
}
} else {
ini_set('default_charset', $encoding);
$result = ini_get('default_charset');
Expand All @@ -219,7 +223,6 @@ public function setEncoding($encoding = null)
ini_set('default_charset', $orig);
}
}

$this->_encoding = $encoding;
return $this;
}
Expand Down

0 comments on commit 3b045d0

Please sign in to comment.