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

Commit c53c06f

Browse files
committed
Fix Notice: Array to string conversion in Zend/Filter/StringTrim.php zendframework#711
1 parent ba7d7f8 commit c53c06f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/Zend/Filter/StringTrim.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ class Zend_Filter_StringTrim implements Zend_Filter_Interface
4646
* Sets filter options
4747
*
4848
* @param string|array|Zend_Config $options
49-
* @return void
5049
*/
5150
public function __construct($options = null)
5251
{
5352
if ($options instanceof Zend_Config) {
5453
$options = $options->toArray();
55-
} else if (!is_array($options)) {
54+
} elseif (!is_array($options)) {
5655
$options = func_get_args();
5756
$temp['charlist'] = array_shift($options);
5857
$options = $temp;
@@ -95,6 +94,9 @@ public function setCharList($charList)
9594
*/
9695
public function filter($value)
9796
{
97+
if (!is_string($value)) {
98+
return $value;
99+
}
98100
if (null === $this->_charList) {
99101
return $this->_unicodeTrim((string) $value);
100102
} else {

0 commit comments

Comments
 (0)