FIX Replace deprecated create_function with closure

This commit is contained in:
Robbie Averill 2017-11-15 10:58:49 +13:00
parent e001b68232
commit 9106371f30
1 changed files with 4 additions and 1 deletions

View File

@ -499,7 +499,10 @@ abstract class SearchIndex extends ViewableData
*/
protected function _getFieldValue($object, $field)
{
set_error_handler(create_function('$no, $str', 'throw new Exception("HTML Parse Error: ".$str);'), E_ALL);
$errorHandler = function ($no, $str) {
throw new Exception('HTML Parse Error: ' . $str);
};
set_error_handler($errorHandler, E_ALL);
try {
foreach ($field['lookup_chain'] as $step) {