0

Line with error:

$msg = $purifier->$purify($result['Message']);

Error:

Notice: Undefined variable: purify in /storage/ssd5/777/1537777/public_html/inc/ticketBody.php on line 41

and

Fatal error: Uncaught Error: Method name must be a string in /storage/ssd5/777/1537777/public_html/inc/ticketBody.php:41 Stack trace: #0 {main} thrown in /storage/ssd5/777/1537777/public_html/inc/ticketBody.php on line 41

Config:

require_once '../HTMLPurifier/library/HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Allowed', 'div, *[style|class]');
$purifier = new HTMLPurifier($config);

I don't understand what is the issue...

1 Answers1

1

It should be:

$purifier->purify($result['Message']);

as referenced in the docs, not

$purifier->$purify($result['Message']);

You do not have a $purify variable declared, hence the error.

P.S: The initial syntax is valid because you might want to dynamic call methods, check this

ka_lin
  • 9,329
  • 6
  • 35
  • 56