Undefined variable: array
Closed this issue · 1 comments
GabMic commented
After upgrading to laravel 7, i have this issue for some reason.
Undefined variable: array
In here:
* @return string[] Array of purified HTML
*/
public function purifyArray($array_of_html, $config = null)
{
$context_array = array();
foreach($array_of_html as $key=>$value){
if (is_array($value)) {
$array[$key] = $this->purifyArray($value, $config);
} else {
$array[$key] = $this->purify($value, $config);
}
$context_array[$key] = $this->context;
}
$this->context = $context_array;
return $array;
}
What can be the problem?
stevebauman commented
I would run composer update
and make sure you're on the latest HTMLPurifier, as I see the array being defined in the root repository here:
public function purifyArray($array_of_html, $config = null)
{
$context_array = array();
$array = array();
foreach($array_of_html as $key=>$value){
if (is_array($value)) {
$array[$key] = $this->purifyArray($value, $config);
} else {
$array[$key] = $this->purify($value, $config);
}
$context_array[$key] = $this->context;
}
$this->context = $context_array;
return $array;
}