2014-02-26 29 views
0

我有一個錯誤在文件:Abstract.php用htmlspecialchars()預計參數1是字符串,數組給定在Zend的

Warning: htmlspecialchars() expects parameter 1 to be string,array given in /usr/local/zend/share/ZendFramework/library/Zend/View/Abstract.php on line 905 

我有這樣的上線905:

public function escape($var) 
{ 
    if (in_array($this->_escape, array('htmlspecialchars', 'htmlentities'))) { 
     return call_user_func($this->_escape, $var, ENT_COMPAT, $this->_encoding); 
    } 

    if (1 == func_num_args()) { 
     return call_user_func($this->_escape, $var); 
    } 
    $args = func_get_args(); 
    return call_user_func_array($this->_escape, $args); 
} 

我不明白這個...

+0

也許你提供一些更多的細節,以便更容易爲他人提供幫助。 – Volker

回答

0

大概你給$this->escape()函數加了數組。

如果你不知道要在那裏然後添加到文件Abstract.php是這樣的:

if(is_array($var)){ 
    Zend_Debug::dump($var);//this will print variable causing problem 
    //OR 
    throw new Exception(' ');//this will print debug backtrace showing which line caused problem 
} 
相關問題